sandygao 2004/04/12 13:15:36 Modified: java/src/org/apache/xerces/impl/xs XSModelGroupImpl.java Log: Fixing bug [28304]: we should check whether the number of particles before trying to access the array. Revision Changes Path 1.7 +15 -15 xml-xerces/java/src/org/apache/xerces/impl/xs/XSModelGroupImpl.java Index: XSModelGroupImpl.java =================================================================== RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSModelGroupImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- XSModelGroupImpl.java 24 Feb 2004 22:59:12 -0000 1.6 +++ XSModelGroupImpl.java 12 Apr 2004 20:15:35 -0000 1.7 @@ -1,12 +1,12 @@ /* * Copyright 2002,2003-2004 The Apache Software Foundation. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -38,7 +38,7 @@ // compositor of the model group public short fCompositor; - + // particles public XSParticleDecl[] fParticles = null; public int fParticleCount = 0; @@ -80,9 +80,9 @@ // return the min of all min values of the particles private int minEffectiveTotalRangeChoice() { int min = 0, one; - if (fParticles.length > 0) + if (fParticleCount > 0) min = fParticles[0].minEffectiveTotalRange(); - + for (int i = 1; i < fParticleCount; i++) { one = fParticles[i].minEffectiveTotalRange(); if (one < min) @@ -116,7 +116,7 @@ // otherwise return the max of all max values private int maxEffectiveTotalRangeChoice() { int max = 0, one; - if (fParticles.length > 0) { + if (fParticleCount > 0) { max = fParticles[0].minEffectiveTotalRange(); if (max == SchemaSymbols.OCCURRENCE_UNBOUNDED) return SchemaSymbols.OCCURRENCE_UNBOUNDED; @@ -165,7 +165,7 @@ fDescription = null; fAnnotation = null; } - + /** * Get the type of the object, i.e ELEMENT_DECLARATION. */ @@ -217,11 +217,11 @@ return fAnnotation; } - /** - * @see org.apache.xerces.xs.XSObject#getNamespaceItem() - */ - public XSNamespaceItem getNamespaceItem() { - return null; - } + /** + * @see org.apache.xerces.xs.XSObject#getNamespaceItem() + */ + public XSNamespaceItem getNamespaceItem() { + return null; + } } // class XSModelGroupImpl
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]