Jigsaw Enhancement RFR round #1: 8156147 Add ClassLoader parameter to new ClassFileTransformer transform method

serguei.spitsyn at oracle.com serguei.spitsyn at oracle.com
Tue Jun 28 23:58:00 UTC 2016


Thanks, Dan!
Serguei


On 6/28/16 14:45, Daniel D. Daugherty wrote:
> On 6/28/16 5:06 AM, serguei.spitsyn at oracle.com wrote:
>> Please, review the Jigsaw fix for the enhancement:
>> https://bugs.openjdk.java.net/browse/JDK-8159147
>>
>>
>> Jdk webrev:
>> http://cr.openjdk.java.net/~sspitsyn/webrevs/2016/jdk/8159147-Jigsaw-jli.jdk1/
>
> src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java
>     No comments.
>
> src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java
>     No comments.
>
> src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java
>     No comments.
>
> src/java.instrument/share/classes/sun/instrument/TransformerManager.java
>     No comments.
>
> src/java.instrument/share/native/libinstrument/JPLISAgent.c
>     No comments.
>
> src/java.instrument/share/native/libinstrument/JPLISAgent.h
>     No comments.
>
> test/java/lang/instrument/ATransformerManagementTestCase.java
>     No comments.
>
> test/java/lang/instrument/RetransformAgent.java
>     No comments.
>
> test/java/lang/instrument/SimpleIdentityTransformer.java
>     No comments.
>
> Thumbs up.
>
> Dan
>
>> Summary:
>>
>> As noted in JDK-8155207 
>> <https://bugs.openjdk.java.net/browse/JDK-8155207> and elsewhere, one 
>> of the outstanding items for java.lang.instrument is
>>   whether the new ClassFileTransformer transform method should 
>> provider the ClassLoader parameter.
>>   After further consideration then this seems useful and avoids 
>> agents needing permissions to invoke Module::getClassLoader.
>>   The fix is to add the ClassLoader as the second parameter of the 
>> ClassFileTransformer#transform() method.
>>
>>  This fix also replaces the usage of the JVM_GetModuleByPackageName 
>> with the JVMTI GetNamedModule in the JPLISAgent.c.
>>  It is why this fix depends on the fix of the JVMTI enhancement:
>> https://bugs.openjdk.java.net/browse/JDK-8159145
>>  and so, must be pushed after the JDK-8159145.
>>
>>
>> Testing:
>>    Ran the Jtreg java/lang/instrument tests.
>>    Ran two updated jtreg j.l.i tests:
>>       java/lang/instrument/RetransformAgent.java
>>       java/lang/instrument/SingleTransformerTest.java
>>
>> Thanks,
>> Serguei
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20160628/35b18e3a/attachment-0001.html>


More information about the serviceability-dev mailing list