You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2004/05/20 05:39:45 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs XSModelImpl.java

mrglavas    2004/05/19 20:39:45

  Modified:    java/src/org/apache/xerces/impl/xs XSModelImpl.java
  Log:
  Fixing Jira Bug #968:
  http://nagoya.apache.org/jira/browse/XERCESJ-968
  
  If no annotations exist for a SchemaGrammar the array
  of annotations is never created. For such schema docs
  we were passing null to System.arrayCopy which caused
  a NullPointerException to be thrown. This is now fixed.
  
  Revision  Changes    Path
  1.15      +5 -19     xml-xerces/java/src/org/apache/xerces/impl/xs/XSModelImpl.java
  
  Index: XSModelImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSModelImpl.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XSModelImpl.java	15 May 2004 22:13:12 -0000	1.14
  +++ XSModelImpl.java	20 May 2004 03:39:45 -0000	1.15
  @@ -39,22 +39,6 @@
   import org.apache.xerces.util.XMLSymbols;
   
   /**
  - * @author elitani
  - *
  - * To change this generated comment edit the template variable "typecomment":
  - * Window>Preferences>Java>Templates.
  - * To enable and disable the creation of type comments go to
  - * Window>Preferences>Java>Code Generation.
  - */
  -/**
  - * @author elitani
  - *
  - * To change this generated comment edit the template variable "typecomment":
  - * Window>Preferences>Java>Templates.
  - * To enable and disable the creation of type comments go to
  - * Window>Preferences>Java>Code Generation.
  - */
  -/**
    * Implements XSModel:  a read-only interface that represents an XML Schema,
    * which could be components from different namespaces.
    *
  @@ -451,8 +435,10 @@
           int currPos = 0;
           for (int i = 0; i < fGrammarCount; i++) {
               SchemaGrammar currGrammar = fGrammarList[i];
  -            System.arraycopy(currGrammar.fAnnotations, 0, annotations, currPos, currGrammar.fNumAnnotations);
  -            currPos += currGrammar.fNumAnnotations;
  +            if (currGrammar.fNumAnnotations > 0) {
  +                System.arraycopy(currGrammar.fAnnotations, 0, annotations, currPos, currGrammar.fNumAnnotations);
  +                currPos += currGrammar.fNumAnnotations;
  +            }
           }
           fAnnotations = new XSObjectListImpl(annotations, annotations.length);
           return fAnnotations;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org