Stuart,
you are right, I didn't know where in the replace() method did you put
your log, but this can definitely happen, so I'll check in a fix.

Thanks,
Radu

On Wed, 2006-10-11 at 16:57 -0700, Stuart Siegrist wrote:
> replace(): dCch = 4, i = 16348, _buf.length = 16384, _in = 16380, _out
> = 8192, dCch = 4, _free = 8196, replacement = & 
> 
> int availableEndChunk = _buf.length - _in;
> if ( dCch <= availableEndChunk )
> {
>     System.arraycopy( _buf, i, _buf, i + dCch, _in - i );
>     _in += dCch;
> }
> 
> I believe this is the code in question and it still exists in the
> latest source.  Using the output from above plugged into this code you
> will see that _in += dCch sets the index to 16384 which is outside the
> bounds of the _buf.  Maybe changing the code to: 
> 
> int availableEndChunk = _buf.length - _in;
> if ( dCch <= availableEndChunk )
> {
>     System.arraycopy( _buf, i, _buf, i + dCch, _in - i );
>     _in = (_in + dCch) % _buf.length;
> }
> 
> Does this address the problem correctly?  Also, I noticed XMLBEANS-87
> was for version 1.0.3 so I opened another bug XMLBEANS-291 for version
> 2.2.0. 
> 
> 
> On 10/11/06, Radu Preotiuc-Pietro (JIRA) <[EMAIL PROTECTED]>
> wrote: 
>             [ 
> http://issues.apache.org/jira/browse/XMLBEANS-87?page=comments#action_12441567
>  ]
>         
>         Radu Preotiuc-Pietro commented on XMLBEANS-87:
>         ----------------------------------------------
>         
>         I believe this was fixed at the same time as XMLBEANS-209. 
>         I could verify the fix if I had a repro (if you feel
>         uncomfortable posting your files publicly, one option would be
>         to send them directly to me). Alternatively, if you are
>         willing to build directly from SVN, then you could check the
>         fix. (the fix post-2.2.0)
>         
>         
>         > java.lang.ArrayIndexOutOfBoundsException
>         > ----------------------------------------
>         >
>         >                 Key: XMLBEANS-87
>         >                 URL:
>         http://issues.apache.org/jira/browse/XMLBEANS-87
>         >             Project: XMLBeans
>         >          Issue Type: Bug
>         >    Affects Versions: Version 1.0.3
>         >         Environment: JBoss, Linux, Jdk 1.4.2_05 
>         >            Reporter: Abtin Afshar
>         >
>         > java.lang.ArrayIndexOutOfBoundsException: 16384
>         >         at org.apache.xmlbeans.impl.store.Saver
>         $TextSaver.emit(Saver.java:1785)
>         >         at org.apache.xmlbeans.impl.store.Saver
>         $TextSaver.emitAttrHelper (Saver.java:1419)
>         >         at org.apache.xmlbeans.impl.store.Saver
>         $TextSaver.emitContainerHelper(Saver.java:1449)
>         >         at org.apache.xmlbeans.impl.store.Saver
>         $TextSaver.emitContainer(Saver.java:1352)
>         >         at
>         org.apache.xmlbeans.impl.store.Saver.processContainer(Saver.java:775)
>         >         at
>         org.apache.xmlbeans.impl.store.Saver.process(Saver.java:518)
>         >         at org.apache.xmlbeans.impl.store.Saver
>         $TextSaver.ensure (Saver.java:1658)
>         >         at org.apache.xmlbeans.impl.store.Saver
>         $TextSaver.read(Saver.java:2148)
>         >         at org.apache.xmlbeans.impl.store.Saver
>         $TextReader.read(Saver.java:2271)
>         >         at org.apache.xmlbeans.impl.store.Cursor.save
>         (Cursor.java:3118)
>         >         at
>         
> org.apache.xmlbeans.impl.values.XmlObjectBase.save(XmlObjectBase.java:166)
>         
>         --
>         This message is automatically generated by JIRA.
>         -
>         If you think it was sent incorrectly contact one of the
>         administrators:
>         http://issues.apache.org/jira/secure/Administrators.jspa
>         -
>         For more information on JIRA, see:
>         http://www.atlassian.com/software/jira
>         
>         
> 
_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to