You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/12/09 18:41:23 UTC
svn commit: r1212538 -
/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
Author: dkulp
Date: Fri Dec 9 17:41:23 2011
New Revision: 1212538
URL: http://svn.apache.org/viewvc?rev=1212538&view=rev
Log:
[CXF-3969] Allow WrapperStyleNameCollisionValidator to consider the
bareMethods flag
Modified:
cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java?rev=1212538&r1=1212537&r2=1212538&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java (original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/validator/WrapperStyleNameCollisionValidator.java Fri Dec 9 17:41:23 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;
}