RFR: 8292275: javac does not emit SYNTHETIC and MANDATED flags for parameters by default [v7]
Chen Liang
liach at openjdk.org
Thu Apr 27 20:29:55 UTC 2023
On Thu, 27 Apr 2023 19:27:49 GMT, Vicente Romero <vromero at openjdk.org> wrote:
>> Hannes Greule has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 26 additional commits since the last revision:
>>
>> - Merge pull request #1 from liachmodded/methodparameters-flags
>>
>> - Update tests
>> - Parity for the parameter flag tests in javac and reflection
>> - Updated RequiredMethodParameterFlagTest, checks against Local classes as well
>> - Merge branch 'master' into methodparameters-flags
>> - Update copyright year
>> - Merge remote-tracking branch 'upstream/master' into fix/enforce-methodparam_attr-if-mandated
>> - address comments
>> - cleanup
>> - add annotation processing test
>> - ... and 16 more: https://git.openjdk.org/jdk/compare/17e2d7c4...5ac3a214
>
> make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java line 2388:
>
>> 2386: for (MethodParameters_attribute.Entry e : params.method_parameter_table) {
>> 2387: String name = null;
>> 2388: if (e.name_index != 0) {
>
> could use ternary operator here, but tbh not sure why this change is necessary. The current code is supposed to fail with `ConstantPool.InvalidIndex` exception if the an index is `<= 0`, is this changing now? I mean can `name_index` be `0` now?
`name_index` could always have been 0 to indicate an absent parameter name: https://docs.oracle.com/javase/specs/jvms/se20/html/jvms-4.html#jvms-4.7.24
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/9862#discussion_r1179631049
More information about the compiler-dev
mailing list