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

        Enhancement JDK-8176894 inadvertently introduced erroneous behavior in the `TreeMap.computeIfAbsent` method. The other `TreeMap` methods that were modified by this enhancement are unaffected. The erroneous behavior is that, if the map contains an existing mapping whose value is null, the `computeIfAbsent` method immediately returns null. To conform with the specification, `computeIfAbsent` should instead call the mapping function and update 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: