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

Elements.getPackageOf should handle modules

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 13
    • core-libs
    • None
    • behavioral
    • minimal
    • Cover a missing case in the spec and implementation.
    • Java API
    • SE

      Summary

      Specify that Elements.getPackageOf returns null for a module.

      Problem

      The Elements.getPackageOf method was not updated to specify how modules were handled by the method.

      Solution

      Add the missing case to the specification.

      Specification

           /**
            * Returns the package of an element.  The package of a package is
            * itself.
      +     * The package of a module is {@code null}.
            *
            * @param type the element being examined
            * @return the package of an element
            */
           PackageElement getPackageOf(Element type);

            darcy Joe Darcy
            darcy Joe Darcy
            Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: