You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2011/01/12 09:10:09 UTC
svn commit: r1058015 - in /cxf/branches/2.3.x-fixes: ./
tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ConstVisitor.java
tools/corba/src/test/resources/idl/Const.idl
tools/corba/src/test/resources/idl/expected_Const.wsdl
Author: ffang
Date: Wed Jan 12 08:10:08 2011
New Revision: 1058015
URL: http://svn.apache.org/viewvc?rev=1058015&view=rev
Log:
Merged revisions 1058014 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1058014 | ffang | 2011-01-12 15:59:28 +0800 (δΈ‰, 12 1 2011) | 1 line
[CXF-3239]idl2wsdl fails if invisible const char is defined in IDL
........
Modified:
cxf/branches/2.3.x-fixes/ (props changed)
cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ConstVisitor.java
cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/Const.idl
cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_Const.wsdl
Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ConstVisitor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ConstVisitor.java?rev=1058015&r1=1058014&r2=1058015&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ConstVisitor.java (original)
+++ cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ConstVisitor.java Wed Jan 12 08:10:08 2011
@@ -62,10 +62,17 @@ public class ConstVisitor extends Visito
AST constTypeNode = constNode.getFirstChild();
AST constNameNode = TypesUtils.getCorbaTypeNameNode(constTypeNode);
AST constValueNode = constNameNode.getNextSibling();
-
// build value string
String constValue = constValueNode.toString();
constValueNode = constValueNode.getFirstChild();
+ if (constValue != null && constValue.length() == 1) {
+ // might be a control char
+ byte ch = (byte)constValue.charAt(0);
+ if (ch >= 0 && ch <= 31) {
+ // ascii code between 0 and 31 is invisible control code
+ constValue = "\\" + Integer.toOctalString(ch);
+ }
+ }
while (constValueNode != null) {
constValue = constValue + constValueNode.toString();
constValueNode = constValueNode.getFirstChild();
@@ -100,4 +107,5 @@ public class ConstVisitor extends Visito
typeMap.getStructOrExceptionOrUnion().add(corbaConst);
}
+
}
Modified: cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/Const.idl
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/Const.idl?rev=1058015&r1=1058014&r2=1058015&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/Const.idl (original)
+++ cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/Const.idl Wed Jan 12 08:10:08 2011
@@ -32,6 +32,7 @@ const unsigned long glob_unsignedlo
const unsigned long long glob_unsignedlonglong = 123456789;
const char glob_char = 'r';
+const char glob_char2 = '\2';
const wchar glob_wchar = L'x';
const boolean glob_boolean = FALSE;
Modified: cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_Const.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_Const.wsdl?rev=1058015&r1=1058014&r2=1058015&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_Const.wsdl (original)
+++ cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_Const.wsdl Wed Jan 12 08:10:08 2011
@@ -29,6 +29,7 @@
<corba:const xmlns:xs="http://www.w3.org/2001/XMLSchema" value="4556" idltype="corba:ulong" type="xs:unsignedInt" name="glob_unsignedlong" />
<corba:const xmlns:xs="http://www.w3.org/2001/XMLSchema" value="123456789" idltype="corba:ulonglong" type="xs:unsignedLong" name="glob_unsignedlonglong" />
<corba:const xmlns:xs="http://www.w3.org/2001/XMLSchema" value="r" idltype="corba:char" type="xs:byte" name="glob_char" />
+ <corba:const xmlns:xs="http://www.w3.org/2001/XMLSchema" value="\2" idltype="corba:char" type="xs:byte" name="glob_char2" />
<corba:const xmlns:xs="http://www.w3.org/2001/XMLSchema" value="x" idltype="corba:wchar" type="xs:string" name="glob_wchar" />
<corba:const xmlns:xs="http://www.w3.org/2001/XMLSchema" value="FALSE" idltype="corba:boolean" type="xs:boolean" name="glob_boolean" />
<corba:const xmlns:xs="http://www.w3.org/2001/XMLSchema" value="-67.9" idltype="corba:float" type="xs:float" name="glob_float" />