cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1388013 - in /cxf/branches/2.6.x-fixes: ./ tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Date Thu, 20 Sep 2012 13:05:12 GMT
Author: sergeyb
Date: Thu Sep 20 13:05:12 2012
New Revision: 1388013

URL: http://svn.apache.org/viewvc?rev=1388013&view=rev
Log:
Merged revisions 1384259,1388010 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1384259 | sergeyb | 2012-09-13 10:58:15 +0100 (Thu, 13 Sep 2012) | 1 line
  
  Check for encoded '=' characters, may be needed when rep map has media types with parameters
........
  r1388010 | sergeyb | 2012-09-20 14:01:40 +0100 (Thu, 20 Sep 2012) | 1 line
  
  Minor update to the wadl generator to avoid adding full class names for custom media type
class names
........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
    cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1384259,1388010

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java?rev=1388013&r1=1388012&r2=1388013&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/JAXRSContainer.java
Thu Sep 20 13:05:12 2012
@@ -246,6 +246,9 @@ public class JAXRSContainer extends Abst
             int pos = typeToClasses[i].indexOf("=");
             if (pos != -1) {
                 String type = typeToClasses[i].substring(0, pos);
+                if (type.contains("%3D")) {
+                    type = type.replace("%3D", "=");
+                }
                 String clsName = typeToClasses[i].substring(pos + 1);
                 typeMap.put(type, clsName);
             }

Modified: cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java?rev=1388013&r1=1388012&r2=1388013&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxrs/SourceGenerator.java
Thu Sep 20 13:05:12 2012
@@ -1096,23 +1096,28 @@ public class SourceGenerator {
                 String clsName = getSchemaClassName(packageName, gInfo, actualValue, 
                                                     info.getTypeClassNames());
                 
-                if (clsName == null) {
+                if (clsName != null) {
                     clsName = schemaTypeMap.get("{" + namespace + "}" + actualValue);
                 }
                 if (clsName != null) {
-                    addImport(imports, clsName);
-                    int index = clsName.lastIndexOf(".");
-                    
-                    if (index != -1) {
-                        clsName = clsName.substring(index + 1);
-                    } 
-                    return clsName;      
+                    return addImportsAndGetSimpleName(imports, clsName);
                 }
+                
             }
         }
         return defaultValue;
     }
     
+    private String addImportsAndGetSimpleName(Set<String> imports, String clsName)
{
+        addImport(imports, clsName);
+        int index = clsName.lastIndexOf(".");
+        
+        if (index != -1) {
+            clsName = clsName.substring(index + 1);
+        }
+        return clsName;
+    }
+    
     private String getElementRefName(Element repElement,
                                      ContextInfo info, 
                                      Set<String> imports) {
@@ -1130,7 +1135,7 @@ public class SourceGenerator {
             // try mediaTypesMap first
             String mediaType = repElement.getAttribute("mediaType");
             if (!StringUtils.isEmpty(mediaType) && mediaTypesMap.containsKey(mediaType))
{
-                return mediaTypesMap.get(mediaType);
+                return addImportsAndGetSimpleName(imports, mediaTypesMap.get(mediaType));
             }
             
             Element param = DOMUtils.getFirstChildWithName(repElement, getWadlNamespace(),
"param");



Mime
View raw message