xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an...@apache.org
Subject cvs commit: xml-xerces/java/src/org/apache/xerces/validators/common XMLValidator.java
Date Tue, 20 Feb 2001 10:20:11 GMT
andyc       01/02/20 02:20:11

  Modified:    java/src/org/apache/xerces/validators/common
                        XMLValidator.java
  Log:
  Some slight fixes for identity constraints.
  
  Revision  Changes    Path
  1.120     +15 -3     xml-xerces/java/src/org/apache/xerces/validators/common/XMLValidator.java
  
  Index: XMLValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/common/XMLValidator.java,v
  retrieving revision 1.119
  retrieving revision 1.120
  diff -u -r1.119 -r1.120
  --- XMLValidator.java	2001/02/20 10:07:47	1.119
  +++ XMLValidator.java	2001/02/20 10:20:09	1.120
  @@ -121,7 +121,7 @@
   /**
    * This class is the super all-in-one validator used by the parser.
    *
  - * @version $Id: XMLValidator.java,v 1.119 2001/02/20 10:07:47 andyc Exp $
  + * @version $Id: XMLValidator.java,v 1.120 2001/02/20 10:20:09 andyc Exp $
    */
   public final class XMLValidator
       implements DefaultEntityHandler.EventHandler,
  @@ -4400,7 +4400,7 @@
                       //          then this code can be swapped out. -Ac
                       /***
                       if (validator.compare(value1, value2) != 0) {
  -                        return false;
  +                        continue LOOP;
                       }
                       /***/
                       if (!value1.equals(value2)) {
  @@ -4826,7 +4826,19 @@
           /** Returns the index of the entry with the specified key. */
           public int indexOf(Field key) {
               for (int i = 0; i < fSize; i++) {
  -                if (fEntries[i].key.equals(key)) {
  +                // NOTE: Only way to be sure that the keys are the
  +                //       same is by using a reference comparison. In
  +                //       order to rely on the equals method, each 
  +                //       field would have to take into account its
  +                //       position in the identity constraint, the
  +                //       identity constraint, the declaring element,
  +                //       and the grammar that it is defined in. 
  +                //       Otherwise, you have the possibility that 
  +                //       the equals method would return true for two
  +                //       fields that look *very* similar.
  +                //       The reference compare isn't bad, actually,
  +                //       because the field objects are cacheable. -Ac
  +                if (fEntries[i].key == key) {
                       return i;
                   }
               }
  
  
  

Mime
View raw message