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/11 06:32:54 UTC
svn commit: r1057492 - in /cxf/branches/2.3.x-fixes: ./
tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java
tools/corba/src/test/resources/idl/String.idl
tools/corba/src/test/resources/idl/expected_String_unbounded.wsdl
Author: ffang
Date: Tue Jan 11 05:32:54 2011
New Revision: 1057492
URL: http://svn.apache.org/viewvc?rev=1057492&view=rev
Log:
Merged revisions 1057488 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1057488 | ffang | 2011-01-11 13:15:56 +0800 (二, 11 1 2011) | 1 line
[CXF-3238]idl2wsdl fails when constant is used to define string lenght
........
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/StringVisitor.java
cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/String.idl
cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_String_unbounded.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/StringVisitor.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/StringVisitor.java?rev=1057492&r1=1057491&r2=1057492&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java (original)
+++ cxf/branches/2.3.x-fixes/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StringVisitor.java Tue Jan 11 05:32:54 2011
@@ -79,7 +79,15 @@ public class StringVisitor extends Visit
stringNode = node;
boundNode = stringNode.getFirstChild();
-
+
+ //get chance to check if bound is symbol name which defined as const,
+ //if so, replace the symbol name with defined const
+ if (boundNode != null) {
+ String constValue = TypesUtils.getConstValueByName(boundNode, typeMap);
+ if (constValue != null) {
+ boundNode.setText(constValue);
+ }
+ }
if (identifierNode == null) {
stringScopedName = TypesUtils.generateAnonymousScopedName(getScope(), schema);
} else {
Modified: cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/String.idl
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/String.idl?rev=1057492&r1=1057491&r2=1057492&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/String.idl (original)
+++ cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/String.idl Tue Jan 11 05:32:54 2011
@@ -17,7 +17,8 @@
* under the License.
*/
-typedef string<10> string10;
+const long NAME_LENGTH = 10;
+typedef string<NAME_LENGTH> string10;
typedef wstring<20> wstring20;
typedef string10 myString10;
Modified: cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_String_unbounded.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_String_unbounded.wsdl?rev=1057492&r1=1057491&r2=1057492&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_String_unbounded.wsdl (original)
+++ cxf/branches/2.3.x-fixes/tools/corba/src/test/resources/idl/expected_String_unbounded.wsdl Tue Jan 11 05:32:54 2011
@@ -19,7 +19,8 @@
-->
<wsdl:definitions targetNamespace="http://cxf.apache.org/bindings/corba/idl/String" xmlns:tns="http://cxf.apache.org/bindings/corba/idl/String" xmlns:corba="http://cxf.apache.org/bindings/corba" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<corba:typeMapping targetNamespace="http://cxf.apache.org/bindings/corba/idl/String/typemap">
- <corba:alias xmlns:xs="http://www.w3.org/2001/XMLSchema" basetype="corba:string" repositoryID="IDL:string10:1.0" type="xs:string" name="string10" />
+ <corba:const xmlns:xs="http://www.w3.org/2001/XMLSchema" value="10" idltype="corba:long" name="NAME_LENGTH" type="xs:int"/>
+ <corba:alias xmlns:xs="http://www.w3.org/2001/XMLSchema" basetype="corba:string" repositoryID="IDL:string10:1.0" name="string10" type="xs:string"/>
<corba:alias xmlns:xs="http://www.w3.org/2001/XMLSchema" basetype="corba:wstring" repositoryID="IDL:wstring20:1.0" type="xs:string" name="wstring20" />
<corba:alias xmlns="http://cxf.apache.org/bindings/corba/idl/String/typemap" basetype="string10" repositoryID="IDL:myString10:1.0" name="myString10" />
<corba:alias xmlns="http://cxf.apache.org/bindings/corba/idl/String/typemap" basetype="wstring20" repositoryID="IDL:myWString20:1.0" name="myWString20" />