You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by "Svetlana Samoilenko (JIRA)" <ji...@apache.org> on 2006/02/16 13:19:59 UTC

[jira] Created: (HARMONY-98) java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex

java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex
--------------------------------------------------------------------------------------------------------------------

         Key: HARMONY-98
         URL: http://issues.apache.org/jira/browse/HARMONY-98
     Project: Harmony
        Type: Bug
  Components: Classlib  
    Reporter: Svetlana Samoilenko


According to 1.4.2 and 1.5 specification java.util.BitSet.clear(int,int) throws IndexOutOfBoundsException - if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex.

Harmony throws IndexOutOfBoundsException if toIndex=fromIndex.

Code to reproduce: 
import java.util.BitSet; 
public class test2 { 
    public static void main(String[] args) { 
        BitSet set = new BitSet(); 
        for(int i=0; i < 20; i++) { 
            set.set(i); 
        } 
       set.clear(10,10); 
    } 
}
Steps to Reproduce: 
1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 
2. Compile test2.java using BEA 1.4 javac 
> javac -d . test2.java 
3. Run java using compatible VM (J9) 
> java -showversion test2

Output: 
C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 
java version "1.4.2_04" 
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) 
BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) 
PASSED

C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 
(c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. 
java.lang.IndexOutOfBoundsException: Negative index specified
        at java.util.BitSet.clear(BitSet.java:423)
        at test2.main(test2.java:16)

Suggested fix in attachment.

Suggested junit test case:
------------------------ BitSetTest.java ------------------------------------------------- 
import junit.framework.*; 
import java.util.BitSet; 
public class BitSetTest extends TestCase { 
    public static void main(String[] args) { 
        junit.textui.TestRunner.run(BitSetTest.class); 
    } 
    public void test_clear() { 
       BitSet set = new BitSet(); 
       for(int i=0; i < 20; i++) { 
           set.set(i); 
       } 
       set.clear(10,10); 
    } 
}



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-98) java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex

Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-98?page=all ]

Svetlana Samoilenko updated HARMONY-98:
---------------------------------------

    Attachment: fix.txt

> java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-98
>          URL: http://issues.apache.org/jira/browse/HARMONY-98
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>  Attachments: fix.txt
>
> According to 1.4.2 and 1.5 specification java.util.BitSet.clear(int,int) throws IndexOutOfBoundsException - if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex.
> Harmony throws IndexOutOfBoundsException if toIndex=fromIndex.
> Code to reproduce: 
> import java.util.BitSet; 
> public class test2 { 
>     public static void main(String[] args) { 
>         BitSet set = new BitSet(); 
>         for(int i=0; i < 20; i++) { 
>             set.set(i); 
>         } 
>        set.clear(10,10); 
>     } 
> }
> Steps to Reproduce: 
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 
> 2. Compile test2.java using BEA 1.4 javac 
> > javac -d . test2.java 
> 3. Run java using compatible VM (J9) 
> > java -showversion test2
> Output: 
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 
> java version "1.4.2_04" 
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) 
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) 
> PASSED
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. 
> java.lang.IndexOutOfBoundsException: Negative index specified
>         at java.util.BitSet.clear(BitSet.java:423)
>         at test2.main(test2.java:16)
> Suggested fix in attachment.
> Suggested junit test case:
> ------------------------ BitSetTest.java ------------------------------------------------- 
> import junit.framework.*; 
> import java.util.BitSet; 
> public class BitSetTest extends TestCase { 
>     public static void main(String[] args) { 
>         junit.textui.TestRunner.run(BitSetTest.class); 
>     } 
>     public void test_clear() { 
>        BitSet set = new BitSet(); 
>        for(int i=0; i < 20; i++) { 
>            set.set(i); 
>        } 
>        set.clear(10,10); 
>     } 
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (HARMONY-98) java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-98?page=all ]
     
Tim Ellison closed HARMONY-98:
------------------------------


Verified by Svetlana


> java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-98
>          URL: http://issues.apache.org/jira/browse/HARMONY-98
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>     Assignee: Tim Ellison
>  Attachments: fix.txt, fix_hrm-98.txt
>
> According to 1.4.2 and 1.5 specification java.util.BitSet.clear(int,int) throws IndexOutOfBoundsException - if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex.
> Harmony throws IndexOutOfBoundsException if toIndex=fromIndex.
> Code to reproduce: 
> import java.util.BitSet; 
> public class test2 { 
>     public static void main(String[] args) { 
>         BitSet set = new BitSet(); 
>         for(int i=0; i < 20; i++) { 
>             set.set(i); 
>         } 
>        set.clear(10,10); 
>     } 
> }
> Steps to Reproduce: 
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 
> 2. Compile test2.java using BEA 1.4 javac 
> > javac -d . test2.java 
> 3. Run java using compatible VM (J9) 
> > java -showversion test2
> Output: 
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 
> java version "1.4.2_04" 
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) 
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) 
> PASSED
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. 
> java.lang.IndexOutOfBoundsException: Negative index specified
>         at java.util.BitSet.clear(BitSet.java:423)
>         at test2.main(test2.java:16)
> Suggested fix in attachment.
> Suggested junit test case:
> ------------------------ BitSetTest.java ------------------------------------------------- 
> import junit.framework.*; 
> import java.util.BitSet; 
> public class BitSetTest extends TestCase { 
>     public static void main(String[] args) { 
>         junit.textui.TestRunner.run(BitSetTest.class); 
>     } 
>     public void test_clear() { 
>        BitSet set = new BitSet(); 
>        for(int i=0; i < 20; i++) { 
>            set.set(i); 
>        } 
>        set.clear(10,10); 
>     } 
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (HARMONY-98) java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-98?page=all ]
     
Tim Ellison resolved HARMONY-98:
--------------------------------

    Resolution: Fixed

Svetlana,

Fixed in LUNI module java.util.BitSet at repo revision 379184.

Please check that this fully resolves your problem.


> java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-98
>          URL: http://issues.apache.org/jira/browse/HARMONY-98
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>     Assignee: Tim Ellison
>  Attachments: fix.txt, fix_hrm-98.txt
>
> According to 1.4.2 and 1.5 specification java.util.BitSet.clear(int,int) throws IndexOutOfBoundsException - if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex.
> Harmony throws IndexOutOfBoundsException if toIndex=fromIndex.
> Code to reproduce: 
> import java.util.BitSet; 
> public class test2 { 
>     public static void main(String[] args) { 
>         BitSet set = new BitSet(); 
>         for(int i=0; i < 20; i++) { 
>             set.set(i); 
>         } 
>        set.clear(10,10); 
>     } 
> }
> Steps to Reproduce: 
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 
> 2. Compile test2.java using BEA 1.4 javac 
> > javac -d . test2.java 
> 3. Run java using compatible VM (J9) 
> > java -showversion test2
> Output: 
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 
> java version "1.4.2_04" 
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) 
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) 
> PASSED
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. 
> java.lang.IndexOutOfBoundsException: Negative index specified
>         at java.util.BitSet.clear(BitSet.java:423)
>         at test2.main(test2.java:16)
> Suggested fix in attachment.
> Suggested junit test case:
> ------------------------ BitSetTest.java ------------------------------------------------- 
> import junit.framework.*; 
> import java.util.BitSet; 
> public class BitSetTest extends TestCase { 
>     public static void main(String[] args) { 
>         junit.textui.TestRunner.run(BitSetTest.class); 
>     } 
>     public void test_clear() { 
>        BitSet set = new BitSet(); 
>        for(int i=0; i < 20; i++) { 
>            set.set(i); 
>        } 
>        set.clear(10,10); 
>     } 
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (HARMONY-98) java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-98?page=all ]

Tim Ellison reassigned HARMONY-98:
----------------------------------

    Assign To: Tim Ellison

