[jbossws-commits] JBossWS SVN: r12112 - stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Apr 23 10:16:08 EDT 2010


Author: richard.opalka at jboss.com
Date: 2010-04-23 10:16:08 -0400 (Fri, 23 Apr 2010)
New Revision: 12112

Modified:
   stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
Log:
[JBPAPP-3201] fixing wrong compareTo method preconditions

Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java	2010-04-23 13:10:33 UTC (rev 12111)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java	2010-04-23 14:16:08 UTC (rev 12112)
@@ -117,10 +117,14 @@
          JBossXSParticle w = (JBossXSParticle)o;
          String oname = w.getTerm().getName();
          String termName = term.getName();
-         if (termName != null)
+         if (termName != null && oname != null)
             c = termName.compareTo(oname);
+         else if (termName == null)
+        	c = -1;
+         else 
+        	c = 1;
          //In the case of doclit, need to be careful about String_1,SimpleType_2
-         if (termName != null)
+         if (termName != null && oname != null)
          {
             char num1 = termName.charAt(termName.length() - 1);
             char num2 = oname.charAt(oname.length() - 1);



More information about the jbossws-commits mailing list