3141ed0fe0
gcc/java: PR java/18278: * expr.c (build_jni_stub): Unwrap the return value. * java-tree.h (soft_unwrapjni_node): New define. (enum java_tree_index): Added JTI_SOFT_UNWRAPJNI_NODE. * decl.c (java_init_decl_processing): Initialize soft_unwrapjni_node. libjava: PR java/18278: * testsuite/libjava.jni/pr18278.out: New file. * testsuite/libjava.jni/pr18278.c: New file. * testsuite/libjava.jni/pr18278.java: New file. * include/jvm.h (_Jv_UnwrapJNIweakReference): Declare. * jni.cc (_Jv_UnwrapJNIweakReference): New function. (call): Unwrap return value if needed. From-SVN: r107676
14 lines
289 B
Java
14 lines
289 B
Java
public class pr18278 {
|
|
public pr18278() {}
|
|
|
|
public static void main(String[] args) {
|
|
System.loadLibrary("pr18278");
|
|
String bob = "Bob";
|
|
Object o = weakRef("Bob");
|
|
System.out.println(o);
|
|
System.out.println(bob == o);
|
|
}
|
|
|
|
static native Object weakRef(Object o);
|
|
}
|