Bug 7543 - ArrayOutOfBounds exception in StreamingCharReader
Summary: ArrayOutOfBounds exception in StreamingCharReader
Status: NEW
Alias: None
Product: Xerces-J
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.2.3
Hardware: Sun Solaris
: P3 major
Target Milestone: ---
Assignee: Xerces-J Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-27 21:26 UTC by Jim Greuel
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Greuel 2002-03-27 21:26:39 UTC
I'm seeing an ArrayOutOfBounds exception in StreamingCharReader:

java.lang.ArrayIndexOutOfBoundsException
        at org.apache.xerces.readers.StreamingCharReader.loadMoreChars
(StreamingCharReader.java:1332)
        at org.apache.xerces.readers.StreamingCharReader.loadNextChar
(StreamingCharReader.java:1260)
        at org.apache.xerces.readers.StreamingCharReader.scanQName
(StreamingCharReader.java:725)
        at org.apache.xerces.framework.XMLDocumentScanner.scanElementType
(XMLDocumentScanner.java:2075)
        at org.apache.xerces.framework.XMLDocumentScanner.access$100
(XMLDocumentScanner.java:86)
        at 
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch
(XMLDocumentScanner.java:1220)
        at org.apache.xerces.framework.XMLDocumentScanner.parseSome
(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948)


It appears that StreamingCharReader assumes that any chunk it gets from 
CharDataChunk.createChunk() will either not yet be allocated or will be a chunk 
that is CharDataChunk.CHUNK_SIZE in length (see slowLoadNextChar() and 
loadNextChar()).  This however is not the case.  In particular, we are using 
Xalan 1.2 for XSLT processing, and it appears that the XSLT processing 
allocates chunks (using CharDataChunk.setCharArray()) of variable sizes.  The 
exception occurs after StreamingCharReader uses up its first chunk, requests 
another, and gets a previously used chunk of 123 characters.