Author: richard.opalka(a)jboss.com
Date: 2010-04-23 10:22:28 -0400 (Fri, 23 Apr 2010)
New Revision: 12113
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
Log:
[JBPAPP-3201] fixing wrong compareTo method preconditions
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java 2010-04-23
14:16:08 UTC (rev 12112)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java 2010-04-23
14:22:28 UTC (rev 12113)
@@ -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);
Show replies by date