Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8051947

JNI spec for ExceptionDescribe contradicts hotspot behaviour

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 9
    • 9
    • hotspot

      The original JNI book says that ExceptionDescribe has the side effect of clearing the exception
      This text is not present in the on-line JNI specification
      However hotspot most certainly does clear it as I see this :-

      JNI_ENTRY_NO_PRESERVE(void, jni_ExceptionDescribe(JNIEnv *env))
      JNIWrapper("ExceptionDescribe");

      HOTSPOT_JNI_EXCEPTIONDESCRIBE_ENTRY(env);

      if (thread->has_pending_exception()) {
      Handle ex(thread, thread->pending_exception());
      thread->clear_pending_exception();
      ....

      and a small test progam I wrote confirms that behaviour.

            dsimms David Simms
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: