harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r548495 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/util/BitSet.java test/api/common/tests/api/java/util/BitSetTest.java
Date Mon, 18 Jun 2007 21:45:37 GMT
Author: tellison
Date: Mon Jun 18 14:45:36 2007
New Revision: 548495

URL: http://svn.apache.org/viewvc?view=rev&rev=548495
Log:
Apply patch HARMONY-4213 ([classlib][luni] Jetty scenario fails due to bug in java.util.BitSet)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/BitSet.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/BitSetTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/BitSet.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/BitSet.java?view=diff&rev=548495&r1=548494&r2=548495
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/BitSet.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/BitSet.java Mon Jun
18 14:45:36 2007
@@ -695,7 +695,10 @@
         for (int i = 0; i < range; i++) {
             bits[i] &= ~bsBits[i];
         }
-        actualArrayLength = range;
+
+        if (actualArrayLength < range) {
+            actualArrayLength = range;
+        }
         isLengthActual = !((actualArrayLength > 0) && (bits[actualArrayLength
- 1] == 0));
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/BitSetTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/BitSetTest.java?view=diff&rev=548495&r1=548494&r2=548495
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/BitSetTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/util/BitSetTest.java
Mon Jun 18 14:45:36 2007
@@ -1041,6 +1041,14 @@
         } catch (NullPointerException e) {
             // expected
         }
+
+        // Regression test for HARMONY-4213
+        bs = new BitSet(256);
+        bs2 = new BitSet(256);
+        bs.set(97);
+        bs2.set(37);
+        bs.andNot(bs2);
+        assertTrue("Incorrect value at 97 pos", bs.get(97));
     }
 
     /**



Mime
View raw message