From 9a899a2e4ad09b8dddcedc6eee2c17fbdd3431a3 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 7 Dec 2013 16:22:08 -0700 Subject: [PATCH] fix FileInputStream for newer openjdk7 versions --- src/classpath-openjdk.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index f27bf88605..0dfdae73c5 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -2004,8 +2004,13 @@ interceptFileOperations(Thread* t, bool updateRuntimeData) intercept(t, fileInputStreamClass, "open", "(Ljava/lang/String;)V", voidPointer(openFile), updateRuntimeData); - intercept(t, fileInputStreamClass, "read", "()I", - voidPointer(readByteFromFile), updateRuntimeData); + if(findMethodOrNull(t, fileInputStreamClass, "read0", "()I") != 0) { + intercept(t, fileInputStreamClass, "read0", "()I", + voidPointer(readByteFromFile), updateRuntimeData); + } else { + intercept(t, fileInputStreamClass, "read", "()I", + voidPointer(readByteFromFile), updateRuntimeData); + } intercept(t, fileInputStreamClass, "readBytes", "([BII)I", voidPointer(readBytesFromFile), updateRuntimeData);