RFR: 8226216: parameter modifiers are not visible to javac plugins across compilation boundaries [v3]

Joel Borggrén-Franck jfranck at openjdk.java.net
Tue Apr 27 14:24:52 UTC 2021


On Fri, 23 Apr 2021 12:41:13 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Hi all,
>> 
>> javac fails to read modifiers from the MethodParameters attribute in class files, which prevents plugins from accessing those modifiers across compilation boundaries. Because `com.sun.tools.javac.jvm.ClassReader` doesn't read and store the access flags(modifiers) from MethodParameters attribute.
>> 
>> This patch fixes it and adds a corresponding test case. All the existing tests of javac passed locally.
>> 
>> Thank you for taking the time to review.
>> 
>> Best Regards.
>
> Guoxiong Li 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 four additional commits since the last revision:
> 
>  - Use meaningful class name and update copyright
>  - Merge branch 'master' into JDK-8226216
>  - Modify legal header. Fix typo.
>  - 8226216: parameter modifiers are not visible to javac plugins across compilation boundaries

test/langtools/tools/javac/classreader/ParameterModifiersAcrossCompilationBoundaries.java line 142:

> 140:                 .writeAll()
> 141:                 .getOutputLines(Task.OutputKind.STDERR);
> 142:         List<String> firstExpected = Arrays.asList("x [final]", "x [final]");

Why are there supposed to be two "x [final]" in the first output?

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

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


More information about the compiler-dev mailing list