cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r677048 - in /cxf/trunk: api/src/main/java/org/apache/cxf/wsdl/ common/common/src/main/java/org/apache/cxf/configuration/spring/ parent/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/main/java/org/apache/cxf/ja...
Date Tue, 15 Jul 2008 21:31:25 GMT
Author: dkulp
Date: Tue Jul 15 14:31:24 2008
New Revision: 677048

URL: http://svn.apache.org/viewvc?rev=677048&view=rev
Log:
[CXF-1689] Patch from Hani Suleiman applied.
Update to latest wsdl4j

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
    cxf/trunk/parent/pom.xml
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java
    cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java
    cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java
    cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java Tue Jul 15 14:31:24
2008
@@ -110,7 +110,10 @@
                 String ns = elAnnot.namespace();
                 if (StringUtils.isEmpty(ns)
                     || "##default".equals(ns)) {
-                    XmlSchema schema = cls.getPackage().getAnnotation(XmlSchema.class);
+                    XmlSchema schema = null;
+                    if (cls.getPackage() != null) {
+                        schema = cls.getPackage().getAnnotation(XmlSchema.class);
+                    }
                     if (schema != null) {
                         ns = schema.namespace();
                     }

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
Tue Jul 15 14:31:24 2008
@@ -38,6 +38,7 @@
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.CacheMap;
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.springframework.beans.factory.BeanDefinitionStoreException;
@@ -254,8 +255,8 @@
         JAXBContext context = null;
         try {
             String pkg = getJaxbPackage();
-            if (null != c && c.getPackage() != null) {
-                pkg = c.getPackage().getName();
+            if (null != c) {
+                pkg = PackageUtils.getPackageName(c);
             }
             context = packageContextCache.get(pkg);
             if (context == null) {

Modified: cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/parent/pom.xml?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/parent/pom.xml (original)
+++ cxf/trunk/parent/pom.xml Tue Jul 15 14:31:24 2008
@@ -51,7 +51,7 @@
         <saaj.impl.version>1.3</saaj.impl.version>
         <spring.version>2.0.8</spring.version>
         <spring.mock>spring-mock</spring.mock>
-        <wsdl4j.version>1.6.1</wsdl4j.version>
+        <wsdl4j.version>1.6.2</wsdl4j.version>
         <derby.version>10.2.2.0</derby.version>
         <activemq.version>4.1.1</activemq.version>
         <rhino.version>1.6R7</rhino.version>

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Tue Jul
15 14:31:24 2008
@@ -51,6 +51,7 @@
 import org.apache.cxf.binding.BindingFactoryManager;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.databinding.DataBinding;
@@ -488,8 +489,8 @@
         }
 
         String tns = webService.targetNamespace();
-        if (tns.length() == 0 && seiClass.getPackage() != null) {
-            tns = URIParserUtil.getNamespace(seiClass.getPackage().getName());
+        if (tns.length() == 0) {
+            tns = URIParserUtil.getNamespace(PackageUtils.getPackageName(seiClass));
         }
 
         return new QName(tns, name);

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java
Tue Jul 15 14:31:24 2008
@@ -41,6 +41,7 @@
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.ASMHelper;
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.JavaUtils;
 import org.apache.cxf.jaxb.JAXBUtils;
@@ -70,11 +71,8 @@
     }
 
     private String getPackageName(Method method) {
-        Package pkg = method.getDeclaringClass().getPackage();
-        if (pkg == null) {
-            return ToolConstants.DEFAULT_PACKAGE_NAME;
-        }
-        return pkg.getName();
+        String pkg = PackageUtils.getPackageName(method.getDeclaringClass());
+        return pkg.length() == 0 ? ToolConstants.DEFAULT_PACKAGE_NAME : pkg;
     }
 
     private Annotation[] getMethodParameterAnnotations(final MessagePartInfo mpi) {

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java
Tue Jul 15 14:31:24 2008
@@ -29,6 +29,7 @@
 import javax.xml.bind.JAXBElement;
 import javax.xml.bind.annotation.XmlElement;
 
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.jaxb.JAXBUtils;
@@ -54,7 +55,7 @@
         List<Field> fields = new ArrayList<Field>(partNames.size());
         
         Method allMethods[] = wrapperType.getMethods();
-        String packageName = wrapperType.getName().substring(0, wrapperType.getName().lastIndexOf("."));
+        String packageName = PackageUtils.getPackageName(wrapperType);
         
         //if wrappertype class is generated by ASM,getPackage() always return null
         if (wrapperType.getPackage() != null) {

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsImplementorInfo.java
Tue Jul 15 14:31:24 2008
@@ -223,12 +223,8 @@
     }
 
     private String getDefaultNamespace(Class clazz) {
-        Package pkg = clazz.getPackage();
-        if (pkg == null) {
-            return "http://unknown.namespace/";
-        } else {
-            return PackageUtils.getNamespace(pkg.getName());
-        }
+        String pkg = PackageUtils.getNamespace(PackageUtils.getPackageName(clazz));
+        return StringUtils.isEmpty(pkg) ? "http://unknown.namespace/" : pkg;
     }
         
     private String getWSInterfaceName(Class<?> implClz) {

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Tue Jul 15 14:31:24 2008
@@ -53,6 +53,7 @@
 import org.apache.cxf.binding.AbstractBindingFactory;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.databinding.source.SourceDataBinding;
 import org.apache.cxf.endpoint.Endpoint;
@@ -351,7 +352,7 @@
         try {
             if (java.rmi.ServerException.class.isAssignableFrom(exClass)
                 || java.rmi.RemoteException.class.isAssignableFrom(exClass)
-                || "javax.xml.ws".equals(exClass.getPackage().getName())) {
+                || "javax.xml.ws".equals(PackageUtils.getPackageName(exClass))) {
                 return null;
             }
 

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java
Tue Jul 15 14:31:24 2008
@@ -28,6 +28,7 @@
 import org.w3c.dom.NodeList;
 
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.configuration.jsse.TLSClientParameters;
 import org.apache.cxf.configuration.jsse.spring.TLSClientParametersConfig;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
@@ -106,7 +107,7 @@
         // the configured TLSClientParameters into the HTTPConduit.
         JAXBContext context = null;
         try {
-            context = JAXBContext.newInstance(TLSClientParametersType.class.getPackage().getName(),

+            context = JAXBContext.newInstance(PackageUtils.getPackageName(TLSClientParametersType.class),

                     getClass().getClassLoader());
             Unmarshaller u = context.createUnmarshaller();
             JAXBElement<TLSClientParametersType> jaxb = 

Modified: cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
(original)
+++ cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/VersionTransformer.java
Tue Jul 15 14:31:24 2008
@@ -36,6 +36,7 @@
 // importation convention: if the same class name is used for 
 // 2005/08 and 2004/08, then the former version is imported
 // and the latter is fully qualified when used
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.staxutils.W3CDOMStreamReader;
 import org.apache.cxf.ws.addressing.v200408.AttributedQName;
@@ -45,7 +46,6 @@
 import org.apache.cxf.ws.addressing.v200408.ServiceNameType;
 import org.apache.cxf.wsdl.EndpointReferenceUtils;
 
-
 /**
  * This class is responsible for transforming between the native 
  * WS-Addressing schema version (i.e. 2005/08) and exposed
@@ -386,7 +386,7 @@
                 if (jaxbContext == null) {
                     Class clz = org.apache.cxf.ws.addressing.v200408.ObjectFactory.class;
                     jaxbContext =
-                        JAXBContext.newInstance(clz.getPackage().getName(),
+                        JAXBContext.newInstance(PackageUtils.getPackageName(clz),
                                                 clz.getClassLoader());
                 }
             }

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java
(original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/EndpointReferenceDomainExpressionBuilder.java
Tue Jul 15 14:31:24 2008
@@ -33,6 +33,7 @@
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.ws.policy.PolicyException;
 
@@ -90,7 +91,8 @@
         
         try {
             Class clz = EndpointReferenceType.class;
-            JAXBContext context = JAXBContext.newInstance(clz.getPackage().getName(), clz.getClassLoader());
+            String pkg = PackageUtils.getPackageName(clz);
+            JAXBContext context = JAXBContext.newInstance(pkg, clz.getClassLoader());
             unmarshaller = context.createUnmarshaller();
         } catch (JAXBException ex) {
             throw new PolicyException(new Message("EPR_DOMAIN_EXPRESSION_BUILDER_INIT_EXC",
BUNDLE, 

Modified: cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original)
+++ cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Tue Jul 15 14:31:24
2008
@@ -37,6 +37,7 @@
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.binding.soap.model.SoapOperationInfo;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.databinding.DataBinding;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.interceptor.Interceptor;
@@ -247,7 +248,7 @@
         try {
             JAXBContext ctx =
                 JAXBContext.newInstance(
-                    CreateSequenceType.class.getPackage().getName(),
+                    PackageUtils.getPackageName(CreateSequenceType.class),
                     CreateSequenceType.class.getClassLoader());
             dataBinding = new JAXBDataBinding(ctx);
         } catch (JAXBException e) {

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java
Tue Jul 15 14:31:24 2008
@@ -23,6 +23,7 @@
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.InterfaceInfo;
 import org.apache.cxf.service.model.OperationInfo;
@@ -68,11 +69,8 @@
             jreturn.setStyle(Style.OUT);
             jm.setReturn(jreturn);
 
-            if (m.getDeclaringClass().getPackage() != null) {
-                javaInf.setPackageName(m.getDeclaringClass().getPackage().getName());
-            } else {
-                javaInf.setPackageName(ToolConstants.DEFAULT_PACKAGE_NAME);
-            }
+            String pkg = PackageUtils.getPackageName(m.getDeclaringClass());
+            javaInf.setPackageName(pkg.length() == 0 ? ToolConstants.DEFAULT_PACKAGE_NAME
: pkg);
             javaInf.addMethod(jm);
             javaInf.setName(inf.getName().getLocalPart());
 

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/WSDLGeneratorFactory.java
Tue Jul 15 14:31:24 2008
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.tools.java2wsdl.generator;
 
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.wsdl.WSDLConstants;
 
@@ -34,7 +35,7 @@
     }
 
     protected String getGeneratorClassName() {
-        String pkgName = getClass().getPackage().getName();
+        String pkgName = PackageUtils.getPackageName(getClass());
         return pkgName + "." + wsdlVersion.toString().toLowerCase() + "." + wsdlVersion +
"Generator";
     }
 

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGenerator.java
Tue Jul 15 14:31:24 2008
@@ -27,21 +27,22 @@
 import java.util.Set;
 import javax.wsdl.Fault;
 
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.model.JavaClass;
 import org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.FaultBean;
 
-
 public final class FaultBeanGenerator extends BeanGenerator {
 
     private String getSEIPackage(final Method method) {
-        Package pkg = method.getDeclaringClass().getPackage();
-        if (pkg == null) {
+        String pkg = PackageUtils.getPackageName(method.getDeclaringClass());
+        if (pkg.length() == 0) {
             return ToolConstants.DEFAULT_PACKAGE_NAME;
+        } else {
+            return pkg;
         }
-        return pkg.getName();
     }
     
     protected Collection<JavaClass> generateBeanClasses(final ServiceInfo serviceInfo)
{

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
Tue Jul 15 14:31:24 2008
@@ -27,6 +27,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.ws.WebFault;
 
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.model.JavaClass;
@@ -64,13 +65,14 @@
         }
 
         buildBeanFields(exceptionClass, jClass);
-
-        if (exceptionClass.getPackage() != null) {
-            jClass.setElementName(new QName(URIParserUtil.getNamespace(exceptionClass.getPackage().getName()),
+        
+        String pkg = PackageUtils.getPackageName(exceptionClass);
+        if (pkg.length() > 0) {
+            jClass.setElementName(new QName(URIParserUtil.getNamespace(pkg),
                                         exceptionClass.getSimpleName()));
         } else {
             jClass.setElementName(new QName(URIParserUtil.getNamespace(ToolConstants.DEFAULT_PACKAGE_NAME),
-                                            exceptionClass.getSimpleName()));
+                                        exceptionClass.getSimpleName()));
         }
         jClass.annotate(new WrapperBeanAnnotator());
         

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java
Tue Jul 15 14:31:24 2008
@@ -32,6 +32,7 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.InterfaceInfo;
@@ -125,11 +126,8 @@
             jreturn.setStyle(Style.OUT);
             jm.setReturn(jreturn);
 
-            if (m.getDeclaringClass().getPackage() != null) {
-                javaInf.setPackageName(m.getDeclaringClass().getPackage().getName());
-            } else {
-                javaInf.setPackageName(ToolConstants.DEFAULT_PACKAGE_NAME);
-            }
+            String pkg = PackageUtils.getPackageName(m.getDeclaringClass());
+            javaInf.setPackageName(pkg.length() > 0 ? pkg : ToolConstants.DEFAULT_PACKAGE_NAME);
             javaInf.addMethod(jm);
             javaInf.setName(inf.getName().getLocalPart());
 

Modified: cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java?rev=677048&r1=677047&r2=677048&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
(original)
+++ cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/Wrapper.java
Tue Jul 15 14:31:24 2008
@@ -28,6 +28,7 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.tools.common.ToolConstants;
@@ -133,11 +134,8 @@
     }
 
     protected String getPackageName(final Method m) {
-        Package pkg = m.getDeclaringClass().getPackage();
-        if (pkg == null) {
-            return ToolConstants.DEFAULT_PACKAGE_NAME;
-        }
-        return pkg.getName();
+        String pkg = PackageUtils.getPackageName(m.getDeclaringClass());
+        return pkg.length() == 0 ? ToolConstants.DEFAULT_PACKAGE_NAME : pkg;
     }
 
     public boolean isWrapperAbsent() {



Mime
View raw message