RFR(S): JDK-8033911 Simplify instrumentation of FileInputStream and RandomAccessFile

Alan Bateman Alan.Bateman at oracle.com
Fri Feb 7 10:56:30 UTC 2014


On 07/02/2014 10:46, Staffan Larsen wrote:
> A few of the public read and write methods in FileInputStream and RandomAccessFile are declared native. This means that it is hard to instrument them using byte code instrumentation. Changing the public methods to be to non-native and instead calling private native methods simplifies instrumentation.
>
> webrev: http://cr.openjdk.java.net/~sla/8033911/webrev.00/
> bug: https://bugs.openjdk.java.net/browse/JDK-8033911
>
I assume you know this already but both JVM TI and java.lang.instrument 
do have support for hooking into the resolution of native methods. It is 
of course more complicated and not for the fainthearted.

The proposed changes look okay. The only thing is that it might not be 
complete but perhaps it's not too interesting to instrument methods such 
as skip or available.

-Alan.



More information about the core-libs-dev mailing list