# HG changeset patch # User coleenp # Date 1372873539 14400 # Node ID f323bbb0e6c1208911c582fba71ad16f890c6108 # Parent cedf20e2a655329f04732f2e67ebbb98cf46cb07 8019833: Wrong JNI error code for preexisting JVM Summary: Return the appropriate JNI error message (instead of the generic one) when the JVM is already started Reviewed-by: coleenp, hseigel Contributed-by: sylvestre@debian.org diff -r cedf20e2a655 -r f323bbb0e6c1 src/share/vm/prims/jni.cpp --- a/src/share/vm/prims/jni.cpp Tue Jul 02 16:54:24 2013 +0200 +++ b/src/share/vm/prims/jni.cpp Wed Jul 03 13:45:39 2013 -0400 @@ -5097,7 +5097,7 @@ // function used to determine this will always return false. Atomic::xchg // does not have this problem. if (Atomic::xchg(1, &vm_created) == 1) { - return JNI_ERR; // already created, or create attempt in progress + return JNI_EEXIST; // already created, or create attempt in progress } if (Atomic::xchg(0, &safe_to_recreate_vm) == 0) { return JNI_ERR; // someone tried and failed and retry not allowed.