ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r586304 - /webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
Date Fri, 19 Oct 2007 08:04:43 GMT
Author: amilas
Date: Fri Oct 19 01:04:42 2007
New Revision: 586304

URL: http://svn.apache.org/viewvc?rev=586304&view=rev
Log:
fixed the issue AXIS2_3136

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?rev=586304&r1=586303&r2=586304&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
Fri Oct 19 01:04:42 2007
@@ -61,7 +61,7 @@
 
     private Templates templateCache;
 
-    private List namesList;
+    private Map packageNameToClassNamesMap;
 
     private static int count = 0;
 
@@ -311,7 +311,7 @@
             this.rootDir = rootDir;
         }
 
-        namesList = new ArrayList();
+        this.packageNameToClassNamesMap = new HashMap();
         javaBeanTemplateName = SchemaPropertyLoader.getBeanTemplate();
     }
 
@@ -330,7 +330,12 @@
         String packageName = getPackage(namespaceURI);
 
         String originalName = qName.getLocalPart();
-        String className = makeUniqueJavaClassName(this.namesList, originalName);
+
+        if (!this.packageNameToClassNamesMap.containsKey(packageName)){
+            this.packageNameToClassNamesMap.put(packageName, new ArrayList());
+        }
+        String className =
+                makeUniqueJavaClassName((List) this.packageNameToClassNamesMap.get(packageName),
originalName);
 
         String packagePrefix = null;
 
@@ -1138,7 +1143,11 @@
         }
 
         while (listOfNames.contains(javaName.toLowerCase())) {
-            javaName = javaName + count++;
+            if (!listOfNames.contains((javaName + "E").toLowerCase())){
+                javaName = javaName + "E";
+            } else {
+                javaName = javaName + count++;
+            }
         }
 
         listOfNames.add(javaName.toLowerCase());



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message