[lworld] RFR: 8273018: [lworld] Property annotation propagation to <init> lacks in primitive records [v2]

Jesper Steen Møller jespersm at openjdk.java.net
Thu Sep 16 23:32:56 UTC 2021

On Wed, 15 Sep 2021 09:24:32 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:

>> Jesper Steen Møller has updated the pull request incrementally with one additional commit since the last revision:
>>   - Emit parameter names (described JDK-8273202)
>>   - Keep type parameters
>>   - Provide useful test for primitive records in "RecordReading"
> src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/TransPrimitiveClass.java line 394:
>> 392:         MethodType factoryType = new MethodType(init.type.getParameterTypes(),
>> 393:                                                 init.owner.type.asValueType(),
>> 394:                                                 init.type.getThrownTypes(),
> I am lost and need a bit of help here. What exactly is the change and why is it needed ?

This method makes a primitive object factory from the parsed constructor. In the current version, the parameter types are erased and their annotations, and original method signature, are erased from the original. This line preserves this information, so the generated classfile is correct.

See next comment.


PR: https://git.openjdk.java.net/valhalla/pull/541

More information about the valhalla-dev mailing list