cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r631004 - in /incubator/cxf/trunk: common/common/src/main/java/org/apache/cxf/configuration/spring/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/transports/http-jetty...
Date Mon, 25 Feb 2008 21:35:27 GMT
Author: dkulp
Date: Mon Feb 25 13:35:25 2008
New Revision: 631004

URL: http://svn.apache.org/viewvc?rev=631004&view=rev
Log:
class.getPackage() returns null if the class is in the default package.   Make sure we don't
NPE in that case.

Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?rev=631004&r1=631003&r2=631004&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
Mon Feb 25 13:35:25 2008
@@ -252,7 +252,7 @@
         Object obj = null;
         try {
             String pkg = getJaxbPackage();
-            if (null != c) {
+            if (null != c && c.getPackage() != null) {
                 pkg = c.getPackage().getName();
             }
             context = JAXBContext.newInstance(pkg, getClass().getClassLoader());

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=631004&r1=631003&r2=631004&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
Mon Feb 25 13:35:25 2008
@@ -473,7 +473,7 @@
         }
 
         String tns = webService.targetNamespace();
-        if (tns.length() == 0) {
+        if (tns.length() == 0 && seiClass.getPackage() != null) {
             tns = URIParserUtil.getNamespace(seiClass.getPackage().getName());
         }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=631004&r1=631003&r2=631004&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Mon Feb 25 13:35:25 2008
@@ -375,7 +375,7 @@
             getServiceConfigurations().add(0, jaxWsConfiguration);
             
             Class<?> seiClass = ii.getEndpointClass();
-            if (seiClass != null) {
+            if (seiClass != null && seiClass.getPackage() != null) {
                 XmlSchema schema = seiClass.getPackage().getAnnotation(XmlSchema.class);
                 if (schema != null && XmlNsForm.QUALIFIED.equals(schema.elementFormDefault()))
{
                     setQualifyWrapperSchema(true);

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java?rev=631004&r1=631003&r2=631004&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java
(original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JAXBHelper.java
Mon Feb 25 13:35:25 2008
@@ -49,7 +49,7 @@
            
         JAXBContext context = null;
         String pkg = "";
-        if (null != c) {
+        if (null != c && c.getPackage() != null) {
             pkg = c.getPackage().getName();
             context = JAXBContext.newInstance(pkg, c.getClassLoader());
         } else {
@@ -80,7 +80,7 @@
         }
         JAXBContext context = null;
         String pkg = "";
-        if (null != c) {
+        if (null != c && c.getPackage() != null) {
             pkg = c.getPackage().getName();
             context = JAXBContext.newInstance(pkg, c.getClassLoader());
         } else {

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java?rev=631004&r1=631003&r2=631004&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2ws/util/JavaFirstUtil.java
Mon Feb 25 13:35:25 2008
@@ -27,6 +27,7 @@
 import org.apache.cxf.service.model.InterfaceInfo;
 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.JavaException;
 import org.apache.cxf.tools.common.model.JavaInterface;
 import org.apache.cxf.tools.common.model.JavaMethod;
@@ -67,7 +68,11 @@
             jreturn.setStyle(Style.OUT);
             jm.setReturn(jreturn);
 
-            javaInf.setPackageName(m.getDeclaringClass().getPackage().getName());
+            if (m.getDeclaringClass().getPackage() != null) {
+                javaInf.setPackageName(m.getDeclaringClass().getPackage().getName());
+            } else {
+                javaInf.setPackageName(ToolConstants.DEFAULT_PACKAGE_NAME);
+            }
             javaInf.addMethod(jm);
             javaInf.setName(inf.getName().getLocalPart());
 

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java?rev=631004&r1=631003&r2=631004&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/FaultBean.java
Mon Feb 25 13:35:25 2008
@@ -25,6 +25,7 @@
 import javax.xml.ws.WebFault;
 
 import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.model.JavaClass;
 import org.apache.cxf.tools.common.model.JavaField;
 import org.apache.cxf.tools.java2wsdl.generator.wsdl11.annotator.WrapperBeanAnnotator;
@@ -61,8 +62,13 @@
 
         buildBeanFields(exceptionClass, jClass);
 
-        jClass.setElementName(new QName(URIParserUtil.getNamespace(exceptionClass.getPackage().getName()),
+        if (exceptionClass.getPackage() != null) {
+            jClass.setElementName(new QName(URIParserUtil.getNamespace(exceptionClass.getPackage().getName()),
                                         exceptionClass.getSimpleName()));
+        } else {
+            jClass.setElementName(new QName(URIParserUtil.getNamespace(ToolConstants.DEFAULT_PACKAGE_NAME),
+                                            exceptionClass.getSimpleName()));
+        }
         jClass.annotate(new WrapperBeanAnnotator());
         
         return jClass;

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java?rev=631004&r1=631003&r2=631004&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JAXWSFrontEndProcessor.java
Mon Feb 25 13:35:25 2008
@@ -123,7 +123,11 @@
             jreturn.setStyle(Style.OUT);
             jm.setReturn(jreturn);
 
-            javaInf.setPackageName(m.getDeclaringClass().getPackage().getName());
+            if (m.getDeclaringClass().getPackage() != null) {
+                javaInf.setPackageName(m.getDeclaringClass().getPackage().getName());
+            } else {
+                javaInf.setPackageName(ToolConstants.DEFAULT_PACKAGE_NAME);
+            }
             javaInf.addMethod(jm);
             javaInf.setName(inf.getName().getLocalPart());
 



Mime
View raw message