cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5608] Simple class names for parameter types derived from some of xsd types
Date Wed, 12 Mar 2014 16:07:12 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 8d5c44636 -> 1ffad3dd6


[CXF-5608] Simple class names for parameter types derived from some of xsd types


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

Branch: refs/heads/master
Commit: 1ffad3dd631ffb2594f81655d6faedf5adf6e9b6
Parents: 8d5c446
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Mar 12 16:06:52 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Mar 12 16:06:52 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java | 5 +++--
 tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml        | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1ffad3dd/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 26874b4..57a6ec1 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
@@ -624,7 +624,7 @@ public class SourceGenerator {
     }
     
     private void addImport(Set<String> imports, String clsName) {
-        if (imports == null || clsName.startsWith("java.lang")) {
+        if (imports == null || clsName.startsWith("java.lang") || !clsName.contains("."))
{
             return;
         }
         if (!imports.contains(clsName)) {
@@ -1136,7 +1136,8 @@ public class SourceGenerator {
                     return schemaTypeMap.get(expandedName);
                 }
                 
-                return XSD_SPECIFIC_TYPE_MAP.get(pair[1]);
+                String xsdType = XSD_SPECIFIC_TYPE_MAP.get(pair[1]);
+                return addImportsAndGetSimpleName(imports, xsdType);
             }
             
             String value = pair[1].replaceAll("[\\-\\_]", "");

http://git-wip-us.apache.org/repos/asf/cxf/blob/1ffad3dd/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
----------------------------------------------------------------------
diff --git a/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml b/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
index fdce68d..eb5d938 100644
--- a/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
+++ b/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
@@ -70,6 +70,7 @@
                         <option value="A"/>
                         <option value="B"/>
                     </param>
+                    <param name="If-Modified-Since" style="header" type="xsd:date"/>
                 </request>
                 <response>
                     <representation mediaType="text/plain">


Mime
View raw message