Index: main/classes/core/src/com/ibm/icu/impl/number/FormatQuantityBCD.java |
=================================================================== |
--- main/classes/core/src/com/ibm/icu/impl/number/FormatQuantityBCD.java (revision 40289) |
+++ main/classes/core/src/com/ibm/icu/impl/number/FormatQuantityBCD.java (working copy) |
@@ -134,17 +134,25 @@ |
} |
@Override |
- public void setIntegerFractionLength(int minInt, int maxInt, int minFrac, int maxFrac) { |
+ public void setIntegerLength(int minInt, int maxInt) { |
// Validation should happen outside of FormatQuantity, e.g., in the Rounder class. |
assert minInt >= 0; |
assert maxInt >= minInt; |
+ |
+ // Save values into internal state |
+ // Negation is safe for minFrac/maxFrac because -Integer.MAX_VALUE > Integer.MIN_VALUE |
+ lOptPos = maxInt; |
+ lReqPos = minInt; |
+ } |
+ |
+ @Override |
+ public void setFractionLength(int minFrac, int maxFrac) { |
+ // Validation should happen outside of FormatQuantity, e.g., in the Rounder class. |
assert minFrac >= 0; |
assert maxFrac >= minFrac; |
// Save values into internal state |
// Negation is safe for minFrac/maxFrac because -Integer.MAX_VALUE > Integer.MIN_VALUE |
- lOptPos = maxInt; |
- lReqPos = minInt; |
rReqPos = -minFrac; |
rOptPos = -maxFrac; |
} |
@@ -176,6 +184,9 @@ |
@Override |
public void multiplyBy(BigDecimal multiplicand) { |
+ if (isInfinite() || isZero() || isNaN()) { |
+ return; |
+ } |
BigDecimal temp = toBigDecimal(); |
temp = temp.multiply(multiplicand); |
setToBigDecimal(temp); |
@@ -510,6 +521,7 @@ |
* |
* @param n The value to consume. |
*/ |
+ @Override |
public void setToBigDecimal(BigDecimal n) { |
setBcdToZero(); |
flags = 0; |