Is this a clerical error in HeapByteBuffer?

Alan Bateman Alan.Bateman at oracle.com
Fri Oct 30 16:46:27 UTC 2015


I assume this is JDK-8079860, which is indeed a regression in 9. Andrew 
Haley has a fix for this but it doesn't seem to have been pushed yet.

-Alan.

On 30/10/2015 16:42, Crofevil wrote:
> Hi all,
> I tested jdk9 by mauve(Harness) and found a failed case "gnu.testlet.java.nio.ByteBuffer.Allocating".
>
> The case tried to access the buffer with illegal index and caught the exception.
> It failed while calling the function getFloat(), excepted an underflow exception but got an overflow exception.
>
> I'm sorry for that I didn't get the source code on my computer at home, so I just can describe the question via text:
> After investigating, I found the mistake was in HeapByteBuffer.java, generated by a template file. In this file all 'get' function(like getInt, getLong and getChar etc.) have called a sub function named nextGetIndex() except getFloat() - the function getFloat() has called a sub function named nextPutIndex() and the sub function would cause an overflow exception while accessing with illegal index.
>
> I checked the function getFloat() on jdk8 and it was the same as other functions(call nextGetIndex()), and the case was passed on jdk8.
> I'm not sure this is just a clerical error or modified for some purpose. Does anyone know it?
>
> Thanks,
> Teng Lu.



More information about the jdk9-dev mailing list