RFR: 8255560: Class::isRecord should check that the current class is final and not abstract [v2]
Chris Hegarty
chegar at openjdk.java.net
Tue Dec 1 20:13:16 UTC 2020
On Tue, 1 Dec 2020 19:56:25 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> Chris Hegarty has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Mandy's review comments
>
> src/java.base/share/classes/java/lang/Class.java line 3668:
>
>> 3666: * <p> The {@linkplain #getSuperclass() direct superclass} of a record
>> 3667: * class is {@code java.lang.Record}. A record class is
>> 3668: * {@link Modifier#FINAL}. A record class has (possibly zero) record
>
> nit: `{@linkplain Modifier#FINAL final}`.
Good idea - done.
> test/jdk/java/lang/reflect/records/IsRecordTest.java line 138:
>
>> 136: record EmptyRecord () { }
>> 137: assertTrue(EmptyRecord.class.isRecord());
>> 138: assertTrue(EmptyRecord.class.getRecordComponents() != null);
>
> Better to have a more precise check for empty array
Good idea - done.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1543
More information about the core-libs-dev
mailing list