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

Checked JNI pending exception check should be cleared when returning to Java frame

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u60, 9
    • hotspot
    • b138

      JDK-8043224 introduced a thread flag for warning the user when -Xcheck:jni should complain about native code not clearing or checking exceptions.

      Said flag should be implicitly cleared when returning to Java frame.

      That is, native code which makes a call normally requiring an exception check (e.g. calling Java method), does not need to check for exceptions if said code calls no other JNI API. Returning to Java frame should clear the pending check flag (for -Xcheck:jni warnings) and allow the exception to propagate to Java code as per normal.

      Without this fix, there are quite a number of false warnings produced by core-library native code, causing some noise during JVM testing and when users need -Xcheck:jni

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

              Created:
              Updated:
              Resolved: