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

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

XMLWordPrintable

      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.

            cwayne Clifford Wayne (Inactive)
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: