You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2012/08/09 02:50:21 UTC

svn commit: r1371023 - in /cxf/branches/2.5.x-fixes/tools/wsdlto: frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/ test/src/test/resources/wsdl2java_wsdl/c...

Author: ffang
Date: Thu Aug  9 00:50:21 2012
New Revision: 1371023

URL: http://svn.apache.org/viewvc?rev=1371023&view=rev
Log:
[CXF-4452]NullPointerException when trying to customize the package name for a service definition without customizing the class name.

Added:
    cxf/branches/2.5.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf4452/
      - copied from r1370704, cxf/branches/2.6.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf4452/
    cxf/branches/2.5.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf4452/binding.xml
      - copied unchanged from r1370704, cxf/branches/2.6.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf4452/binding.xml
Modified:
    cxf/branches/2.5.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
    cxf/branches/2.5.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java

Modified: cxf/branches/2.5.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java?rev=1371023&r1=1371022&r2=1371023&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java (original)
+++ cxf/branches/2.5.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java Thu Aug  9 00:50:21 2012
@@ -205,7 +205,8 @@ public class ServiceProcessor extends Ab
                         name = name.substring(name.lastIndexOf('.') + 1);
                     }
                 }
-                if (serviceBinding2.getJaxwsClass().getComments() != null) {
+                if (serviceBinding2.getJaxwsClass() != null
+                    && serviceBinding2.getJaxwsClass().getComments() != null) {
                     jaxwsBinding.setClassJavaDoc(serviceBinding2.getJaxwsClass().getComments());
                 }
                 if (!serviceBinding2.getPackageJavaDoc().equals("")) {

Modified: cxf/branches/2.5.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=1371023&r1=1371022&r2=1371023&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java (original)
+++ cxf/branches/2.5.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java Thu Aug  9 00:50:21 2012
@@ -1175,4 +1175,16 @@ public class CodeGenBugTest extends Abst
             fail("shouldn't get exception");
         }
     }
+    
+    @Test
+    public void testCXF4452() throws Exception {
+        try {
+            env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+            env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf4452/binding.xml"));
+            processor.setContext(env);
+            processor.execute();
+        } catch (Exception e) {
+            fail("shouldn't get exception");
+        }
+    }
 }