Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.6.2
-
None
-
None
Description
I have this exception
java.lang.ArrayIndexOutOfBoundsException: 15
at org.apache.xerces.impl.xs.SchemaGrammar.getComponents(Unknown Source)
at xs.QueryXS.traverse(QueryXS.java:323)
at xs.QueryXS.main(QueryXS.java:127)
What I am doing is as follows:
XSNamespaceItemList nsItemList = model.getNamespaceItems();
if (nsItemList != null)
XSNamespaceItem nsItem = nsItemList.item(0);
XSNamedMap nmap = nsItem.getComponents((short)
XSTypeDefinition.COMPLEX_TYPE);
-------
After examining the xerces source files, I notice the error occurs at
line 811 of org.apache.xerces.impl.xs.SchemaGrammar. It tries to check for GLOBAL_COMP with an index larger than the declared array.
public synchronized XSNamedMap getComponents(short objectType) {
if (objectType <= 0 || objectType > MAX_COMP_IDX ||
!GLOBAL_COMP[objectType])
...
Hope the information is helpful