RFR: JDK-8281671: Class.getCanonicalName spec should explicitly cover array classes [v2]

Joe Darcy darcy at openjdk.java.net
Wed Feb 16 22:06:10 UTC 2022


On Wed, 16 Feb 2022 20:17:31 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Augment test.
>
> test/jdk/java/lang/Class/NameTest.java line 27:
> 
>> 25:  * @test
>> 26:  * @bug 8281671
>> 27:  * @summary Checks on various "getFooName" methods of java.lang.Class
> 
> This tests only `getCanonicalName` method.

Added analogous test cases for getSimpleName name.

> test/jdk/java/lang/Class/NameTest.java line 56:
> 
>> 54:         expectedCanonicalName.put(int.class,              "int");
>> 55:         expectedCanonicalName.put(Object.class,           "java.lang.Object");
>> 56:         expectedCanonicalName.put(objectArray.getClass(), "java.lang.Object[]");
> 
> Just an observation: TestNG is a good option to clearly show the data provider and the test body.  Up to you.

Noted; I'll stick with the hand-written code for now.

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

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


More information about the core-libs-dev mailing list