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:41:58 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 04bd70232 -> b611b6759


[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/b611b675
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b611b675
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b611b675

Branch: refs/heads/3.0.x-fixes
Commit: b611b67592fbd415422e2b774229621e4896e358
Parents: 04bd702
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:41:29 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/b611b675/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 e8a0060..65646a3 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
@@ -1191,7 +1191,7 @@ public class SourceGenerator {
             if (XSD_SPECIFIC_TYPE_MAP.containsKey(pair[1])) {
                 String expandedName = "{" + Constants.URI_2001_SCHEMA_XSD + "}" + pair[1];
                 if (schemaTypeMap.containsKey(expandedName)) {
-                    return schemaTypeMap.get(expandedName);
+                    return checkGenericType(schemaTypeMap.get(expandedName));
                 }
                 
                 String xsdType = XSD_SPECIFIC_TYPE_MAP.get(pair[1]);
@@ -1239,6 +1239,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;
     }
     
@@ -1296,7 +1309,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/b611b675/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