Slightly off topic question: why don't you use the existing
java.util.BitSet? This seems to work for me in Frost.
On 7/12/07, Sback <sback at sback.it> wrote:
> 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
>
> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
--
__________________________________________________
GnuPG key: (0x48DBFA8A)
Keyserver: pgpkeys.pca.dfn.de
Fingerprint:
477D F057 1BD4 1AE7 8A54 8679 6690 E2EC 48DB FA8A
__________________________________________________