RFR: 8165276: Spec states to invoke the premain method in an agent class if it's public but implementation differs [v10]
Mandy Chung
mchung at openjdk.java.net
Tue Dec 22 17:28:03 UTC 2020
On Tue, 22 Dec 2020 05:47:19 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:
>> This change have been already reviewed by Mandy, Sundar, Alan and David.
>> Please, see the jdk 15 review thread:
>> http://mail.openjdk.java.net/pipermail/serviceability-dev/2020-June/031998.html
>>
>> Now, the PR approval is needed.
>> The push was postponed because the CSR was not approved at that time (it is now):
>> https://bugs.openjdk.java.net/browse/JDK-8248189
>> Investigation of existing popular java agents was requested by Joe.
>> ----------
>>
>> The java.lang.instrument spec:
>> https://docs.oracle.com/en/java/javase/15/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.
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
>
> @summary of some negative tests is corrected
test/jdk/java/lang/instrument/RetransformAgent.java line 26:
> 24: /**
> 25: * @test
> 26: * @bug 6274264 6274241 5070281 8165276
The copyright header and `@bug` change should be reverted.
test/jdk/java/lang/instrument/SimpleAgent.java line 2:
> 1: /*
> 2: * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
The copyright header change should be reverted.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1694
More information about the serviceability-dev
mailing list