cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r797582 - in /cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java
Date Fri, 24 Jul 2009 17:59:20 GMT
Author: dkulp
Date: Fri Jul 24 17:59:19 2009
New Revision: 797582

URL: http://svn.apache.org/viewvc?rev=797582&view=rev
Log:
[CXF-2358] make the autoNameResolution handle cases where class names
differ only by case.

Modified:
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java
    cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java?rev=797582&r1=797581&r2=797582&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ClassCollector.java Fri
Jul 24 17:59:19 2009
@@ -82,6 +82,19 @@
         return typesClassNames.get(key(packagename, type));
     }
 
+    public boolean containsTypeIgnoreCase(String packagename, String type) {
+        String key = key(packagename, type);
+        if (typesClassNames.containsKey(key)) {
+            //try the common fast case first
+            return true;
+        }
+        for (String s : typesClassNames.keySet()) {
+            if (key.equalsIgnoreCase(s)) {
+                return true;
+            }
+        }
+        return false;
+    }
     private String key(String packagename, String type) {
         return packagename + "#" + type;
     }

Modified: cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java?rev=797582&r1=797581&r2=797582&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java
(original)
+++ cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/ClassNameAllocatorImpl.java
Fri Jul 24 17:59:19 2009
@@ -20,7 +20,6 @@
 package org.apache.cxf.tools.wsdlto.databinding.jaxb;
 
 import com.sun.tools.xjc.api.ClassNameAllocator;
-import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.tools.util.ClassCollector;
 
 public class ClassNameAllocatorImpl implements ClassNameAllocator {
@@ -46,12 +45,9 @@
         String fullPckClass = packageName + "." + fullClzName;
         
         if (autoResolveConflicts) {
-            String t2 = collector.getTypesFullClassName(packageName, className);
             int cnt = 1;
-            while (!StringUtils.isEmpty(t2)) {
-                
+            while (collector.containsTypeIgnoreCase(packageName, className + (cnt == 1 ?
"" : cnt))) {
                 cnt++;
-                t2 = collector.getTypesFullClassName(packageName, className + cnt);
             }
             if (cnt != 1) {
                 className = className + cnt;



Mime
View raw message