sjsxp
  1. sjsxp
  2. SJSXP-6

IndexOutOfBoundException while parsing DTD with SJSXP(JWSDP 2.0)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      6

      Description

      When parsing the VoiceXML DTD (www.w3.org/TR/voicexml21/vxml.dtd) an
      IndexOutOfBoundException occurs, when parsing the second line of:
      ------------
      <!ENTITY % submit.attrs "method (get|post) 'get'
      enctype %content.type; 'application/x-www-form-urlencoded'
      namelist %variable.names; #IMPLIED">
      ------------
      -------------
      Exception in thread "Thread-3" java.lang.IndexOutOfBoundsException: Index: 0,
      Size: 0
      at java.util.ArrayList.RangeCheck(ArrayList.java:547)
      at java.util.ArrayList.get(ArrayList.java:322)
      at com.sun.xml.stream.XMLScanner.getStringBuffer(XMLScanner.java:1425)
      at com.sun.xml.stream.XMLScanner.scanAttributeValue(XMLScanner.java:805)
      at
      com.sun.xml.stream.XMLDTDScannerImpl.scanAttDefaultDecl(XMLDTDScannerImpl.java:1428)
      at
      com.sun.xml.stream.XMLDTDScannerImpl.scanAttlistDecl(XMLDTDScannerImpl.java:1219)
      at com.sun.xml.stream.XMLDTDScannerImpl.scanDecls(XMLDTDScannerImpl.java:1976)
      at
      com.sun.xml.stream.XMLDTDScannerImpl.scanDTDExternalSubset(XMLDTDScannerImpl.java:335)
      at
      com.sun.xml.stream.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1090)
      at
      com.sun.xml.stream.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:998)
      at
      com.sun.xml.stream.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:930)
      at
      com.sun.xml.stream.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:330)
      at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:542)
      at
      com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:107)
      at
      com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:332)
      at
      com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:304)
      ....
      -------------

      The bug seems to be caused by an error in XMLScanner.getStringBuffer(), and can
      be fixed by replacing getStringBuffer():
      -----------------------------------
      XMLStringBuffer getStringBuffer() {
      if(fStringBufferIndex < initialCacheCount || fStringBufferIndex <
      stringBufferCache.size())

      { return (XMLStringBuffer)stringBufferCache.get(fStringBufferIndex++); } else { XMLStringBuffer tmpObj = new XMLStringBuffer(); stringBufferCache.add(fStringBufferIndex, tmpObj); return tmpObj; }
      }
      -----------------------------------
      with:
      ---------------------------
      XMLStringBuffer getStringBuffer() {
      if(fStringBufferIndex < initialCacheCount && fStringBufferIndex <
      stringBufferCache.size()-1) { return (XMLStringBuffer)stringBufferCache.get(fStringBufferIndex++); }

      else

      { XMLStringBuffer tmpObj = new XMLStringBuffer(); stringBufferCache.add(fStringBufferIndex, tmpObj); return tmpObj; }

      }
      ---------------------------

      Regards,
      Kamen Petroff

        Activity

        Hide
        ndw added a comment -

        I'll take a look.

        Show
        ndw added a comment - I'll take a look.
        Hide
        Santiago Pericas-Geertsen added a comment -

        Lowering the priority of this bug. We should have a fix for it shortly, but it doesn't affect enough tests to
        be considered a P1.

        Show
        Santiago Pericas-Geertsen added a comment - Lowering the priority of this bug. We should have a fix for it shortly, but it doesn't affect enough tests to be considered a P1.
        Hide
        Santiago Pericas-Geertsen added a comment -

        I believe this issue has been fixed by a earlier patch. I've tried a simple example and it worked fine. Please
        try it with the latest build and attach a test case if the error still persists.

        Show
        Santiago Pericas-Geertsen added a comment - I believe this issue has been fixed by a earlier patch. I've tried a simple example and it worked fine. Please try it with the latest build and attach a test case if the error still persists.

          People

          • Assignee:
            ndw
            Reporter:
            petroff
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: