Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 22D587517 for ; Fri, 9 Dec 2011 18:15:18 +0000 (UTC) Received: (qmail 32628 invoked by uid 500); 9 Dec 2011 18:15:18 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 32580 invoked by uid 500); 9 Dec 2011 18:15:18 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 32573 invoked by uid 99); 9 Dec 2011 18:15:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Dec 2011 18:15:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Dec 2011 18:15:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 209E22388A67 for ; Fri, 9 Dec 2011 18:14:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111209181456.209E22388A67@eris.apache.org> 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; }