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

JNI spec for ExceptionDescribe contradicts hotspot behaviour

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: