RFR: 8261625: Add `Elements.isAutomaticModule(ModuleElement)` [v2]

Vicente Romero vromero at openjdk.java.net
Thu Apr 8 16:58:13 UTC 2021


On Thu, 8 Apr 2021 06:25:37 GMT, Joe Darcy <darcy at openjdk.org> wrote:

>> Addition of a small convenience method, with a default implementation, to Elements.
>> 
>> Most of the change is testing infrastructure. The negative cases, such as named modules, are tested in the style of other annotation processing tests for Elements utilities.
>> 
>> An automatic module comes from a jar file, so an API reading from a jar file is needed. To avoid piping in the awkward plumbing needed to do that directly in the annotation processing tests, I updated an existing automatic modules test which uses the tool box facility. My additions to the tool box might not be the done in the most idiomatic style for that API; happy to have guidance on how to proceed better there.
>> 
>> Assuming this general approach is agreed to, I'll update the imports on AutomaticModules.java to condense the text of the annotation processor source.
>
> Joe Darcy 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 five additional commits since the last revision:
> 
>  - Respond to review feedback.
>  - Merge branch 'master' into 8261625
>  - Add test coverage.
>  - Merge branch 'master' into 8261625
>  - 8261625

lgtm

test/langtools/tools/javac/processing/model/util/elements/TestIsAutomaticMod.java line 53:

> 51:                 ModuleElement enclosing = elements.getModuleOf(e);
> 52:                 checkMod(enclosing, false);
> 53:                 System.out.println(enclosing.toString());

can this line `System.out...` be removed? probably a debugging leftover?

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

Marked as reviewed by vromero (Reviewer).

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


More information about the compiler-dev mailing list