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

Guoxiong Li gli at openjdk.java.net
Tue Apr 27 15:13:48 UTC 2021


On Tue, 27 Apr 2021 14:22:09 GMT, Joel Borggrén-Franck <jfranck at openjdk.org> wrote:

>> 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?

Because it has two source files. Please see the code snippet of the method `JavaCompiler.enterTrees`.


public List<JCCompilationUnit> enterTrees(List<JCCompilationUnit> roots)
// ignore other code.
        if (!taskListener.isEmpty()) {
            for (JCCompilationUnit unit: roots) {
                TaskEvent e = new TaskEvent(TaskEvent.Kind.ENTER, unit);
                taskListener.finished(e);
            }
        }
//  ignore other code.
}


The task listener is called every time there is a `JCCompilationUnit`.

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

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


More information about the compiler-dev mailing list