cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1212558 - in /cxf/branches/2.4.x-fixes: ./ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
Date Fri, 09 Dec 2011 18:14:56 GMT
Author: dkulp
Date: Fri Dec  9 18:14:55 2011
New Revision: 1212558

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

........
  r1212538 | dkulp | 2011-12-09 12:41:23 -0500 (Fri, 09 Dec 2011) | 2 lines
  
  [CXF-3969] Allow WrapperStyleNameCollisionValidator to consider the
  bareMethods flag
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java

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

Modified: cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java?rev=1212558&r1=1212557&r2=1212558&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
(original)
+++ cxf/branches/2.4.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
Fri Dec  9 18:14:55 2011
@@ -66,7 +66,26 @@ public class WrapperStyleNameCollisionVa
         }
         return true;
     }
-
+    private boolean checkArray(String[] ar, String n) {
+        if (ar != null) {
+            if (ar.length == 0) {
+                return true;
+            }
+            for (String s : ar) {
+                if (s.equals(n)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+    private boolean checkBare(ToolContext context, String opName) {
+        String o[] = context.getArray(ToolConstants.CFG_BAREMETHODS);
+        if (checkArray(o, opName)) {
+            return true;
+        }
+        return false;
+    }
     private boolean isValidOperation(OperationInfo operation) {
         ToolContext context = service.getProperty(ToolContext.class.getName(), ToolContext.class);
         
@@ -76,21 +95,39 @@ public class WrapperStyleNameCollisionVa
         if (operation.getUnwrappedOperation() == null) {
             valid = true;
         }
+
+        String operationName = operation.getName().getLocalPart();
+        operationName = ProcessorUtil.mangleNameToVariableName(operationName);
+
         
         JAXWSBinding binding = (JAXWSBinding)operation.getExtensor(JAXWSBinding.class);
-        if (binding != null && !binding.isEnableWrapperStyle()) {
-            valid = true;
+        if (binding != null) {
+            if (!binding.isEnableWrapperStyle()) {
+                valid = true;
+            } else if (binding.getMethodName() != null) {
+                operationName = binding.getMethodName();
+            }
         }
         binding = operation.getInterface().getExtensor(JAXWSBinding.class);
-        if (binding != null && !binding.isEnableWrapperStyle()) {
-            valid = true;
+        if (binding != null) {
+            if (!binding.isEnableWrapperStyle()) {
+                valid = true;
+            } else if (binding.getMethodName() != null) {
+                operationName = binding.getMethodName();
+            }
         }
         binding = operation.getInterface().getService()
             .getDescription().getExtensor(JAXWSBinding.class);
-        if (binding != null && !binding.isEnableWrapperStyle()) {
-            valid = true;
+        if (binding != null) {
+            if (!binding.isEnableWrapperStyle()) {
+                valid = true;
+            } else if (binding.getMethodName() != null) {
+                operationName = binding.getMethodName();
+            }
         }
         
+        valid |= checkBare(context, operationName);
+        
         if (valid) {
             return true;
         }



Mime
View raw message