]> granicus.if.org Git - icu/commitdiff
ICU-13177 Fixed a build problem (Java 7 java.util.Objects dependencies) a couple...
authorYoshito Umaoka <y.umaoka@gmail.com>
Thu, 28 Sep 2017 21:11:51 +0000 (21:11 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Thu, 28 Sep 2017 21:11:51 +0000 (21:11 +0000)
X-SVN-Rev: 40501

icu4j/main/classes/core/src/com/ibm/icu/impl/number/MacroProps.java
icu4j/main/classes/core/src/com/ibm/icu/number/LocalizedNumberFormatter.java

index f07b1782f39d901beb9cf14848223f27c22c1fe6..55f5a8fdd65f4c92d84255cda0d6afeec5c26adb 100644 (file)
@@ -2,8 +2,7 @@
 // License & terms of use: http://www.unicode.org/copyright.html#License
 package com.ibm.icu.impl.number;
 
-import java.util.Objects;
-
+import com.ibm.icu.impl.Utility;
 import com.ibm.icu.number.Grouper;
 import com.ibm.icu.number.IntegerWidth;
 import com.ibm.icu.number.Notation;
@@ -56,7 +55,7 @@ public class MacroProps implements Cloneable {
 
   @Override
   public int hashCode() {
-    return Objects.hash(
+    return Utility.hash(
         notation,
         unit,
         rounder,
@@ -76,20 +75,20 @@ public class MacroProps implements Cloneable {
   @Override
   public boolean equals(Object _other) {
     MacroProps other = (MacroProps) _other;
-    return Objects.equals(notation, other.notation)
-        && Objects.equals(unit, other.unit)
-        && Objects.equals(rounder, other.rounder)
-        && Objects.equals(grouper, other.grouper)
-        && Objects.equals(padder, other.padder)
-        && Objects.equals(integerWidth, other.integerWidth)
-        && Objects.equals(symbols, other.symbols)
-        && Objects.equals(unitWidth, other.unitWidth)
-        && Objects.equals(sign, other.sign)
-        && Objects.equals(decimal, other.decimal)
-        && Objects.equals(affixProvider, other.affixProvider)
-        && Objects.equals(multiplier, other.multiplier)
-        && Objects.equals(rules, other.rules)
-        && Objects.equals(loc, other.loc);
+    return Utility.equals(notation, other.notation)
+        && Utility.equals(unit, other.unit)
+        && Utility.equals(rounder, other.rounder)
+        && Utility.equals(grouper, other.grouper)
+        && Utility.equals(padder, other.padder)
+        && Utility.equals(integerWidth, other.integerWidth)
+        && Utility.equals(symbols, other.symbols)
+        && Utility.equals(unitWidth, other.unitWidth)
+        && Utility.equals(sign, other.sign)
+        && Utility.equals(decimal, other.decimal)
+        && Utility.equals(affixProvider, other.affixProvider)
+        && Utility.equals(multiplier, other.multiplier)
+        && Utility.equals(rules, other.rules)
+        && Utility.equals(loc, other.loc);
   }
 
   @Override
index 4ff6d406456e7f3d18819c214feae8bd6e5db3e3..3be9101fb25a90e80968a5bae2929ca2d023410d 100644 (file)
@@ -3,9 +3,9 @@
 package com.ibm.icu.number;
 
 import java.math.BigInteger;
-import java.util.Objects;
 import java.util.concurrent.atomic.AtomicLongFieldUpdater;
 
+import com.ibm.icu.impl.Utility;
 import com.ibm.icu.impl.number.DecimalQuantity;
 import com.ibm.icu.impl.number.DecimalQuantity_DualStorageBCD;
 import com.ibm.icu.impl.number.MacroProps;
@@ -101,13 +101,13 @@ public class LocalizedNumberFormatter extends NumberFormatterSettings<LocalizedN
         MeasureUnit unit = input.getUnit();
         Number number = input.getNumber();
         // Use this formatter if possible
-        if (Objects.equals(resolve().unit, unit)) {
+        if (Utility.equals(resolve().unit, unit)) {
             return format(number);
         }
         // This mechanism saves the previously used unit, so if the user calls this method with the
         // same unit multiple times in a row, they get a more efficient code path.
         LocalizedNumberFormatter withUnit = savedWithUnit;
-        if (withUnit == null || !Objects.equals(withUnit.resolve().unit, unit)) {
+        if (withUnit == null || !Utility.equals(withUnit.resolve().unit, unit)) {
             withUnit = new LocalizedNumberFormatter(this, KEY_UNIT, unit);
             savedWithUnit = withUnit;
         }