cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5929] Using a double dot convention to pass the parameterized types
Date Tue, 05 Aug 2014 09:43:24 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 671b9740b -> 7ef383656


[CXF-5929] Using a double dot convention to pass the parameterized types


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7ef38365
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7ef38365
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7ef38365

Branch: refs/heads/2.7.x-fixes
Commit: 7ef3836565a4c2f915679d4ad379ad13e0ae5109
Parents: 671b974
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Aug 5 12:39:44 2014 +0300
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Aug 5 12:43:01 2014 +0300

----------------------------------------------------------------------
 .../cxf/tools/wadlto/jaxrs/SourceGenerator.java    | 17 +++++++++++++++--
 .../cxf/tools/wadlto/jaxrs/WADLToJavaTest.java     |  2 ++
 2 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7ef38365/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
----------------------------------------------------------------------
diff --git a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
index bf4c372..78c7862 100644
--- a/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
+++ b/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
@@ -1183,7 +1183,7 @@ public class SourceGenerator {
             if (XSD_SPECIFIC_TYPE_MAP.containsKey(pair[1])) {
                 String expandedName = "{" + XmlSchemaConstants.XSD_NAMESPACE_URI + "}" +
pair[1];
                 if (schemaTypeMap.containsKey(expandedName)) {
-                    return schemaTypeMap.get(expandedName);
+                    return checkGenericType(schemaTypeMap.get(expandedName));
                 }
                 
                 String xsdType = XSD_SPECIFIC_TYPE_MAP.get(pair[1]);
@@ -1231,6 +1231,19 @@ public class SourceGenerator {
         if (index != -1) {
             clsName = clsName.substring(index + 1);
         }
+        return checkGenericType(clsName);
+    }
+    
+    private String checkGenericType(String clsName) {
+        if (clsName != null) {
+            int typeIndex = clsName.lastIndexOf("..");
+            if (typeIndex != -1) {
+                clsName = clsName.substring(0, typeIndex) 
+                    + "<"
+                    + clsName.substring(typeIndex + 2)
+                    + ">";
+            }
+        }
         return clsName;
     }
     
@@ -1288,7 +1301,7 @@ public class SourceGenerator {
             }
         }
         if (clsName == null && javaTypeMap != null) {
-            clsName = javaTypeMap.get(packageName + "." + localName);
+            clsName = checkGenericType(javaTypeMap.get(packageName + "." + localName));
         }
         return clsName;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/7ef38365/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
----------------------------------------------------------------------
diff --git a/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
b/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
index 6f76dca..deeab25 100644
--- a/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
+++ b/tools/wadlto/jaxrs/src/test/java/org/apache/cxf/tools/wadlto/jaxrs/WADLToJavaTest.java
@@ -43,6 +43,8 @@ public class WADLToJavaTest extends ProcessorTestBase {
                 output.getCanonicalPath(),
                 "-p",
                 "custom.service",
+                "-tMap",
+                "{http://www.w3.org/2001/XMLSchema}date=java.util.List..String",
                 "-async getName,delete",
                 "-compile",
                 getLocation("/wadl/bookstore.xml"),


Mime
View raw message