JDK-8255426 : Duplicate @throws docs in java.util.Map.replaceAll() method
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 8,11,15,16
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2020-10-25
  • Updated: 2022-07-06
  • Resolved: 2022-07-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE PROBLEM :
@throws NullPointerException if the specified function is null, or the specified replacement value is null, and this map does not permit null values
@throws NullPointerException if function or a replacement value is null, and this map does not permit null keys or values (optional)

In my opinion first one is more accurate.


FREQUENCY : always



Comments
The duplicate @throws tags have different contents but they should probably be merged.
13-05-2022

Additional Information from submitter: =========================== It seems that ClassCastException is also duplicated.
28-10-2020

This mention of "keys" is indeed confusing: "@throws NullPointerException if function or a replacement value is null, and this map does not permit null keys or values (optional)". java.util.Map.replaceAll does not accept keys, nor does it affect them in any way.
27-10-2020

The observation from JDK javadoc: https://docs.oracle.com/javase/8/docs/api/index.html https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#replaceAll(java.util.function.BiFunction) https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/Map.html#replaceAll(java.util.function.BiFunction) https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/Map.java#L688
27-10-2020