JDK-8230686 : JNI FindClass should specify that the class is initialized
  • Type: CSR
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 14
  • Submitted: 2019-09-06
  • Updated: 2019-09-20
  • Resolved: 2019-09-20
Related Reports
CSR :  
Description
Summary
-------

Add a statement that JNI FindClass initializes the class (if not already initialized), to match what the implementation has done since Java 1.2

Problem
-------

JNI FindClass has ensured the class is initialized since Java 1.2, but the specification does not state this, it refers only to "loading and linking".

Solution
--------

State that the class will be initialized.

Specification
-------------

    diff -r 86692474afa6 closed/src/java.se/share/specs/jni/functions.md
    --- a/closed/src/java.se/share/specs/jni/functions.md
    +++ b/closed/src/java.se/share/specs/jni/functions.md
    @@ -587,8 +587,8 @@
     call native methods. `FindClass` locates the class loader associated with the
     current native method; that is, the class loader of the class that declared the
     native method. If the native method belongs to a system class, no class loader
    -will be involved. Otherwise, the proper class loader will be invoked to load
    -and link the named class.
    +will be involved. Otherwise, the proper class loader will be invoked to load,
    +link, and initialize, the named class.