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

typo in LinkedHashMap::removeEldestEntry spec

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8, 11, 16
    • Fix Version/s: tbd
    • Component/s: core-libs

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Available in any OS and browser combinations.

      A DESCRIPTION OF THE PROBLEM :
      In the documentation [1], under Parameters: section, it says that "This is the entry that will be removed it this method returns true." It should be corrected as "This is the entry that will be removed if this method returns true."

      [1] https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html#removeEldestEntry-java.util.Map.Entry-

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just move to the LinkedHashMap, method removeEldestEntry in the documentation: https://docs.oracle.com/javase/8/docs/api/java/util/LinkedHashMap.html#removeEldestEntry-java.util.Map.Entry-

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Parameters:
      eldest - The least recently inserted entry in the map, or if this is an access-ordered map, the least recently accessed entry. This is the entry that will be removed if this method returns true. If the map was empty prior to the put or putAll invocation resulting in this invocation, this will be the entry that was just inserted; in other words, if the map contains a single entry, the eldest entry is also the newest.
      ACTUAL -
      Parameters:
      eldest - The least recently inserted entry in the map, or if this is an access-ordered map, the least recently accessed entry. This is the entry that will be removed it this method returns true. If the map was empty prior to the put or putAll invocation resulting in this invocation, this will be the entry that was just inserted; in other words, if the map contains a single entry, the eldest entry is also the newest.

      CUSTOMER SUBMITTED WORKAROUND :
      No workarounds, other than the end user recognizing it as a flaw and imagining the substitution which should be used.

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              smarks Stuart Marks
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: