RFR: JDK-8281001 Examine the behavior of Class::forName if the caller is null
Tim Prinzing
duke at openjdk.java.net
Tue May 17 16:58:49 UTC 2022
On Mon, 16 May 2022 18:55:42 GMT, Mandy Chung <mchung at openjdk.org> wrote:
> `Class::forName(String)` javadoc should specify which class loader to use when invoked with null caller similar to the other APIs you fixed for null callers.
>
> I think this new test case does not belong to `NullCallerGetResource.java` which is a test for `Module::getResource`. It's better to be placed under the `test/jdk/java/lang/Class/forName` directory that makes it clear it's a test for `Class::forName`.
>
> Alternatively, we could move all the tests for null caller under a new clearly-named directory, maybe `test/jdk/jdk/nullCaller`. This may allow to do some refactoring and remove the duplicated code in these test cases. What do you think?
I like the idea of moving all the null caller tests to a clearly named directory to avoid duplication.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8711
More information about the core-libs-dev
mailing list