inline record ref projection contains an empty record attribute

Chris Hegarty chris.hegarty at oracle.com
Mon Dec 7 16:56:58 UTC 2020


Remi,

> On 7 Dec 2020, at 16:25, Remi Forax <forax at univ-mlv.fr> wrote:
> 
> ----- Mail original -----
>> De: "Srikanth" <srikanth.adayapalam at oracle.com>
>> À: "valhalla-dev" <valhalla-dev at openjdk.java.net>
>> Cc: "Jim Laskey" <james.laskey at oracle.com>
>> Envoyé: Lundi 7 Décembre 2020 08:27:39
>> Objet: Re: inline record ref projection contains an empty record attribute
> 
>> Hi Remi,
> 
> Hi Srikanth, hi Jim,
> 
>> 
>> Thanks for the problem report.
>> https://bugs.openjdk.java.net/browse/JDK-8251041 tracks the issues
>> relating to inline records.
>> We know of quite a few issues. (including reported by you in the past) -
>> Jim is looking into these.
> 
> my main blocking point actually is that the reflection API checks if a class is a record using getSuperclass() == j.l.Record.class

I do not have a reference to hand, but the requirement for Class::isRecord to check that j.l.Record is a the direct superclass was requested during one of the umbrella records CSRs. There was a concern that the reflective APIs could be “fooled” into thinking that a particular j.l.Class is a record class when it is in fact largely not in a record class, as outlined by the JLS.

> instead of isAssignableFrom (or mark all classes that inherits directly or indirectly from java.lang.Record if perf is an issue).

If isAssignableFrom is sufficient ( now that isRecord asserts finalness ), then maybe both the JLS and reflection should be updated. It might be best to bring this up on the Amber list.

-Chris.


More information about the valhalla-dev mailing list