RFR: 8274617: constructor and parameter annotations are not copied to the anonymous class constructor [v5]

liach duke at openjdk.java.net
Wed Dec 22 00:07:17 UTC 2021


On Mon, 13 Dec 2021 20:45:50 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Please review this PR which is about propagating constructor and parameter annotations to the anonymous class constructor. Currently we are propagating them to bridge methods which are synthetic. Propagating them to the anonymous class constructor seems sensible given that they are mandated by the spec. Please review also the related CSR,
>> 
>> TIA
>
> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
> 
>   additional tests

Hmm, since both annotation and method signature attributes' recorded signature/annotations don't exactly correspond to the parameters in the descriptor, I thought they probably would share the same mechanism of determining the exact parameter mapping. Reflection uses `MethodParameters` attribute's modifiers to determine how signatures apply to parameters, while it handles annotation in a separate way.

This indeed doesn't matter as the extra local variables passed are in the end of parameter list, which doesn't impact the current way annotations are written to class files and read at runtime. Sorry for digressing here.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6548


More information about the compiler-dev mailing list