Code review request 7190219 CharBuffer position changed after BufferOverflowException in put() (original) (raw)
Jonathan Lu luchsh at linux.vnet.ibm.com
Thu Aug 9 12:16:43 UTC 2012
- Previous message: hg: jdk8/tl/jdk: 7183753: [TEST] Some colon in the diff for this test
- Next message: Code review request 7190219 CharBuffer position changed after BufferOverflowException in put()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi folks,
Here's a patch for bug 7190219, could you please help to have a look? http://cr.openjdk.java.net/~luchsh/7190219/
According to the specification, in the method java.nio.CharBuffer.put(String src, int start, int end). If there are more chars to be copied from the string than remain in this buffer, that is, if end - start > remaining(), then no chars are transferred and a|BufferOverflowException||| <cid:part1.03040006.09080809 at linux.vnet.ibm.com> is thrown.
But actually the test case from that webrev proves that the buffer was modified even after BufferOverflowException, so I suggest to add additional check after checkBounds() call, in the same way as java.nio.CharBuffer.put(char[] src, int offset, int length).
Thanks Jonathan
- Previous message: hg: jdk8/tl/jdk: 7183753: [TEST] Some colon in the diff for this test
- Next message: Code review request 7190219 CharBuffer position changed after BufferOverflowException in put()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]