RFR: JEP 359: Records (Preview) (full code)

Joe Darcy joe.darcy at oracle.com
Tue Dec 3 05:36:40 UTC 2019


Hi Vicente,

These comments are based on

http://cr.openjdk.java.net/~vromero/records.review/all_code/webrev.01/

I looked over the core-libs and javax.lang.model changes.

As a non-essential cleanup, in 
src/java.base/share/classes/java/io/ObjectOutputStream.java:

1444             final boolean isRecord = isRecord(obj.getClass()) ? 
true : false;
1445             if (isRecord) {
1446                 writeRecordData(obj,desc);
1447             } else if (desc.isExternalizable() && !desc.isProxy()) {

would be clearer as

1445             if (isRecord(obj.getClass())) {
1446                 writeRecordData(obj,desc);
1447             } else if (desc.isExternalizable() && !desc.isProxy()) {

Also as a potential refactoring, in java.lang.Class, it would be clearer 
if the native getRecordComponents0 method returned a RecordComponent[] 
rather than an Object[] as it is elsewhere documented that only the VM 
can create RecordComponent objects.

In 
src/java.base/share/classes/sun/reflect/annotation/TypeAnnotation.java, 
the obsolete way on indicating preview-ness is used. Please fix before 
pushing:

   93         THROWS,
   94         /**
   95          * @deprecated This target is part of a preview feature 
and may be removed
   96          * if the preview feature is removed.
   97          */
   98         @Deprecated(forRemoval=true, since="14")
   99         @SuppressWarnings("removal")
  100         RECORD_COMPONENT;

No re-review is needed.

Thanks,

-Joe



More information about the core-libs-dev mailing list