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

Add `Elements.isAutomaticModule(ModuleElement)`

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 17
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Typical use of default methods to add a method to an interface.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Add a convenience predicate to javax.lang.model.util.Elements to test for automatic modules.

      Problem

      No API in javax.lang.model to determine of a module is automatic or not.

      Solution

      Add a method providing the functionality in question.

      Specification

      New method added to javax.lang.model.util.Elements:

      /**
       * {@return {@code true} if the module element is an automatic
       * module, {@code false} otherwise}
       *
       * @implSpec
       * The default implementation of this method returns {@code
       * false}.
       *
       * @param module the module element being examined
       * @jls 7.7.1 Dependences
       * @since 17
       */
      default boolean isAutomaticModule(ModuleElement module)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              jjg Jonathan Gibbons
              Reviewed By:
              Vicente Arturo Romero Zaldivar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: