cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r608269 - in /incubator/cxf/branches/2.0.x-fixes: ./ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/ tools/wsdlto/test/src/t...
Date Wed, 02 Jan 2008 22:38:06 GMT
Author: dkulp
Date: Wed Jan  2 14:38:05 2008
New Revision: 608269

URL: http://svn.apache.org/viewvc?rev=608269&view=rev
Log:
Merged revisions 607079 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r607079 | ema | 2007-12-27 10:30:19 -0500 (Thu, 27 Dec 2007) | 1 line
  
  [CXF-1334]Fixed the duplicate Handler annotation issue 
........

Added:
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/
      - copied from r607079, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.wsdl
      - copied unchanged from r607079, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.wsdl
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.xml
      - copied unchanged from r607079, incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf-1344/handlerbinding.xml
Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
    incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java?rev=608269&r1=608268&r2=608269&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/SEIGenerator.java
Wed Jan  2 14:38:05 2008
@@ -21,6 +21,8 @@
 
 import java.util.Map;
 
+import javax.jws.HandlerChain;
+
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ToolConstants;
@@ -88,10 +90,17 @@
                 handlerGen.generate(getEnvironment());
 
                 String annot = handlerGen.getHandlerAnnotation().toString();
-                if (handlerGen.getHandlerAnnotation() != null
-                    && !intf.getAnnotations().contains(annot)) {
-                    intf.addAnnotation(annot);
-                    intf.addImport("javax.jws.HandlerChain");
+                if (handlerGen.getHandlerAnnotation() != null) {
+                    boolean existHandlerAnno = false;
+                    for (JAnnotation jann : intf.getAnnotations()) {
+                        if (jann.getType() == HandlerChain.class) {
+                            existHandlerAnno = true;
+                        }
+                    }
+                    if (!existHandlerAnno) {
+                        intf.addAnnotation(annot);
+                        intf.addImport("javax.jws.HandlerChain");
+                    }
                 }
             }
             clearAttributes();

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java?rev=608269&r1=608268&r2=608269&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ServiceGenerator.java
Wed Jan  2 14:38:05 2008
@@ -21,6 +21,8 @@
 
 import java.util.Map;
 
+import javax.jws.HandlerChain;
+
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.ToolConstants;
@@ -82,11 +84,21 @@
                 handlerGen.generate(getEnvironment());
 
                 String annot = handlerGen.getHandlerAnnotation().toString();
-                if (handlerGen.getHandlerAnnotation() != null
-                    && !js.getAnnotations().contains(annot)) {
-                    js.addAnnotation(annot);
+                               
+                if (handlerGen.getHandlerAnnotation() != null) {
+                    boolean existHandlerAnno = false;
+                    for (JAnnotation jann : js.getAnnotations()) {
+                        if (jann.getType() == HandlerChain.class) {
+                            existHandlerAnno = true;
+                        }
+                    }
+                    if (!existHandlerAnno) {
+                        js.addAnnotation(annot);
+                        js.addImport("javax.jws.HandlerChain");
+                    }
                     js.addImport("javax.jws.HandlerChain");
                 }
+                
             }
 
             

Modified: incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?rev=608269&r1=608268&r2=608269&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
(original)
+++ incubator/cxf/branches/2.0.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Wed Jan  2 14:38:05 2008
@@ -1133,4 +1133,14 @@
             assertTrue(e.getMessage().indexOf(": is not a valid char in the targetNamespace")
!= -1);
         }
     }
+
+    
+    @Test
+    public void testHandlerAnnotation() throws Exception {
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/cxf-1344/handlerbinding.wsdl"));
+        env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf-1344/handlerbinding.xml"));
+        processor.setContext(env);
+        processor.execute();
+    }
+    
 }



Mime
View raw message