Clarifying record reflective support
maurizio.cimadamore at oracle.com
Tue Dec 3 17:23:37 UTC 2019
On 03/12/2019 17:15, Brian Goetz wrote:
> I am not even sure if “has a record attribute” isn’t overkill. “Is a record class” is the more proper semantic specification, and it’s not clear to me that reflection api spec is the place to record these things.
Should reflection speak about 'has a record attribute XYZ' ? I don't
think so (we agree here perhaps).
But I think that 4.7:
looks pretty much spot on in listing the Record attribute in the same
list as Signature, EnclosingMethod and other things that are relevant
reflection-wise (hence the format-check).
> Sent from my MacBook Wheel
>> On Dec 3, 2019, at 12:12 PM, Alex Buckley <alex.buckley at oracle.com> wrote:
>> On 12/3/2019 8:49 AM, Dan Smith wrote:
>>> Fine: "isRecord returns true if the class extends java.lang.Record
>>> and has a Record attribute." (a little more detailed than most
>>> reflection methods, but that's probably good)
>>> Overkill: "isRecord returns true if the class extends
>>> java.lang.Record and has a Record attribute that conforms to the
>>> following rules ..."
>> Yes. "has a Record attribute" is the most that the broadly-read API spec should admit about the class file. Even "has a *well-formed* Record attribute" would be too much, since it quickly devolves into your overkill scenario.
More information about the amber-spec-experts