8033911: Simplify instrumentation of FileInputStream and RandomAccessFile
authorsla
Mon, 10 Feb 2014 13:00:50 +0100
changeset 22946 0a1379d15976
parent 22945 89dd803515d8
child 22947 c7d9e7b465f9
8033911: Simplify instrumentation of FileInputStream and RandomAccessFile Reviewed-by: alanb, dsamersoff, jbachorik
jdk/make/mapfiles/libjava/mapfile-vers
jdk/src/share/classes/java/io/FileInputStream.java
jdk/src/share/classes/java/io/RandomAccessFile.java
jdk/src/share/native/java/io/FileInputStream.c
jdk/src/share/native/java/io/RandomAccessFile.c
--- a/jdk/make/mapfiles/libjava/mapfile-vers	Mon Feb 10 12:59:31 2014 +0100
+++ b/jdk/make/mapfiles/libjava/mapfile-vers	Mon Feb 10 13:00:50 2014 +0100
@@ -79,7 +79,7 @@
 		Java_java_io_FileInputStream_close0;
 		Java_java_io_FileInputStream_initIDs;
 		Java_java_io_FileInputStream_open;
-		Java_java_io_FileInputStream_read;
+		Java_java_io_FileInputStream_read0;
 		Java_java_io_FileInputStream_readBytes;
 		Java_java_io_FileInputStream_skip;
 		Java_java_io_FileOutputStream_close0;
@@ -98,11 +98,11 @@
 		Java_java_io_RandomAccessFile_initIDs;
 		Java_java_io_RandomAccessFile_length;
 		Java_java_io_RandomAccessFile_open;
-		Java_java_io_RandomAccessFile_read;
+		Java_java_io_RandomAccessFile_read0;
 		Java_java_io_RandomAccessFile_readBytes;
 		Java_java_io_RandomAccessFile_seek0;
 		Java_java_io_RandomAccessFile_setLength;
-		Java_java_io_RandomAccessFile_write;
+		Java_java_io_RandomAccessFile_write0;
 		Java_java_io_RandomAccessFile_writeBytes;
 		Java_java_io_UnixFileSystem_canonicalize0;
 		Java_java_io_UnixFileSystem_checkAccess;
--- a/jdk/src/share/classes/java/io/FileInputStream.java	Mon Feb 10 12:59:31 2014 +0100
+++ b/jdk/src/share/classes/java/io/FileInputStream.java	Mon Feb 10 13:00:50 2014 +0100
@@ -194,7 +194,11 @@
      *             file is reached.
      * @exception  IOException  if an I/O error occurs.
      */
-    public native int read() throws IOException;
+    public int read() throws IOException {
+        return read0();
+    }
+
+    private native int read0() throws IOException;
 
     /**
      * Reads a subarray as a sequence of bytes.
--- a/jdk/src/share/classes/java/io/RandomAccessFile.java	Mon Feb 10 12:59:31 2014 +0100
+++ b/jdk/src/share/classes/java/io/RandomAccessFile.java	Mon Feb 10 13:00:50 2014 +0100
@@ -316,7 +316,11 @@
      * @exception  IOException  if an I/O error occurs. Not thrown if
      *                          end-of-file has been reached.
      */
-    public native int read() throws IOException;
+    public int read() throws IOException {
+        return read0();
+    }
+
+    private native int read0() throws IOException;
 
     /**
      * Reads a sub array as a sequence of bytes.
@@ -464,7 +468,11 @@
      * @param      b   the {@code byte} to be written.
      * @exception  IOException  if an I/O error occurs.
      */
-    public native void write(int b) throws IOException;
+    public void write(int b) throws IOException {
+        write0(b);
+    }
+
+    private native void write0(int b) throws IOException;
 
     /**
      * Writes a sub array as a sequence of bytes.
--- a/jdk/src/share/native/java/io/FileInputStream.c	Mon Feb 10 12:59:31 2014 +0100
+++ b/jdk/src/share/native/java/io/FileInputStream.c	Mon Feb 10 13:00:50 2014 +0100
@@ -62,7 +62,7 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_java_io_FileInputStream_read(JNIEnv *env, jobject this) {
+Java_java_io_FileInputStream_read0(JNIEnv *env, jobject this) {
     return readSingle(env, this, fis_fd);
 }
 
--- a/jdk/src/share/native/java/io/RandomAccessFile.c	Mon Feb 10 12:59:31 2014 +0100
+++ b/jdk/src/share/native/java/io/RandomAccessFile.c	Mon Feb 10 13:00:50 2014 +0100
@@ -64,7 +64,7 @@
 }
 
 JNIEXPORT jint JNICALL
-Java_java_io_RandomAccessFile_read(JNIEnv *env, jobject this) {
+Java_java_io_RandomAccessFile_read0(JNIEnv *env, jobject this) {
     return readSingle(env, this, raf_fd);
 }
 
@@ -75,7 +75,7 @@
 }
 
 JNIEXPORT void JNICALL
-Java_java_io_RandomAccessFile_write(JNIEnv *env, jobject this, jint byte) {
+Java_java_io_RandomAccessFile_write0(JNIEnv *env, jobject this, jint byte) {
     writeSingle(env, this, byte, JNI_FALSE, raf_fd);
 }