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:30:10 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes ca38df201 -> a42fd5718


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

Branch: refs/heads/2.7.x-fixes
Commit: a42fd5718d60d850021bbd486e16624808268f64
Parents: ca38df2
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:29:38 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/a42fd571/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 9f6eedf..28958a4 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/a42fd571/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 1d532f2..34e9ad4 100644
--- a/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
+++ b/tools/wadlto/jaxrs/src/test/resources/wadl/bookstore.xml
@@ -77,6 +77,7 @@ required="true">
      <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