]> granicus.if.org Git - icu/commitdiff
ICU-8710 Fix Eclipse Java compiler warnings relevant to ICU4J 4.8.1
authorYoshito Umaoka <y.umaoka@gmail.com>
Thu, 14 Jul 2011 22:35:58 +0000 (22:35 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Thu, 14 Jul 2011 22:35:58 +0000 (22:35 +0000)
X-SVN-Rev: 30358

icu4j/main/classes/core/src/com/ibm/icu/lang/UCharacterNameIterator.java
icu4j/main/classes/core/src/com/ibm/icu/text/CharsetRecog_mbcs.java
icu4j/main/classes/core/src/com/ibm/icu/text/NFSubstitution.java
icu4j/main/classes/core/src/com/ibm/icu/text/SpoofChecker.java
icu4j/main/classes/core/src/com/ibm/icu/text/TimeZoneFormat.java
icu4j/main/classes/translit/src/com/ibm/icu/text/UnescapeTransliterator.java
icu4j/main/tests/charset/src/com/ibm/icu/dev/test/charset/TestCharset.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatMiscTests.java
icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UnicodeSetStringSpanTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/translit/TransliteratorTest.java
icu4j/main/tests/translit/src/com/ibm/icu/dev/test/util/BagFormatter.java

index efcb01bce70893df57476e7c8e3820cf2ed10068..9a8d3ad3623fe40de22237781d233f1364f76e7f 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ******************************************************************************
-* Copyright (C) 1996-2010, International Business Machines Corporation and   *
+* Copyright (C) 1996-2011, International Business Machines Corporation and   *
 * others. All Rights Reserved.                                               *
 ******************************************************************************
 */
@@ -30,7 +30,7 @@ class UCharacterNameIterator implements ValueIterator
     * be updated.</p>
     * @param element for storing the result codepoint and name
     * @return true if we are not at the end of the iteration, false otherwise.
-    * @see ValueIterator.Element
+    * @see com.ibm.icu.util.ValueIterator.Element
     */
     public boolean next(ValueIterator.Element element)
     {
index 0c506290ec59d07ae70c7ddfcb6c5f49ced45095..2b648b6dd679b7e1ecd09210ddd60090ac0df5c3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  ****************************************************************************
- * Copyright (C) 2005-2010, International Business Machines Corporation and *
+ * Copyright (C) 2005-2011, International Business Machines Corporation and *
  * others. All Rights Reserved.                                             *
  ****************************************************************************
  *
@@ -43,7 +43,8 @@ abstract class CharsetRecog_mbcs extends CharsetRecognizer {
      *             bits 8-15: The match reason, an enum-like value.
      */
     int match(CharsetDetector det, int [] commonChars) {
-        int   singleByteCharCount = 0;
+        @SuppressWarnings("unused")
+        int   singleByteCharCount = 0;  //TODO Do we really need this?
         int   doubleByteCharCount = 0;
         int   commonCharCount     = 0;
         int   badCharCount        = 0;
index ca9a4973b4741c884acc954d8ab2e4b4b5965652..9f849abbd8503465fbcb397e5a6d775dfc13cfbd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 1996-2010, International Business Machines Corporation and    *
+ * Copyright (C) 1996-2011, International Business Machines Corporation and    *
  * others. All Rights Reserved.                                                *
  *******************************************************************************
  */
@@ -1681,10 +1681,8 @@ class NumeratorSubstitution extends NFSubstitution {
             // compute the 'effective' base and prescale the value down
             long n = result.longValue();
             long d = 1;
-            int pow = 0;
             while (d <= n) {
                 d *= 10;
-                ++pow;
             }
             // now add the zeros
             while (zeroCount > 0) {
index 82aa32b8bac2ce14134062cce1de24706367dd5e..5dd6902d705e633afa0d377e83939cd7921af901 100644 (file)
@@ -680,7 +680,7 @@ public class SpoofChecker {
                 //
                 // printf("Number of scriptSets: %d\n", scriptSets.size());
                 {
-                    int duplicateCount = 0;
+                    //int duplicateCount = 0;
                     rtScriptSetsCount = 2;
                     for (int outeri = 2; outeri < scriptSets.size(); outeri++) {
                         BuilderScriptSet outerSet = scriptSets.elementAt(outeri);
@@ -697,7 +697,7 @@ public class SpoofChecker {
                                 innerSet.sset = outerSet.sset;
                                 innerSet.index = outeri;
                                 innerSet.rindex = outerSet.rindex;
-                                duplicateCount++;
+                                //duplicateCount++;
                             }
                             // But this doesn't get all. We need to fix the TRIE.
                         }
index 45682e1fc8d4616a1c581b0e47815c98d3d37362..4042aced1f19079a8fe2263aeaa15a4def8be67a 100644 (file)
@@ -835,8 +835,6 @@ public class TimeZoneFormat extends UFormat implements Freezable<TimeZoneFormat>
             return 0;
         }
 
-        int len = 0;
-
         int sign;
         char signChar = text.charAt(start);
         if (signChar == '+') {
@@ -848,8 +846,6 @@ public class TimeZoneFormat extends UFormat implements Freezable<TimeZoneFormat>
             pos.setErrorIndex(start);
             return 0;
         }
-        len++;
-
         // Parse digits
         // Possible format (excluding sign char) are:
         // HHmmss
index dc573cb612586d76c40c864369bb7efd864a6b31..e91f9437103763e71848d92774307a528d086b05 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (c) 2001-2010, International Business Machines
+*   Copyright (c) 2001-2011, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
@@ -139,14 +139,14 @@ class UnescapeTransliterator extends Transliterator {
                                        Position pos, boolean isIncremental) {
         int start = pos.start;
         int limit = pos.limit;
-        int i, j, ipat;
+        int i, ipat;
 
       loop:
         while (start < limit) {
             // Loop over the forms in spec[].  Exit this loop when we
             // match one of the specs.  Exit the outer loop if a
             // partial match is detected and isIncremental is true.
-            for (j=0, ipat=0; spec[ipat] != END; ++j) {
+            for (ipat = 0; spec[ipat] != END;) {
 
                 // Read the header
                 int prefixLen = spec[ipat++];
index a0388b79bea4e9ce6dc39c0c34fb2c60ceb4a7be..200b355bebbdb667d07a8b394b91d2a3deee6cd6 100644 (file)
@@ -68,10 +68,6 @@ public class TestCharset extends TestFmwk {
     
     protected void init(){
         try{
-            if ("UTF-16".equals(m_encoding)) {
-                int x = 2;
-                x++;
-            }
             CharsetProviderICU provider = new CharsetProviderICU();
             //Charset charset = CharsetICU.forName(encoding);
             m_charset = provider.charsetForName(m_encoding);
index 0078403624a7591a86b26676643f4fa53234211b..75b5116de7837ee02069fff0db59f4263755f9b0 100644 (file)
@@ -123,8 +123,8 @@ public class DateFormatMiscTests extends com.ibm.icu.dev.test.TestFmwk {
         final String ad = "\u897f\u66a6";
         final String jstLong = "\u65e5\u672c\u6a19\u6e96\u6642";
         final String jdtLong = "\u65e5\u672c\u590f\u6642\u9593";
-        final String jstShort = "JST";
-        final String jdtShort = "JDT";
+        final String jstShort = null; // "JST" is no longer available for locale en in CLDR 2.0.1+
+        final String jdtShort = null; // "JDT" is no longer available for locale en in CLDR 2.0.1+
         final String tzID = "Asia/Tokyo";
 
         DateFormatSymbols symbols = new DateFormatSymbols(Locale.JAPAN);
@@ -147,9 +147,9 @@ public class DateFormatMiscTests extends com.ibm.icu.dev.test.TestFmwk {
             errln("could not find " + tzID);
         } else {
             assertEquals("Long zone name = ", jstLong, zones[index][1]);
-//            assertEquals("Short zone name = ", jstShort, zones[index][2]);
+            assertEquals("Short zone name = ", jstShort, zones[index][2]);
             assertEquals("Long zone name (3) = ", jdtLong, zones[index][3]);
-//            assertEquals("Short zone name (4) = ", jdtShort, zones[index][4]);
+            assertEquals("Short zone name (4) = ", jdtShort, zones[index][4]);
         }
     }
 }
index 057b013998f153bce50fefd44b6ae85a8694de80..6d41a0fb5b87676d6eaaa4f65cdbc4df98563c5c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 2009-2010, International Business Machines Corporation and    *
+ * Copyright (C) 2009-2011, International Business Machines Corporation and    *
  * others. All Rights Reserved.                                                *
  *******************************************************************************
  */
@@ -1039,6 +1039,7 @@ public class UnicodeSetStringSpanTest extends TestFmwk {
         UnicodeSetWithStrings[] sets_with_str = new UnicodeSetWithStrings[SET_COUNT];
 
         String testName = null;
+        @SuppressWarnings("unused")
         String testNameLimit;
 
         for (i = 0; i < testdata.length; ++i) {
index bf59787607dc444a1df317acbca913a70e6a1434..84725d7065071ac5fd47fe21bebb917bf84955cd 100644 (file)
@@ -3184,6 +3184,7 @@ public class TransliteratorTest extends TestFmwk {
 
             String test = nfd.normalize("\u0104");
             boolean DEBUG = true;
+            @SuppressWarnings("unused")
             int count = 0; // for debugging
             for (String s : toTest) {
                 if (s.equals(test)) {
index 135c627a6ce506e18b1a16a359dfbf6087c1da1a..5a5d8e086b1fc531021f68f66eea497cf77f6007 100644 (file)
@@ -914,6 +914,7 @@ public class BagFormatter {
     // ===== CONVENIENCES =====
     private class Join extends Visitor {
         StringBuffer output = new StringBuffer();
+        @SuppressWarnings("unused")
         int depth = 0;
         String join (Object o) {
             output.setLength(0);