RFR: JDK-8281001 Class::forName(String) defaults to system class loader if the caller is null [v5]
Mandy Chung
mchung at openjdk.java.net
Wed Jun 8 04:47:17 UTC 2022
On Wed, 8 Jun 2022 02:40:15 GMT, Tim Prinzing <tprinzing at openjdk.org> wrote:
>> The Class::forName behavior change to match JNI FindClass is a compatible change and seems pretty attractive as it would be expected that Class::forName would give the same behavior as FindClass which uses the system classloader. The test for 8281006 was enhanced to test for this change. Merged master to pick up fixes to unrelated test failures to reduce noise.
>
> Tim Prinzing has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:
>
> - formatting improvement
> - Merge branch 'master' into JDK-8281001
> - Fixed the build of the native c++ test NullCallerTest to specify
> the c++ std library as part of the build. Changed the test to
> use iostream instead of printf. Enabled the test for Class::forName
> which is now located in test/jdk/jni/nullCaller (as part of the
> merge of JDK-8287171).
> - Merge branch 'master' into JDK-8281001
> - make javadoc consistent with other caller sensitve methods
> - Added javadoc comment
> - Merge branch 'master' into JDK-8281001
> - JDK-8281001 Examine the behavior of Class::forName if the caller is null
Looks good. Thanks for refactoring the tests, making the addition of a new test case much cleaner.
test/jdk/jni/nullCaller/NullCallerTest.java line 27:
> 25: /**
> 26: * @test
> 27: * @bug 8280902 8281000 8281001 8281003 8281006
nit: append the bug rather than keeping the list in an increasing order.
-------------
Marked as reviewed by mchung (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/8711
More information about the core-libs-dev
mailing list