From e13317152ddbbd09bcdcb17f703524180db39c51 Mon Sep 17 00:00:00 2001 From: Craig Cornelius Date: Wed, 28 Sep 2016 01:13:19 +0000 Subject: [PATCH] ICU-12716 Add hashCode to avoid compiler warnings X-SVN-Rev: 39372 --- .../src/com/ibm/icu/impl/coll/CollationIterator.java | 6 ++++++ .../collate/src/com/ibm/icu/text/Collator.java | 6 ++++++ .../core/src/com/ibm/icu/util/VersionInfo.java | 12 ++++++++++++ 3 files changed, 24 insertions(+) diff --git a/icu4j/main/classes/collate/src/com/ibm/icu/impl/coll/CollationIterator.java b/icu4j/main/classes/collate/src/com/ibm/icu/impl/coll/CollationIterator.java index e134b6faa4f..91051fee9a0 100644 --- a/icu4j/main/classes/collate/src/com/ibm/icu/impl/coll/CollationIterator.java +++ b/icu4j/main/classes/collate/src/com/ibm/icu/impl/coll/CollationIterator.java @@ -219,6 +219,12 @@ public abstract class CollationIterator { return true; } + @Override + public int hashCode() { + // Dummy return to prevent compile warnings. + return 0; + } + /** * Resets the iterator state and sets the position to the specified offset. * Subclasses must implement, and must call the parent class method, diff --git a/icu4j/main/classes/collate/src/com/ibm/icu/text/Collator.java b/icu4j/main/classes/collate/src/com/ibm/icu/text/Collator.java index 65826807531..286e1b28ec1 100644 --- a/icu4j/main/classes/collate/src/com/ibm/icu/text/Collator.java +++ b/icu4j/main/classes/collate/src/com/ibm/icu/text/Collator.java @@ -321,6 +321,12 @@ public abstract class Collator implements Comparator, Freezable return other == this; } + /** + * Returns the hash code value for this set. + * + * @return the hash code value for this set. + * @see java.lang.Object#hashCode() + * @stable ICU 2.0 + */ + @Override + public int hashCode() { + return m_version_; + } + /** * Compares other with this VersionInfo. * @param other VersionInfo to be compared -- 2.40.0