JNI spec for ExceptionDescribe contradicts hotspot behaviour

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: