Author: mrglavas
Date: Mon Dec 13 20:32:08 2010
New Revision: 1045363

URL: http://svn.apache.org/viewvc?rev=1045363&view=rev
Log:
Simplifying isURIEqual() and changing the method name so that URI is 
capitalized.

Modified:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java
    
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/XSDTypeAlternativeValidator.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java?rev=1045363&r1=1045362&r2=1045363&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XSDTypeAlternativeValidator.java
 Mon Dec 13 20:32:08 2010
@@ -176,7 +176,7 @@ public class XSDTypeAlternativeValidator
                 XSAttributeUseImpl attrUseImpl = (XSAttributeUseImpl) 
attributeUses.get(attrUsesIndx);
                 XSAttributeDeclaration attrDecl = 
attrUseImpl.getAttrDeclaration();              
                 // the current element, has an inheritable attribute
-                if (attrName.equals(attrDecl.getName()) && 
XSTypeHelper.isUriEqual(attrUri, attrDecl.getNamespace()) &&    
+                if (attrName.equals(attrDecl.getName()) && 
XSTypeHelper.isURIEqual(attrUri, attrDecl.getNamespace()) &&    
                                                                                
        attrUseImpl.getInheritable()) {                   
                     InheritableAttribute inhrAttr = new 
InheritableAttribute(attributes.getLocalName(attrIndx),
                                                                              
attributes.getPrefix(attrIndx),
@@ -202,7 +202,7 @@ public class XSDTypeAlternativeValidator
       for (int attrIndx = 0; attrIndx < attributes.getLength(); attrIndx++) {
           String localName = attributes.getLocalName(attrIndx);
           String uri = attributes.getURI(attrIndx);          
-          if (localName.equals(inhAttr.getLocalName()) && 
XSTypeHelper.isUriEqual(uri, inhAttr.getUri())) {              
+          if (localName.equals(inhAttr.getLocalName()) && 
XSTypeHelper.isURIEqual(uri, inhAttr.getUri())) {              
              attrExists = true;
              break;
           }

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=1045363&r1=1045362&r2=1045363&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
 Mon Dec 13 20:32:08 2010
@@ -54,7 +54,7 @@ public class XSTypeHelper {
         }
         
         if (!typesIdentical) {                        
-            if (isUriEqual(typeDefn1.getNamespace(), 
typeDefn2.getNamespace())) {
+            if (isURIEqual(typeDefn1.getNamespace(), 
typeDefn2.getNamespace())) {
                 // if targetNamespace of types are same, then check for  
equality of type names and of the base type
                 if ((type1Name == null && type2Name == null) ||
                     (type1Name != null && type1Name.equals(type2Name))
@@ -68,26 +68,12 @@ public class XSTypeHelper {
         
     } // isSchemaTypesIdentical
     
-    
     /*
      * Check if two URI values are equal.
      */
-    public static boolean isUriEqual(String uri1, String uri2) {
-        
-        boolean uriEqual = false;
-        
-        if ((uri1 != null && uri2 == null) ||
-            (uri1 == null && uri2 != null)) {
-           uriEqual = false;
-        } else if ((uri1 == null && uri2 == null) ||
-                    uri1.equals(uri2)) {
-           uriEqual = true;   
-        } 
-        
-        return uriEqual;
-        
-    } // isUriEqual
-    
+    public static boolean isURIEqual(String uri1, String uri2) {
+        return (uri1 == uri2 || (uri1 != null && uri1.equals(uri2)));
+    } // isURIEqual   
     
     /*
      * Determine if an atomic value is valid with respect to any of the 
union's member types. 



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

Reply via email to