]> granicus.if.org Git - icu/commitdiff
ICU-13513 Minor formatting changes.
authorShane Carr <shane@unicode.org>
Thu, 18 Jan 2018 01:02:20 +0000 (01:02 +0000)
committerShane Carr <shane@unicode.org>
Thu, 18 Jan 2018 01:02:20 +0000 (01:02 +0000)
X-SVN-Rev: 40782

icu4j/main/classes/core/src/com/ibm/icu/number/NumberPropertyMapper.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/AffixUtilsTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/DecimalQuantityTest.java

index 4c082fc3debeecbf22eb3f79d447cbd5081ea23d..ff69c077fa3bd97e7b620b07d036f1f4600fc882 100644 (file)
@@ -60,7 +60,8 @@ final class NumberPropertyMapper {
      * @param symbols
      *            The symbols associated with the property bag.
      * @param exportedProperties
-     *            A property bag in which to store validated properties. Used by some DecimalFormat getters.
+     *            A property bag in which to store validated properties. Used by some DecimalFormat
+     *            getters.
      * @return A new MacroProps containing all of the information in the Properties.
      */
     public static MacroProps oldToNew(
index b7f3e9948675ca9bc52953769720b39f4f9ce314..4a3c6301e6d299f7d62d83d6e9134c00a78c702c 100644 (file)
@@ -209,27 +209,26 @@ public class AffixUtilsTest {
         assertEquals("Symbol provider into middle", "abcd123efg", sb.toString());
     }
 
-  @Test
-  public void testWithoutSymbolsOrIgnorables() {
-    String[][] cases = {
-        {"", ""},
-        {"-", ""},
-        {" ", ""},
-        {"'-'", "-"},
-        {" a + b ", "a  b"},
-        {"-a+b%c‰d¤e¤¤f¤¤¤g¤¤¤¤h¤¤¤¤¤i", "abcdefghi"},
-    };
+    @Test
+    public void testWithoutSymbolsOrIgnorables() {
+        String[][] cases = {
+                { "", "" },
+                { "-", "" },
+                { " ", "" },
+                { "'-'", "-" },
+                { " a + b ", "a  b" },
+                { "-a+b%c‰d¤e¤¤f¤¤¤g¤¤¤¤h¤¤¤¤¤i", "abcdefghi" }, };
 
-    UnicodeSet ignorables = new UnicodeSet("[:whitespace:]");
-    StringBuilder sb = new StringBuilder();
-    for (String[] cas : cases) {
-      String input = cas[0];
-      String expected = cas[1];
-      sb.setLength(0);
-      AffixUtils.trimSymbolsAndIgnorables(input, ignorables, sb);
-      assertEquals("Removing symbols from: " + input, expected, sb.toString());
+        UnicodeSet ignorables = new UnicodeSet("[:whitespace:]");
+        StringBuilder sb = new StringBuilder();
+        for (String[] cas : cases) {
+            String input = cas[0];
+            String expected = cas[1];
+            sb.setLength(0);
+            AffixUtils.trimSymbolsAndIgnorables(input, ignorables, sb);
+            assertEquals("Removing symbols from: " + input, expected, sb.toString());
+        }
     }
-  }
 
     private static String unescapeWithDefaults(String input) {
         NumberStringBuilder nsb = new NumberStringBuilder();
index 28c7f61a00750656844218c31e4114a0a93af05b..c8d22177b48fca460a22ce639a630ce70fd362c5 100644 (file)
@@ -496,36 +496,37 @@ public class DecimalQuantityTest extends TestFmwk {
         assertToStringAndHealth(fq, "<DecimalQuantity 5:2:-3:-6 long 98766E-2>");
     }
 
-  @Test
-  public void testFitsInLong() {
-      DecimalQuantity_DualStorageBCD quantity = new DecimalQuantity_DualStorageBCD();
-      quantity.setToInt(0);
-      assertTrue("Zero should fit", quantity.fitsInLong());
-      quantity.setToInt(42);
-      assertTrue("Small int should fit", quantity.fitsInLong());
-      quantity.setToDouble(0.1);
-      assertFalse("Fraction should not fit", quantity.fitsInLong());
-      quantity.setToDouble(42.1);
-      assertFalse("Fraction should not fit", quantity.fitsInLong());
-      quantity.setToLong(1000000);
-      assertTrue("Large low-precision int should fit", quantity.fitsInLong());
-      quantity.setToLong(1000000000000000000L);
-      assertTrue("10^19 should fit", quantity.fitsInLong());
-      quantity.setToLong(1234567890123456789L);
-      assertTrue("A number between 10^19 and max long should fit", quantity.fitsInLong());
-      quantity.setToLong(9223372026854775808L);
-      assertTrue("A number less than max long but with similar digits should fit", quantity.fitsInLong());
-      quantity.setToLong(9223372036854775806L);
-      assertTrue("One less than max long should fit", quantity.fitsInLong());
-      quantity.setToLong(9223372036854775807L);
-      assertTrue("Max long should fit", quantity.fitsInLong());
-      quantity.setToBigInteger(new BigInteger("9223372036854775808"));
-      assertFalse("One greater than max long long should not fit", quantity.fitsInLong());
-      quantity.setToBigInteger(new BigInteger("9223372046854775806"));
-      assertFalse("A number between max long and 10^20 should not fit", quantity.fitsInLong());
-      quantity.setToBigInteger(new BigInteger("10000000000000000000"));
-      assertFalse("10^20 should not fit", quantity.fitsInLong());
-  }
+    @Test
+    public void testFitsInLong() {
+        DecimalQuantity_DualStorageBCD quantity = new DecimalQuantity_DualStorageBCD();
+        quantity.setToInt(0);
+        assertTrue("Zero should fit", quantity.fitsInLong());
+        quantity.setToInt(42);
+        assertTrue("Small int should fit", quantity.fitsInLong());
+        quantity.setToDouble(0.1);
+        assertFalse("Fraction should not fit", quantity.fitsInLong());
+        quantity.setToDouble(42.1);
+        assertFalse("Fraction should not fit", quantity.fitsInLong());
+        quantity.setToLong(1000000);
+        assertTrue("Large low-precision int should fit", quantity.fitsInLong());
+        quantity.setToLong(1000000000000000000L);
+        assertTrue("10^19 should fit", quantity.fitsInLong());
+        quantity.setToLong(1234567890123456789L);
+        assertTrue("A number between 10^19 and max long should fit", quantity.fitsInLong());
+        quantity.setToLong(9223372026854775808L);
+        assertTrue("A number less than max long but with similar digits should fit",
+                quantity.fitsInLong());
+        quantity.setToLong(9223372036854775806L);
+        assertTrue("One less than max long should fit", quantity.fitsInLong());
+        quantity.setToLong(9223372036854775807L);
+        assertTrue("Max long should fit", quantity.fitsInLong());
+        quantity.setToBigInteger(new BigInteger("9223372036854775808"));
+        assertFalse("One greater than max long long should not fit", quantity.fitsInLong());
+        quantity.setToBigInteger(new BigInteger("9223372046854775806"));
+        assertFalse("A number between max long and 10^20 should not fit", quantity.fitsInLong());
+        quantity.setToBigInteger(new BigInteger("10000000000000000000"));
+        assertFalse("10^20 should not fit", quantity.fitsInLong());
+    }
 
     static void assertDoubleEquals(String message, double d1, double d2) {
         boolean equal = (Math.abs(d1 - d2) < 1e-6) || (Math.abs((d1 - d2) / d1) < 1e-6);