db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dyre Tjeldvoll (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2191) Cleanup of FormatableBitSet
Date Mon, 08 Jan 2007 13:52:28 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463039
] 

Dyre Tjeldvoll commented on DERBY-2191:
---------------------------------------

Here is a brief list of bugs/issues that was found while writing FormatableBitSetTest.java:

1) The two-arg constructor fails if given a size arg that is smaller than the size of the
byte array arg

2) When the copy constructor is used to copy an empty bitset with a null byte array, the resulting
copy has a non-null byte array

3) It is legal to call grow(int) with an arg that is smaller that the bitset's current size,
but the size of the bitset remains the same.

4) It is legal to call grow(int) with a negative argument, but the size of the bitset remains
the same.

5) Shrinking an empty bitset to size 0 causes an AssertFailure

6) It is legal to call shrink(int) with an arg that is larger that the bitset's current size,
but the size of the bitset remains the same.

7) Shrinking an ordinary  bitset to size 0 causes an AssertFailure

8) The return value of compare doesn't match what is stated in the javadoc for the method

9) The concatenate method does not work. Concatenation of two 18 bit bitsets yields a bitset
that is still 18 bits.

10) The method isSet(-1) gives an NPE for an empty bitset, but returns false for a non-empty
set.

11) The method set(-1) gives an NPE for an empty bitset, but does nothing for a non-empty
set.

12) The method clear(-1) gives an NPE for an empty bitset, but does nothing for a non-empty
set.

13) The method anySetBit() gives an NPE for an empty bitset, -1 would be more reasonable

14) The method anySetBit(-1) is equivalent to anySetBit(), but smaller args (-2, -3) do not
throw an exception, but also do not necessarily return the same value as -1

15) The method or(FormatableBitSet) accepts null as an argument and treats it as if it represents
an empty bitset. and(FormatableBitSet) will throw an AssertFailure, but xor(FormatableBitSet)
throws an NPE

16) The methods or(FormatableBitSet) and  and(FormatableBitSet) can be used with args that
are smaller or larger. xor() requires the arg to have the same size as "this"

17) readExternalFromArray does not appear to have a write counterpart. Using it on something
that is wtitten with writeExternal does not seem to work


> Cleanup of FormatableBitSet
> ---------------------------
>
>                 Key: DERBY-2191
>                 URL: https://issues.apache.org/jira/browse/DERBY-2191
>             Project: Derby
>          Issue Type: Improvement
>          Components: Miscellaneous
>    Affects Versions: 10.2.1.6
>            Reporter: Dyre Tjeldvoll
>         Assigned To: Dyre Tjeldvoll
>            Priority: Trivial
>             Fix For: 10.3.0.0
>
>         Attachments: deadcode.v1.diff, deadcode.v2.diff, FormatableBitSetTest.java
>
>
> The implementation of FormatableBitSet could be streamlined. Dead code can be removed
and the implementation of some methods can be simplified.

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

        

Mime
View raw message