15 RFR(XS): 8165276: Spec states that invoke the premain method in an agent class if it's public but implementation differs

serguei.spitsyn at oracle.com serguei.spitsyn at oracle.com
Wed Jun 24 02:05:22 UTC 2020


Please, review a fix for:
   https://bugs.openjdk.java.net/browse/JDK-8165276


CSR draft (one CSR reviewer is needed before finalizing it):
   https://bugs.openjdk.java.net/browse/JDK-8248189


Webrev:
http://cr.openjdk.java.net/~sspitsyn/webrevs/2020/instr-setAccessible.1/


The java.lang.instrument spec:
https://docs.oracle.com/en/java/javase/14/docs/api/java.instrument/java/lang/instrument/package-summary.html


Summary:
   The java.lang.instrument spec clearly states:
     "The agent class must implement a public static premain method
      similar in principle to the main application entry point."
   Current implementation of sun/instrument/InstrumentationImpl.java
   allows the premain method be non-public which violates the spec.
   This fix aligns the implementation with the spec.


Testing:
   A mach5 run of jdk_instrument tests is in progress.


Thanks,
Serguei


More information about the serviceability-dev mailing list