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 6A7CF10E07 for ; Thu, 24 Oct 2013 18:37:45 +0000 (UTC) Received: (qmail 94419 invoked by uid 500); 24 Oct 2013 18:36:56 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 94277 invoked by uid 500); 24 Oct 2013 18:36:50 -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 94104 invoked by uid 99); 24 Oct 2013 18:36:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Oct 2013 18:36:36 +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; Thu, 24 Oct 2013 18:36:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 263B02388AA6; Thu, 24 Oct 2013 18:36:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1535489 - in /cxf/branches/2.7.x-fixes/tools/corba/src: main/generated/org/apache/cxf/tools/corba/processors/idl/ main/java/org/apache/cxf/tools/corba/processors/idl/ test/java/org/apache/cxf/tools/corba/ test/resources/idl/ Date: Thu, 24 Oct 2013 18:36:14 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131024183615.263B02388AA6@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Thu Oct 24 18:36:14 2013 New Revision: 1535489 URL: http://svn.apache.org/r1535489 Log: Merged revisions 1535486 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1535486 | dkulp | 2013-10-24 14:33:34 -0400 (Thu, 24 Oct 2013) | 8 lines [CXF-5340] - Handling quoted literals and exception members "local" literal was incorrectly treated as literal. exception members' types where not identified correctly - "unsigned long" was treated as "unsigned" type with name "long" Patch from Grzegorz Grzybek applied ........ Added: cxf/branches/2.7.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl Modified: cxf/branches/2.7.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g cxf/branches/2.7.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java Modified: cxf/branches/2.7.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java?rev=1535489&r1=1535488&r2=1535489&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java (original) +++ cxf/branches/2.7.x-fixes/tools/corba/src/main/generated/org/apache/cxf/tools/corba/processors/idl/IDLLexer.java Thu Oct 24 18:36:14 2013 @@ -348,7 +348,6 @@ tryAgain: } if ( _returnToken==null ) continue tryAgain; // found SKIP token _ttype = _returnToken.getType(); - _ttype = testLiteralsTable(_ttype); _returnToken.setType(_ttype); return _returnToken; } Modified: cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java?rev=1535489&r1=1535488&r2=1535489&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java (original) +++ cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ExceptionVisitor.java Thu Oct 24 18:36:14 2013 @@ -99,7 +99,7 @@ public class ExceptionVisitor extends Vi // exception members AST memberTypeNode = identifierNode.getNextSibling(); while (memberTypeNode != null) { - AST memberNode = memberTypeNode.getNextSibling(); + AST memberNode = TypesUtils.getCorbaTypeNameNode(memberTypeNode); TypesVisitor visitor = new TypesVisitor(exceptionScope, definition, Modified: cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g?rev=1535489&r1=1535488&r2=1535489&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g (original) +++ cxf/branches/2.7.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/idl.g Thu Oct 24 18:36:14 2013 @@ -954,6 +954,7 @@ options { exportVocab=IDL; charVocabulary='\u0000'..'\uFFFE'; k=4; + testLiterals=false; } SEMI Modified: cxf/branches/2.7.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java?rev=1535489&r1=1535488&r2=1535489&view=diff ============================================================================== --- cxf/branches/2.7.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java (original) +++ cxf/branches/2.7.x-fixes/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java Thu Oct 24 18:36:14 2013 @@ -435,4 +435,39 @@ public class IDLToWSDLTest extends ToolT String s = StaxUtils.toString(doc.getDocumentElement()); assertTrue(s.contains("name=\"myStruct\"")); } + + public void testCXF5340() throws Exception { + File input = new File(getClass().getResource("/idl/CXF5340.idl").toURI()); + String[] args = new String[] { + "-o", output.toString(), + "-verbose", "-qualified", + input.toString() + }; + IDLToWSDL.run(args); + File fs = new File(output, "CXF5340.wsdl"); + assertTrue(fs.getName() + " was not created.", fs.exists()); + + String corbaNs = "http://cxf.apache.org/bindings/corba"; + Document doc = StaxUtils.read(new FileInputStream(fs)); + + // const with value "local" + NodeList nl = doc.getDocumentElement().getElementsByTagNameNS(corbaNs, "const"); + assertEquals(1, nl.getLength()); + Element c = (Element)nl.item(0); + assertEquals("repro.NOT_CONN_LOCAL", c.getAttribute("name")); + assertEquals("local", c.getAttribute("value")); + + // unsigned long case + nl = doc.getDocumentElement().getElementsByTagNameNS(corbaNs, "exception"); + assertEquals(1, nl.getLength()); + Element exception = (Element)nl.item(0); + nl = exception.getElementsByTagNameNS(corbaNs, "member"); + assertEquals(2, nl.getLength()); + Element number = (Element)nl.item(0); + assertEquals("ulong", number.getAttribute("idltype").split(":")[1]); + assertEquals("m_number", number.getAttribute("name")); + Element message = (Element)nl.item(1); + assertEquals("string", message.getAttribute("idltype").split(":")[1]); + assertEquals("m_message", message.getAttribute("name")); + } } Added: cxf/branches/2.7.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl?rev=1535489&view=auto ============================================================================== --- cxf/branches/2.7.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl (added) +++ cxf/branches/2.7.x-fixes/tools/corba/src/test/resources/idl/CXF5340.idl Thu Oct 24 18:36:14 2013 @@ -0,0 +1,26 @@ +module repro { + + const string NOT_CONN_LOCAL = "local"; + + // Exceptions of this type may be thrown by the following interfaces + exception msgError { + unsigned long m_number; // error number + string m_message; // error text + }; + + enum Reply { + positive // i.e. Ok or Yes + , negative // i.e. No or Cancel + , _dont_use_3 // don't use, align to hbMsg.h + , _dont_use_4 // don't use, align to hbMsg.h + , _dont_use_5 // don't use, align to hbMsg.h + , errTimeout // i.e. there was a timeout in a timed request + , errError // i.e. there was an error during the request + , cancelled // i.e. some person or some process cancelled the request + }; + + interface Service { + Reply getFirst( in Reply rep, out Reply reply ) raises (msgError); + }; + +};