-
CSR
-
Resolution: Approved
-
P5
-
None
-
behavioral
-
minimal
-
NaN were not rejected, however it's extremely unlikely that any application relied on this behavior.
-
Java API
-
Implementation
Summary
The constructors of CharsetDecoder and CharsetEncoder do not reject some invalid arguments values.
Problem
Specification states that the constructors of CharsetDecoder and CharsetEncoder only accept positive float numbers, and IllegalArgumentException is thrown for invalid values. However, NaN values are not rejected.
Solution
The implementation of the constructors of CharsetDecoder and CharsetEncoder will be updated, so that IllegalArgumentException will be thrown if one or both arguments are NaN.
- if (average$ItypesPerOtype$ <= 0.0f)
+ if (!(average$ItypesPerOtype$ > 0.0f))
throw new IllegalArgumentException("Non-positive "
+ "average$ItypesPerOtype$");
- if (max$ItypesPerOtype$ <= 0.0f)
+ if (!(max$ItypesPerOtype$ > 0.0f))
throw new IllegalArgumentException("Non-positive "
+ "max$ItypesPerOtype$");
Specification
Specification does not change.
- csr of
-
JDK-8210285 CharsetDecoder/Encoder's constructor does not reject NaN
-
- Closed
-