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

java.util.jar.Attributes:equals() javadoc is not accurate

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 13
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      This is only a javadoc change to match the actual behavior of the implementation.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      The javadoc for java.util.jar.Attributes::equals does not match the actual implementation.

      Problem

      The javadoc for java.util.jar.Attributes::equals indicates that it checks to see if the given object is an instance of Attributes which it does not and the implementation has not changed since JDK 1.2.

      Solution

      Change the javadoc to match the implementation behavior as changing the implementation could potentially impact applications that expect the actual behavior.

      Specification

      Change the javadoc for the equals method from:

      /**
       * Compares the specified Attributes object with this Map for equality.
       * Returns true if the given object is also an instance of Attributes
       * and the two Attributes objects represent the same mappings.
       *
       * @param o the Object to be compared
       * @return true if the specified Object is equal to this Map
       */

      to

      /**
       * Compares the specified object to the underlying
       * {@linkplain Attributes#map map} for equality.
       * Returns true if the given object is also a Map
       * and the two maps represent the same mappings.
       *
       * @param o the Object to be compared
       * @return true if the specified Object is equal to this Map
       */

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lancea Lance Andersen
                Reporter:
                lancea Lance Andersen
                Reviewed By:
                Roger Riggs
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: