From 95a386f2a6c3ead192b0135a144c6c047bf94a7d Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 1 Apr 2008 16:40:53 -0600 Subject: [PATCH 1/3] handle null values in IsSameObject --- src/jnienv.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jnienv.cpp b/src/jnienv.cpp index a87e4e8942..c9f983bdef 100644 --- a/src/jnienv.cpp +++ b/src/jnienv.cpp @@ -1805,9 +1805,13 @@ GetJavaVM(Thread* t, Machine** m) jboolean JNICALL IsSameObject(Thread* t, jobject a, jobject b) { - ENTER(t, Thread::ActiveState); + if (a and b) { + ENTER(t, Thread::ActiveState); - return *a == *b; + return *a == *b; + } else { + return a == b; + } } struct JDK1_1InitArgs { From c9ef443944298e5c368e86c9ce84fa59f75d2cec Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 1 Apr 2008 16:42:50 -0600 Subject: [PATCH 2/3] add Modifier.isNative and isAbstract --- classpath/java/lang/reflect/Modifier.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classpath/java/lang/reflect/Modifier.java b/classpath/java/lang/reflect/Modifier.java index 1373197403..a2671ad4d3 100644 --- a/classpath/java/lang/reflect/Modifier.java +++ b/classpath/java/lang/reflect/Modifier.java @@ -33,4 +33,6 @@ public final class Modifier { public static boolean isStatic (int v) { return (v & STATIC) != 0; } public static boolean isFinal (int v) { return (v & FINAL) != 0; } public static boolean isSuper (int v) { return (v & SUPER) != 0; } + public static boolean isNative (int v) { return (v & NATIVE) != 0; } + public static boolean isAbstract (int v) { return (v & ABSTRACT) != 0; } } From e9eacd900ddfe26720b47629f611b5488a0189e6 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 1 Apr 2008 16:48:58 -0600 Subject: [PATCH 3/3] add Class.isInterface --- classpath/java/lang/Class.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classpath/java/lang/Class.java b/classpath/java/lang/Class.java index b608f8dd38..c4300db1db 100644 --- a/classpath/java/lang/Class.java +++ b/classpath/java/lang/Class.java @@ -376,6 +376,10 @@ public final class Class { return flags; } + public boolean isInterface() { + return (flags & Modifier.INTERFACE) != 0; + } + public Class getSuperclass() { return super_; }