]> granicus.if.org Git - icu/commitdiff
ICU-10084 Resolve Eclipse compiler warnings.
authorYoshito Umaoka <y.umaoka@gmail.com>
Tue, 9 Jul 2013 18:28:49 +0000 (18:28 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Tue, 9 Jul 2013 18:28:49 +0000 (18:28 +0000)
X-SVN-Rev: 33898

icu4j/main/classes/core/src/com/ibm/icu/text/CompactDecimalFormat.java
icu4j/main/classes/core/src/com/ibm/icu/text/ListFormatter.java
icu4j/main/classes/core/src/com/ibm/icu/text/PluralRules.java
icu4j/main/classes/core/src/com/ibm/icu/util/Currency.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/CalendarRegression.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatRegressionTest.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/PluralRulesTest.java

index 13a3a3ff8261f0fedc81c4365de3cfc3dd712636..1ff32828cbe1b95a964a56d80516fee665c1bad0 100644 (file)
@@ -54,7 +54,7 @@ public class CompactDecimalFormat extends DecimalFormat {
 
     private static final long serialVersionUID = 4716293295276629682L;
 
-    private static final int POSITIVE_PREFIX = 0, POSITIVE_SUFFIX = 1, AFFIX_SIZE = 2;
+//    private static final int POSITIVE_PREFIX = 0, POSITIVE_SUFFIX = 1, AFFIX_SIZE = 2;
     private static final CompactDecimalDataCache cache = new CompactDecimalDataCache();
 
     private final Map<String, DecimalFormat.Unit[]> units;
@@ -149,12 +149,14 @@ public class CompactDecimalFormat extends DecimalFormat {
      *            overridden by default.
      * @param formatSymbols
      *            Decimal format symbols, typically from a locale.
-     * @param prefix
-     *            An array of prefix values, one for each power of 10 from 0 to 14
-     * @param suffix
-     *            An array of prefix values, one for each power of 10 from 0 to 14
+     * @param style
+     *            compact style.
      * @param divisor
      *            An array of prefix values, one for each power of 10 from 0 to 14
+     * @param pluralAffixes
+     *            A map from plural categories to affixes.
+     * @param currencyAffixes
+     *            A map from plural categories to currency affixes. 
      * @param debugCreationErrors
      *            A collection of strings for debugging. If null on input, then any errors found will be added to that
      *            collection instead of throwing exceptions.
@@ -477,10 +479,10 @@ public class CompactDecimalFormat extends DecimalFormat {
 
     /**
      * Return the NumberInfo for the number, given this formatter's settings.
-     * @param number
-     * @return
+     * @param number The number.
+     * @return The NumberInfo for the given number.
      * @internal
-     * @deprecated
+     * @deprecated This API is ICU internal only.
      */
     public NumberInfo getNumberInfo(double number) {
         if (getMaximumFractionDigits() == 0 && !areSignificantDigitsUsed()) {
index ec9aecfa11f8b44791563d171135ff0b485f1d39..993838a662cb8711a58bfccb4686b7c4e1f3311f 100644 (file)
@@ -161,8 +161,8 @@ final public class ListFormatter {
     
     /**
      * Returns the locale of this object.
-     * @deprecated
      * @internal
+     * @deprecated This API is ICU internal only.
      */
     public ULocale getLocale() {
         return locale;
index 7840f3725438efbec27ac48a5400224b5662dcc2..addae1e165e5ef4c562a155d8176cbeaccc9c302 100644 (file)
@@ -220,7 +220,7 @@ public class PluralRules implements Serializable {
 
         /**
          * Utility for getting CARDINAL rules.
-         * @param locale
+         * @param locale the locale
          * @return plural rules.
          * @deprecated This API is ICU internal only.
          * @internal
@@ -1320,6 +1320,7 @@ public class PluralRules implements Serializable {
         return 37;
     }
 
+    @SuppressWarnings("unused")
     private boolean addConditional(Set<NumberInfo> toAddTo, Set<NumberInfo> others, double trial) {
         boolean added;
         NumberInfo toAdd = new NumberInfo(trial);
@@ -1444,10 +1445,10 @@ public class PluralRules implements Serializable {
 
     
     /**
-     * Given a number, returns the keyword of the first rule that applies to
+     * Given a number information, returns the keyword of the first rule that applies to
      * the number.
      *
-     * @param number The number for which the rule has to be determined.
+     * @param sample The number information for which the rule has to be determined.
      * @return The keyword of the selected rule.
      * @internal
      * @deprecated This API is ICU internal only.
@@ -1970,14 +1971,12 @@ public class PluralRules implements Serializable {
                     throws IOException {
         throw new NotSerializableException();
     }
+
     private void readObject(ObjectInputStream in
             ) throws IOException, ClassNotFoundException {
         throw new NotSerializableException();
     }
-    private void readObjectNoData( 
-            ) throws ObjectStreamException {
-        throw new NotSerializableException();
-    }
+
     private Object writeReplace() throws ObjectStreamException {
         return new PluralRulesSerialProxy(toString());
     }
index a57976d718bd269f415b0e379546469a3879393c..38da761ffe029508c8629e646ed474ba626734fd 100644 (file)
@@ -711,11 +711,12 @@ public class Currency extends MeasureUnit implements Serializable {
             this.currencyString = currencyString;
         }
 
-        private String getISOCode() {
+        public String getISOCode() {
             return isoCode;
         }
 
-        private String getCurrencyString() {
+        @SuppressWarnings("unused")
+        public String getCurrencyString() {
             return currencyString;
         }
     }
index cb74cee8596fb418d4c4a3c09733ba1f3426dfa2..a87fe99bf9f9d336bc89957d28163af1d83b69b3 100644 (file)
@@ -2342,23 +2342,22 @@ public class CalendarRegression extends com.ibm.icu.dev.test.TestFmwk {
     public void TestT9968() {
         SimpleDateFormat sdf0 = new SimpleDateFormat("-MMMM");
         ParsePosition pos0 = new ParsePosition(0);
-        Date d0 = sdf0.parse("-September", pos0);
-        logln("sdf0: "+pos0.getErrorIndex() + "/" + pos0.getIndex());    
+        /* Date d0 = */ sdf0.parse("-September", pos0);
+        logln("sdf0: " + pos0.getErrorIndex() + "/" + pos0.getIndex());
         assertTrue("Fail: failed a good test", pos0.getErrorIndex() == -1);
 
         SimpleDateFormat sdf1 = new SimpleDateFormat("-MMMM");
         ParsePosition pos1 = new ParsePosition(0);
-        Date d1 = sdf1.parse("-????", pos1);
-        logln("sdf1: "+pos1.getErrorIndex() + "/" + pos1.getIndex());    
+        /* Date d1 = */ sdf1.parse("-????", pos1);
+        logln("sdf1: " + pos1.getErrorIndex() + "/" + pos1.getIndex());
         assertTrue("Fail: failed to detect bad parse", pos1.getErrorIndex() == 1);
 
         SimpleDateFormat sdf2 = new SimpleDateFormat("MMMM");
         ParsePosition pos2 = new ParsePosition(0);
-        Date d2 = sdf2.parse("????", pos2);
-        logln("sdf2: "+pos2.getErrorIndex() + "/" + pos2.getIndex());    
+        /* Date d2 = */ sdf2.parse("????", pos2);
+        logln("sdf2: " + pos2.getErrorIndex() + "/" + pos2.getIndex());
         assertTrue("Fail: failed to detect bad parse", pos2.getErrorIndex() == 0);
-        
-    }    
+    }
 }
 
 //eof
index 118e224d9f6625cedec2a26b9f55a38d38252a77..3e9f02cd06bbb85160dbe49ec4eec6ae0e6d2474 100644 (file)
@@ -1204,15 +1204,15 @@ public class DateFormatRegressionTest extends com.ibm.icu.dev.test.TestFmwk {
     
     public void TestT10110() {
         try {
-            SimpleDateFormat formatter = new SimpleDateFormat("Gy年M月d日E", new Locale("zh_Hans"));       
-            Object parsed = formatter.parseObject("610000");
+            SimpleDateFormat formatter = new SimpleDateFormat("Gy年M月d日E", new Locale("zh_Hans"));
+            /* Object parsed = */ formatter.parseObject("610000");
         }
         catch(ParseException pe) {
             return;
         }
         catch(Throwable t) {
-                errln("ParseException not thrown for bad pattern! exception was: " + t.getLocalizedMessage());
-                return;
+            errln("ParseException not thrown for bad pattern! exception was: " + t.getLocalizedMessage());
+            return;
         }
         errln("No exception thrown at all for bad pattern!");
     }
index d291c8d1c08a5315d8ba27e05bb93b3b1ab3f142..b6165fcdffcc196bb01001b2c49ae4f1a4a44526 100644 (file)
@@ -190,7 +190,6 @@ public class PluralRulesTest extends TestFmwk {
                 for (NumberInfo sample : samples) {
                     collisionTest.clear();
                     for (Entry<String, PluralRules> entry: keywordToRule.entrySet()) {
-                        String keyword = entry.getKey();
                         PluralRules rule = entry.getValue();
                         String foundKeyword = rule.select(sample);
                         if (foundKeyword.equals("other")) {
@@ -696,8 +695,9 @@ public class PluralRulesTest extends TestFmwk {
             logln(locale + "\tsize:\t" + size.value);
             max = Math.max(max, size.value);
             if (!assertEquals(locale + "\tPlural rules before and after serialization", item, item2)) {
+                // for debugging
                 PluralRules item3 = serializeAndDeserialize(item, size); 
-                item.equals(item2);
+                item.equals(item3);
             }
         }
         logln("max \tsize:\t" + max);