RFR: 8285401: Proxy class initializer should use 3-arg `Class.forName` to avoid unnecessary class initialization [v3]

Roger Riggs rriggs at openjdk.java.net
Fri May 20 19:57:40 UTC 2022


On Fri, 20 May 2022 18:22:47 GMT, liach <duke at openjdk.java.net> wrote:

>> Simplify calls `Class.forName(String, boolean, ClassLoader)` instead of `Class.forName(String)`. `make test TEST="jtreg:test/jdk/java/lang/reflect/Proxy"` passes, with the new `LazyInitializationTest` failing the eager initialization check on the baseline and passing with this patch.
>> 
>> On a side note, this might reduce the number of methods that can be encoded in a proxy due to code attribute size restrictions; we probably would address that in another issue, as we never mandated a count of methods that the proxy must be able to implement.
>> 
>> Mandy, would you mind review this?
>
> liach has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Move the try catch block as it doesn't throw checked exceptions

Looks fine.

-------------

Marked as reviewed by rriggs (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8800


More information about the core-libs-dev mailing list