Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-960

ArrayIndexOutOfBoundsException error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.6.2
    • None
    • XML Schema API
    • 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])

      { return null; }

      ...

      Hope the information is helpful

      Attachments

        Activity

          People

            mrglavas@ca.ibm.com Michael Glavassevich
            ctteo Chin-Tat Teo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: