Bug#6546113 StringCharBuffer fix

Roman Kennke roman.kennke at aicas.com
Fri Oct 12 13:24:47 UTC 2007


> >>> This fixes a problem with sliced StringCharBuffers. See:
> >>>
> >>> http://bugs.sun.com/view_bug.do?bug_id=6546113
> >>>
> >>> Feel free to integrate this in the repository.
> >>>       
> >
> > Ping, any opinions on this?
> >
> > /Roman
> >   
> I think Iris has been meaning to get back to you on this for a while 
> (she has been busy). It's a bug that she & I spoke about a few months 
> ago and she had planned to fix. All the better that you are now taking 
> time to address it. If you look at 4997655 you will see that slicing a 
> CharBuffer that wraps a char sequence has been problematic since day 
> one. The changes for that bug in jdk6 fixed some problems but also lead 
> to this problem. Unfortunately, the bug wasn't caught by existing tests 
> so one thing that would be good to do as part of 6546113 is to add or 
> improve the regression tests for char buffers that wrap a char sequence. 
> Are you interested in doing that as part of the fix to this bug?

Sure I can do that.

>  Anyway, 
> your changes look like a reasonable fix for the get methods. Did you 
> check the toString, subSequence, and duplicate methods in case they have 
> the same problem?

No, but I'll do that too. Good point.

>   One small concern is that the offset field was 
> originally the offset into the backing array for heap buffers. Now it is 
> used as the offset into the char sequence in the wrapped case. We should 
> probably comment that for the sake of future maintainers or else add a 
> new strOffset field to StringCharBuffer to make it easier to understand.

I'd reuse the existing field and comment on this.

I'll come back when I've looked at the above points. Thanks,

Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt

More information about the core-libs-dev mailing list