ICU-8854 Class defines or inherits equals() but not hashCode().

X-SVN-Rev: 30925
This commit is contained in:
Abhinav Gupta 2011-11-04 15:18:39 +00:00
parent f24d42939c
commit 049feaf0a2
12 changed files with 89 additions and 4 deletions

View file

@ -587,6 +587,11 @@ public final class CollationElementIterator
}
return false;
}
public int hashCode() {
assert false : "hashCode not designed";
return 42;
}
// package private constructors ------------------------------------------

View 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 -----------------------------------------------

View 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){

View 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 -----------------------------------------------

View 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
/**

View 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

View 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

View file

@ -311,6 +311,11 @@ final class NFRuleSet {
return true;
}
}
public int hashCode() {
assert false : "hashCode not designed";
return 42;
}
/**

View 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

View 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
*

View 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;

View 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.