RFR: JDK-8243057: compilation of annotated static record fields fails with NPE
Jan Lahoda
jan.lahoda at oracle.com
Tue Jul 21 08:50:52 UTC 2020
Hi Vicente,
I am sorry, but saying "s.flags_field == $mask" feels somewhat dangerous
to me - what if there are other (valid) flags that can be added to
record components/fields?
My understanding was that the record members are marked with the RECORD
flag, should it be enough to say:
boolean isRecordField = declarationTree.hasTag(VARDEF) &&
(s.flags_field & RECORD) != 0 &&
s.owner.kind == TYP;
?
Thanks,
Jan
On 20. 07. 20 18:53, Vicente Romero wrote:
> ping, it is a simple review,
>
> Vicente
>
> On 7/17/20 3:36 PM, Vicente Romero wrote:
>> Please review fix for [1] at [2]. At method Check::validateAnnotation
>> the condition used to determine if a field is or not a record field
>> was wrong. As a consequence static fields were considered as record
>> fields. This doesn't have any consequence unless they are annotated.
>> This patch is fixing this issue.
>>
>> Thanks,
>> Vicente
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8243057
>> [2] http://cr.openjdk.java.net/~vromero/8243057/webrev.00/
>
More information about the compiler-dev
mailing list