Is this a clerical error in HeapByteBuffer?

Crofevil crofevil at qq.com
Fri Oct 30 16:42:29 UTC 2015


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