> java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-98
>          URL: http://issues.apache.org/jira/browse/HARMONY-98
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>     Assignee: Tim Ellison
>  Attachments: fix.txt, fix_hrm-98.txt
>
> According to 1.4.2 and 1.5 specification java.util.BitSet.clear(int,int) throws IndexOutOfBoundsException - if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex.
> Harmony throws IndexOutOfBoundsException if toIndex=fromIndex.
> Code to reproduce: 
> import java.util.BitSet; 
> public class test2 { 
>     public static void main(String[] args) { 
>         BitSet set = new BitSet(); 
>         for(int i=0; i < 20; i++) { 
>             set.set(i); 
>         } 
>        set.clear(10,10); 
>     } 
> }
> Steps to Reproduce: 
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 
> 2. Compile test2.java using BEA 1.4 javac 
> > javac -d . test2.java 
> 3. Run java using compatible VM (J9) 
> > java -showversion test2
> Output: 
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 
> java version "1.4.2_04" 
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) 
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) 
> PASSED
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. 
> java.lang.IndexOutOfBoundsException: Negative index specified
>         at java.util.BitSet.clear(BitSet.java:423)
>         at test2.main(test2.java:16)
> Suggested fix in attachment.
> Suggested junit test case:
> ------------------------ BitSetTest.java ------------------------------------------------- 
> import junit.framework.*; 
> import java.util.BitSet; 
> public class BitSetTest extends TestCase { 
>     public static void main(String[] args) { 
>         junit.textui.TestRunner.run(BitSetTest.class); 
>     } 
>     public void test_clear() { 
>        BitSet set = new BitSet(); 
>        for(int i=0; i < 20; i++) { 
>            set.set(i); 
>        } 
>        set.clear(10,10); 
>     } 
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-98) java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-98?page=comments#action_12366640 ] 

Tim Ellison commented on HARMONY-98:
------------------------------------

looks like the wrong patch was attached -- this patch is == HARMONY-93


> java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-98
>          URL: http://issues.apache.org/jira/browse/HARMONY-98
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>  Attachments: fix.txt
>
> According to 1.4.2 and 1.5 specification java.util.BitSet.clear(int,int) throws IndexOutOfBoundsException - if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex.
> Harmony throws IndexOutOfBoundsException if toIndex=fromIndex.
> Code to reproduce: 
> import java.util.BitSet; 
> public class test2 { 
>     public static void main(String[] args) { 
>         BitSet set = new BitSet(); 
>         for(int i=0; i < 20; i++) { 
>             set.set(i); 
>         } 
>        set.clear(10,10); 
>     } 
> }
> Steps to Reproduce: 
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 
> 2. Compile test2.java using BEA 1.4 javac 
> > javac -d . test2.java 
> 3. Run java using compatible VM (J9) 
> > java -showversion test2
> Output: 
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 
> java version "1.4.2_04" 
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) 
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) 
> PASSED
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. 
> java.lang.IndexOutOfBoundsException: Negative index specified
>         at java.util.BitSet.clear(BitSet.java:423)
>         at test2.main(test2.java:16)
> Suggested fix in attachment.
> Suggested junit test case:
> ------------------------ BitSetTest.java ------------------------------------------------- 
> import junit.framework.*; 
> import java.util.BitSet; 
> public class BitSetTest extends TestCase { 
>     public static void main(String[] args) { 
>         junit.textui.TestRunner.run(BitSetTest.class); 
>     } 
>     public void test_clear() { 
>        BitSet set = new BitSet(); 
>        for(int i=0; i < 20; i++) { 
>            set.set(i); 
>        } 
>        set.clear(10,10); 
>     } 
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-98) java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex

Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-98?page=all ]

Svetlana Samoilenko updated HARMONY-98:
---------------------------------------

    Attachment: fix_hrm-98.txt

Tim, thank you for pointing my tipo out. Could you change fix.txt with fix_hrm-98.txt?

