Author: mukulg
Date: Wed Jun 30 15:30:33 2010
New Revision: 959350

URL: http://svn.apache.org/viewvc?rev=959350&view=rev
Log:
some improvements to type comparison logic. encountered an infinite loop in a 
particular scenario.

Modified:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSTypeHelper.java

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSTypeHelper.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSTypeHelper.java?rev=959350&r1=959349&r2=959350&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSTypeHelper.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/util/XSTypeHelper.java
 Wed Jun 30 15:30:33 2010
@@ -34,21 +34,28 @@ public class XSTypeHelper {
                                                XSTypeDefinition typeDefn2) {
         boolean typesIdentical = false;
         
-        String type1Ns = typeDefn1.getNamespace();
-        String type1Name = typeDefn1.getName();        
-        boolean nsEqual = false;           
-        if ((type1Ns != null && type1Ns.equals(typeDefn2.getNamespace())) ||
-                  (type1Ns == null && typeDefn2.getNamespace() == null)) {
-           nsEqual = true;   
+        if ("anyType".equals(typeDefn1.getName()) && 
+            "anyType".equals(typeDefn2.getName())) {
+            typesIdentical = true;  
         }
         
-        if (nsEqual == true) {
-           if ((type1Name == null && typeDefn2.getName() == null) ||
-               (type1Name != null && type1Name.equals(typeDefn2.getName()))
-               && (schemaTypesIdentical(typeDefn1.getBaseType(),
-                                        typeDefn2.getBaseType()))) {
-               typesIdentical = true;   
-           }
+        if (!typesIdentical) {
+            String type1Ns = typeDefn1.getNamespace();
+            String type1Name = typeDefn1.getName();        
+            boolean nsEqual = false;           
+            if ((type1Ns != null && type1Ns.equals(typeDefn2.getNamespace())) 
||
+                    (type1Ns == null && typeDefn2.getNamespace() == null)) {
+                nsEqual = true;   
+            }
+
+            if (nsEqual == true) {
+                if ((type1Name == null && typeDefn2.getName() == null) ||
+                        (type1Name != null && 
type1Name.equals(typeDefn2.getName()))
+                        && (schemaTypesIdentical(typeDefn1.getBaseType(),
+                                typeDefn2.getBaseType()))) {
+                    typesIdentical = true;   
+                }
+            }
         }
         
         return typesIdentical;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to