RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v4]
liach
duke at openjdk.java.net
Fri May 27 02:32:49 UTC 2022
On Fri, 27 May 2022 01:55:25 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> liach has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
>>
>> - Merge branch 'master' into proxy-class-forname
>> - Move the try catch block as it doesn't throw checked exceptions
>> - remove unused field
>> - whitespace
>> - Copyright year
>> - typo
>> - 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization
>> - Test for eager initialization
>
> test/jdk/java/lang/reflect/Proxy/LazyInitializationTest.java line 53:
>
>> 51: new Class<?>[]{ Intf.class },
>> 52: (proxy, method, args) -> null);
>> 53: Assert.assertFalse(initialized, "parameter type initialized eagerly");
>
> This expects "parameter type initialized eagerly" to be false. This may cause confusion to the reader. Maybe just simply "initialized expected: false" and a comment would help too. Similarly for line 56.
I renamed the message to "parameter type initialized unnecessarily", which should be more clear.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8800
More information about the core-libs-dev
mailing list