> java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-98
>          URL: http://issues.apache.org/jira/browse/HARMONY-98
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>  Attachments: fix.txt, fix_hrm-98.txt
>
> According to 1.4.2 and 1.5 specification java.util.BitSet.clear(int,int) throws IndexOutOfBoundsException - if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex.
> Harmony throws IndexOutOfBoundsException if toIndex=fromIndex.
> Code to reproduce: 
> import java.util.BitSet; 
> public class test2 { 
>     public static void main(String[] args) { 
>         BitSet set = new BitSet(); 
>         for(int i=0; i < 20; i++) { 
>             set.set(i); 
>         } 
>        set.clear(10,10); 
>     } 
> }
> Steps to Reproduce: 
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 
> 2. Compile test2.java using BEA 1.4 javac 
> > javac -d . test2.java 
> 3. Run java using compatible VM (J9) 
> > java -showversion test2
> Output: 
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 
> java version "1.4.2_04" 
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) 
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) 
> PASSED
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. 
> java.lang.IndexOutOfBoundsException: Negative index specified
>         at java.util.BitSet.clear(BitSet.java:423)
>         at test2.main(test2.java:16)
> Suggested fix in attachment.
> Suggested junit test case:
> ------------------------ BitSetTest.java ------------------------------------------------- 
> import junit.framework.*; 
> import java.util.BitSet; 
> public class BitSetTest extends TestCase { 
>     public static void main(String[] args) { 
>         junit.textui.TestRunner.run(BitSetTest.class); 
>     } 
>     public void test_clear() { 
>        BitSet set = new BitSet(); 
>        for(int i=0; i < 20; i++) { 
>            set.set(i); 
>        } 
>        set.clear(10,10); 
>     } 
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-98) java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex

Posted by "Svetlana Samoilenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-98?page=comments#action_12368879 ] 

Svetlana Samoilenko commented on HARMONY-98:
--------------------------------------------

Tim, thanks, 
all works fine with with latest sources.

> java.util.BitSet.clear(int toIndex,int fromIndex) throws unexpected IndexOutOfBoundsException when toIndex=fromIndex
> --------------------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-98
>          URL: http://issues.apache.org/jira/browse/HARMONY-98
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Svetlana Samoilenko
>     Assignee: Tim Ellison
>  Attachments: fix.txt, fix_hrm-98.txt
>
> According to 1.4.2 and 1.5 specification java.util.BitSet.clear(int,int) throws IndexOutOfBoundsException - if fromIndex is negative, or toIndex is negative, or fromIndex is larger than toIndex.
> Harmony throws IndexOutOfBoundsException if toIndex=fromIndex.
> Code to reproduce: 
> import java.util.BitSet; 
> public class test2 { 
>     public static void main(String[] args) { 
>         BitSet set = new BitSet(); 
>         for(int i=0; i < 20; i++) { 
>             set.set(i); 
>         } 
>        set.clear(10,10); 
>     } 
> }
> Steps to Reproduce: 
> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. 
> 2. Compile test2.java using BEA 1.4 javac 
> > javac -d . test2.java 
> 3. Run java using compatible VM (J9) 
> > java -showversion test2
> Output: 
> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 
> java version "1.4.2_04" 
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) 
> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) 
> PASSED
> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 
> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. 
> java.lang.IndexOutOfBoundsException: Negative index specified
>         at java.util.BitSet.clear(BitSet.java:423)
>         at test2.main(test2.java:16)
> Suggested fix in attachment.
> Suggested junit test case:
> ------------------------ BitSetTest.java ------------------------------------------------- 
> import junit.framework.*; 
> import java.util.BitSet; 
> public class BitSetTest extends TestCase { 
>     public static void main(String[] args) { 
>         junit.textui.TestRunner.run(BitSetTest.class); 
>     } 
>     public void test_clear() { 
>        BitSet set = new BitSet(); 
>        for(int i=0; i < 20; i++) { 
>            set.set(i); 
>        } 
>        set.clear(10,10); 
>     } 
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira