Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P4
-
Resolution: Duplicate
-
Affects Version/s: 1.1.4
-
Fix Version/s: None
-
Component/s: core-libs
-
Subcomponent:
-
CPU:sparc
-
OS:solaris_2.5
Description
Name: mgC56079 Date: 09/02/97
The java.text.NumberFormat.setMaximumIntegerDigits(int newValue),
java.text.NumberFormat.setMinimumIntegerDigits(int newValue),
java.text.NumberFormat.setMaximumFractionDigits(int newValue),
java.text.NumberFormat.setMinimumFractionDigits(int newValue)
methods convert input parameter to byte.
Here is the source of the setMaximumIntegerDigits() method:
/**
* Sets the maximum number of digits allowed in the integer portion of a
* number. maximumIntegerDigits must be >= minimumIntegerDigits. If the
* new value for maximumIntegerDigits is less than the current value
* of minimumIntegerDigits, then minimumIntegerDigits will also be set to
* the new value.
* @see #getMaximumIntegerDigits
*/
public void setMaximumIntegerDigits(int newValue) {
maxIntegerDigits = (byte) Math.max(0,Math.min(newValue,127));
if (minIntegerDigits > maxIntegerDigits)
minIntegerDigits = maxIntegerDigits;
}
All specs are silent about this.
======================================================================
brian.beck@Eng 1997-10-25
To put it another way, these methods limit the maxima and minima to the range
0-127 without documenting it. Is this an intentional limit that should be documented in the spec or is it an artifact of the implementation that should be removed?
=======================================================================
Attachments
Issue Links
- duplicates
-
JDK-4068058 setMaximumFractionDigits limit wrong
-
- Closed
-