Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8261625

Add `Elements.isAutomaticModule(ModuleElement)`

    XMLWordPrintable

    Details

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

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: