When I try to set a bit in a place bigger than the BitArray size,
sometimes it does not raise an ArrayIndexOutOfBoundsException. It seems
that the problem is present when the BitArray size is not a multiple of
8. IMHO the exception should be raised in each wrong case.

Here you are the test code (you can find it in the trunk too):

    /**
     * Tests setBit(int,boolean) method
     * trying to set a bit out of bounds
     */
    public void testSetBit_OutOfBounds() {
        BitArray methodBitArray = new BitArray(10);
        try {
            methodBitArray.setBit(10,true);
            fail("Expected Exception Error Not Thrown!");}
        catch (ArrayIndexOutOfBoundsException anException) {
            assertNotNull(anException); }
    }

Thank you,

Sback


Reply via email to