[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] Patch: FYI: fix PR 23882
From: |
Tom Tromey |
Subject: |
[cp-patches] Patch: FYI: fix PR 23882 |
Date: |
16 Sep 2005 12:50:03 -0600 |
I'm checking this in.
This fixes PR 23882.
Tom
Index: ChangeLog
from Tom Tromey <address@hidden>
PR classpath/23882:
* java/text/StringCharacterIterator.java (StringCharacterIterator):
Javadoc fix.
(hashCode): New method.
* java/text/ParsePosition.java (hashCode): New method
Index: java/text/ParsePosition.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/text/ParsePosition.java,v
retrieving revision 1.8
diff -u -r1.8 ParsePosition.java
--- java/text/ParsePosition.java 2 Jul 2005 20:32:41 -0000 1.8
+++ java/text/ParsePosition.java 16 Sep 2005 18:54:19 -0000
@@ -136,6 +136,15 @@
ParsePosition other = (ParsePosition) obj;
return index == other.index && error_index == other.error_index;
}
+
+ /**
+ * Return the hash code for this object.
+ * @return the hash code
+ */
+ public int hashCode()
+ {
+ return index ^ error_index;
+ }
/**
* This method returns a <code>String</code> representation of this
Index: java/text/StringCharacterIterator.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/text/StringCharacterIterator.java,v
retrieving revision 1.11
diff -u -r1.11 StringCharacterIterator.java
--- java/text/StringCharacterIterator.java 18 Aug 2005 13:25:54 -0000
1.11
+++ java/text/StringCharacterIterator.java 16 Sep 2005 18:54:19 -0000
@@ -143,7 +143,7 @@
* an existing StringCharacterIterator and resets the beginning and
* ending index.
*
- * @param scci The StringCharacterIterator to copy the info from
+ * @param sci The StringCharacterIterator to copy the info from
* @param begin The beginning index of the range we are interested in.
* @param end The ending index of the range we are interested in.
*/
@@ -339,6 +339,16 @@
&& end == sci.end
&& index == sci.index
&& text.equals (sci.text));
+ }
+
+ /**
+ * Return the hash code for this object.
+ * @return the hash code
+ */
+ public int hashCode()
+ {
+ // Incorporate all the data in a goofy way.
+ return begin ^ end ^ index ^ text.hashCode();
}
/*************************************************************************/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] Patch: FYI: fix PR 23882,
Tom Tromey <=