]> granicus.if.org Git - icu/commitdiff
ICU-8854 Class defines or inherits equals() but not hashCode().
authorAbhinav Gupta <mail@abhinavg.net>
Fri, 4 Nov 2011 15:18:39 +0000 (15:18 +0000)
committerAbhinav Gupta <mail@abhinavg.net>
Fri, 4 Nov 2011 15:18:39 +0000 (15:18 +0000)
X-SVN-Rev: 30925

12 files changed:
icu4j/main/classes/collate/src/com/ibm/icu/text/CollationElementIterator.java
icu4j/main/classes/core/src/com/ibm/icu/impl/CharTrie.java
icu4j/main/classes/core/src/com/ibm/icu/impl/ICUResourceBundle.java
icu4j/main/classes/core/src/com/ibm/icu/impl/IntTrie.java
icu4j/main/classes/core/src/com/ibm/icu/impl/Trie.java
icu4j/main/classes/core/src/com/ibm/icu/text/CurrencyPluralInfo.java
icu4j/main/classes/core/src/com/ibm/icu/text/NFRule.java
icu4j/main/classes/core/src/com/ibm/icu/text/NFRuleSet.java
icu4j/main/classes/core/src/com/ibm/icu/text/NFSubstitution.java
icu4j/main/classes/core/src/com/ibm/icu/text/StringPrepParseException.java
icu4j/main/classes/core/src/com/ibm/icu/util/StringTrieBuilder.java
icu4j/main/classes/translit/src/com/ibm/icu/text/Transliterator.java

index 2ef8cb77fdba2afa9ccb9f5ebc23f65f9e7125f7..230f4b43912108df21c831f92c9cc9a44f47536a 100644 (file)
@@ -587,6 +587,11 @@ public final class CollationElementIterator
         }
         return false;
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
 
     // package private constructors ------------------------------------------
 
index 4d4fb5af09aa020e3b39d031e23555398280d13e..032073a857adc1123e47c08ae9cd1f07901b2643 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.                                               *
 ******************************************************************************
 */
@@ -226,6 +226,11 @@ public class CharTrie extends Trie
         }
         return false;
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
     ///CLOVER:ON
 
     // protected methods -----------------------------------------------
index 6eac30862ae03d35180622eb558068db65ae1480..4440faeb4c320bb99b5937f7ef4843b82923d8bc 100644 (file)
@@ -815,6 +815,12 @@ public  class ICUResourceBundle extends UResourceBundle {
         }
         return false;
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
+    
     // This method is for super class's instantiateBundle method
     public static UResourceBundle getBundleInstance(String baseName, String localeID,
                                                     ClassLoader root, boolean disableFallback){
index edcf19e7364bce242f51c4ed12d30a2751f092a1..3b2ecfad5722c0edf2f502b20d92a0340a76dc9c 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.                                               *
 ******************************************************************************
 */
@@ -232,6 +232,11 @@ public class IntTrie extends Trie
         }
         return false;
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
     ///CLOVER:ON
     
     // protected methods -----------------------------------------------
index 65475eb657ad5aa5e8f45577e72ac1f0e7bbde6d..dc49ac4840e2bfbdf158ec53256484fed9cbaa98 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.                                               *
 ******************************************************************************
 */
@@ -108,6 +108,11 @@ public abstract class Trie
                && m_dataLength_ == othertrie.m_dataLength_
                && Arrays.equals(m_index_, othertrie.m_index_);
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
     ///CLOVER:ON
     
     /**
index 6586190800e8baf1f8d509bea65fd61c12eb091c..d92753d0436e65e728dbc3f4286062242651f7fd 100644 (file)
@@ -218,6 +218,11 @@ public class CurrencyPluralInfo implements Cloneable, Serializable {
         }
         return false;
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
 
     /**
      * Given a number, returns the keyword of the first rule that applies
index 027db7920afa718516d031ae01fbdfc0bd0f157a..d177adbd899a0eb86fa3a3fed37c48c676313928 100644 (file)
@@ -549,6 +549,11 @@ final class NFRule {
         }
         return false;
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
 
     /**
      * Returns a textual representation of the rule.  This won't
index 52b282144a0db6d8277db0e2b64fc3ca15f417f4..2d9e9ca056b956965da14770a9c49a2cd916b47e 100644 (file)
@@ -311,6 +311,11 @@ final class NFRuleSet {
             return true;
         }
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
 
 
     /**
index 311cb85a0995f7c00159939c2778924df36f9fb8..b5b39dc2731db6e0187651b0992ac7a5a06fe024 100644 (file)
@@ -269,6 +269,11 @@ abstract class NFSubstitution {
         }
         return false;
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
 
     /**
      * Returns a textual description of the substitution
@@ -715,6 +720,11 @@ class MultiplierSubstitution extends NFSubstitution {
             return false;
         }
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
 
     //-----------------------------------------------------------------------
     // formatting
@@ -890,6 +900,11 @@ class ModulusSubstitution extends NFSubstitution {
             return false;
         }
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
 
     //-----------------------------------------------------------------------
     // formatting
@@ -1566,6 +1581,11 @@ class NumeratorSubstitution extends NFSubstitution {
             return false;
         }
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
 
     //-----------------------------------------------------------------------
     // formatting
@@ -1770,6 +1790,11 @@ class NullSubstitution extends NFSubstitution {
     public boolean equals(Object that) {
         return super.equals(that);
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
 
     /**
      * NullSubstitutions don't show up in the textual representation
index c627472111adb9827e75c80a752aeece6a7a9e12..2c801a47d9887ffca3147313226a70b63b2bd60d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 2003-2010, International Business Machines Corporation and    *
+ * Copyright (C) 2003-2011, International Business Machines Corporation and    *
  * others. All Rights Reserved.                                                *
  *******************************************************************************
  */
@@ -136,6 +136,12 @@ public class StringPrepParseException extends ParseException {
         return ((StringPrepParseException)other).error == this.error;
         
     }
+    
+    public int hashCode() {
+        assert false : "hashCode not designed";
+        return 42;
+    }
+    
     /**
      * Returns the position of error in the rules string
      * 
index e6955d4ba9c20e52150f352516910763f991d8a9..6cbfd4af8f122a358aa7ebc72e07dabab0203dc8 100644 (file)
@@ -622,6 +622,10 @@ public abstract class StringTrieBuilder {
             return true;
         }
         @Override
+        public int hashCode() {
+            return super.hashCode();
+        }
+        @Override
         public int markRightEdgesFirst(int edgeNumber) {
             if(offset==0) {
                 firstEdgeNumber=edgeNumber;
@@ -728,6 +732,10 @@ public abstract class StringTrieBuilder {
             return unit==o.unit && lessThan==o.lessThan && greaterOrEqual==o.greaterOrEqual;
         }
         @Override
+        public int hashCode() {
+            return super.hashCode();
+        }
+        @Override
         public int markRightEdgesFirst(int edgeNumber) {
             if(offset==0) {
                 firstEdgeNumber=edgeNumber;
index 9e424d20feb43bbfd90b4b4b0516433be2e05f3b..74a6edcb7b64eafd76e76fe6f9b11cb16f1a2877 100644 (file)
@@ -369,6 +369,11 @@ public abstract class Transliterator implements StringTransform  {
             }
             return false;
         }
+        
+        public int hashCode() {
+            assert false : "hashCode not designed";
+            return 42;
+        }
 
         /**
          * Returns a string representation of this Position.