RFR: JDK-8323760 putIfAbsent documentation conflicts with itself [v3]

John Hendrikx jhendrikx at openjdk.org
Wed Feb 14 20:46:17 UTC 2024


> Update the documentation for `@return` tag of `putIfAbsent` to match the main description. `putIfAbsent` uses the same wording as `put` for its `@return` tag, but that is incorrect.  `putIfAbsent` never returns the **previous** value, as the whole point of the method is not the replace the value if it was present.  As such, if it returns a value, it is the **current** value, and in all other cases it will return `null`.

John Hendrikx has updated the pull request incrementally with one additional commit since the last revision:

  Use new suggestion and remove original clarification

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/17438/files
  - new: https://git.openjdk.org/jdk/pull/17438/files/3621be54..8c91f058

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17438&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17438&range=01-02

  Stats: 5 lines in 1 file changed: 0 ins; 3 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/17438.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17438/head:pull/17438

PR: https://git.openjdk.org/jdk/pull/17438


More information about the core-libs-dev mailing list