Add `Elements.isAutomaticModule(ModuleElement)`

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P3
    • 17
    • Affects Version/s: 16
    • Component/s: core-libs
    • None

      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;
              }
          }

            Assignee:
            Joe Darcy
            Reporter:
            Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: