From 548ce8be4ab154b7d7f42ae8fe8552f9888021d0 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 16 Jun 2002 21:15:44 +0000 Subject: RuntimeException.java: Re-merge with Classpath. * java/lang/RuntimeException.java: Re-merge with Classpath. * java/util/ArrayList.java: Likewise. * java/util/Arrays.java: Likewise. * java/util/BitSet.java: Likewise. * java/util/Dictionary.java: Likewise. * java/util/IdentityHashMap.java: Likewise. * java/util/MissingResourceException.java: Likewise. * java/util/Observer.java: Likewise. * java/util/TooManyListenersException.java: Likewise. * java/util/zip/DataFormatException.java: Likewise. * java/util/zip/ZipException.java: Likewise. From-SVN: r54680 --- libjava/java/util/BitSet.java | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'libjava/java/util/BitSet.java') diff --git a/libjava/java/util/BitSet.java b/libjava/java/util/BitSet.java index 38a9be0..c56c0d1 100644 --- a/libjava/java/util/BitSet.java +++ b/libjava/java/util/BitSet.java @@ -398,22 +398,24 @@ public class BitSet implements Cloneable, Serializable * bit k is set in the BitSet (for non-negative values * of k) if and only if * - *
-   * ((k/64) < bits.length) && ((bits[k/64] & (1L << (bit % 64))) != 0)
-   * 
+ * ((k/64) < bits.length) + * && ((bits[k/64] & (1L << (bit % 64))) != 0) + * * * Then the following definition of the hashCode method * would be a correct implementation of the actual algorithm: * - *
-   * public int hashCode() {
-   *     long h = 1234;
-   *     for (int i = bits.length-1; i>=0; i--) {
-   *         h ^= bits[i] * (i + 1);
-   *     }
-   *     return (int)((h >> 32) ^ h);
-   * }
-   * 
+ * +
public int hashCode()
+{
+  long h = 1234;
+  for (int i = bits.length-1; i >= 0; i--)
+  {
+    h ^= bits[i] * (i + 1);
+  }
+
+  return (int)((h >> 32) ^ h);
+}
* * Note that the hash code values changes, if the set is changed. * @@ -526,10 +528,11 @@ public class BitSet implements Cloneable, Serializable * Returns the index of the next true bit, from the specified bit * (inclusive). If there is none, -1 is returned. You can iterate over * all true bits with this loop:
- *
-   * for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1))
-   *   { // operate on i here }
-   * 
+ * +
for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1))
+{
+  // operate on i here
+}
* * @param from the start location * @return the first true bit, or -1 -- cgit v1.1