JDK-8261625 : Add `Elements.isAutomaticModule(ModuleElement)`
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: javax.lang.model
  • Affected Version: 16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-02-12
  • Updated: 2021-04-15
  • Resolved: 2021-04-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b18Fixed
Related Reports
CSR :  
Description
javac knows if a module is an automatic module. We should expose that through the Elements class. 

For example:

    public boolean isAutomaticModule(ModuleElement me) {
        if (me == null) {
            return false; // or throw NPE
        } else {
            ModuleSymbol msym = (ModuleSymbol) me;
            return (msym.flags() & Flags.AUTOMATIC_MODULE) != 0;
        }
    }
Comments
Changeset: ccefa5e3 Author: Joe Darcy <darcy@openjdk.org> Date: 2021-04-08 21:25:17 +0000 URL: https://git.openjdk.java.net/jdk/commit/ccefa5e3
08-04-2021