Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8259622 TreeMap.computeIfAbsent deviates from spec
  3. JDK-8261476

Release Note: TreeMap.computeIfAbsent Mishandles Existing Entries Whose Values Are null

    XMLWordPrintable

    Details

      Backports

        Description

        A bug has been fixed in enhancement JDK-8176894 that inadvertently introduced erroneous behavior in the `TreeMap.computeIfAbsent` method. The erroneous behavior was that, if the map contained an existing mapping whose value was null, the `computeIfAbsent` method would immediately return null. Other `TreeMap` methods modified by the enhancement were unaffected. To conform with the specification, `computeIfAbsent` now calls the mapping function and updates the map with the function's result.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: