cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1210875 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java tools/wadlto/jaxrs/src/test/resources/wadl/jaxbBindingWithSchemaLoc.xml tools/wadlto/jaxrs/src/test/resources/wadl/schemas/book.xsd
Date Tue, 06 Dec 2011 11:57:26 GMT
Author: sergeyb
Date: Tue Dec  6 11:57:25 2011
New Revision: 1210875

URL: http://svn.apache.org/viewvc?rev=1210875&view=rev
Log:
[CXF-3953] Checking for JAXB types with underscore characters

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
    cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/jaxbBindingWithSchemaLoc.xml
    cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/schemas/book.xsd

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java?rev=1210875&r1=1210874&r2=1210875&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/codegen/SourceGenerator.java
Tue Dec  6 11:57:25 2011
@@ -985,8 +985,11 @@ public class SourceGenerator {
                                       Set <String> typeClassNames) {
         String clsName = matchClassName(typeClassNames, packageName, localName);
         if (clsName == null && gInfo != null) {
-            clsName = matchClassName(typeClassNames, packageName, 
-                                   gInfo.getElementTypeMap().get(localName));
+            String elementTypeName = gInfo.getElementTypeMap().get(localName);
+            clsName = matchClassName(typeClassNames, packageName, elementTypeName);
+            if (clsName == null && elementTypeName != null && elementTypeName.contains("_"))
{
+                clsName = matchClassName(typeClassNames, packageName, elementTypeName.replaceAll("_",
""));
+            }
         }
         if (clsName == null && schemaTypesMap != null) {
             clsName = schemaTypesMap.get(packageName + "." + localName);

Modified: cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/jaxbBindingWithSchemaLoc.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/jaxbBindingWithSchemaLoc.xml?rev=1210875&r1=1210874&r2=1210875&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/jaxbBindingWithSchemaLoc.xml (original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/jaxbBindingWithSchemaLoc.xml Tue
Dec  6 11:57:25 2011
@@ -20,7 +20,7 @@
 	xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
 	schemaLocation="schemas/book.xsd"
-	node="//xs:complexType[@name='theBook2']/xs:sequence/xs:element[@name='id']">
+	node="//xs:complexType[@name='theBook_2']/xs:sequence/xs:element[@name='id']">
 	<jaxb:property name="book2Id"/>
 </jaxb:bindings>
 

Modified: cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/schemas/book.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/schemas/book.xsd?rev=1210875&r1=1210874&r2=1210875&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/schemas/book.xsd (original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/test/resources/wadl/schemas/book.xsd Tue Dec  6 11:57:25
2011
@@ -28,7 +28,7 @@
             <xs:element name="id" type="xs:int"/>
         </xs:sequence>
     </xs:complexType>
-    <xs:complexType name="theBook2">
+    <xs:complexType name="theBook_2">
         <xs:sequence>
             <xs:element name="id" type="xs:int"/>
             <xs:element minOccurs="0" name="name" type="xs:string"/>



Mime
View raw message