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

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

Thank you for looking at the results :)

Some answers to your questions:

- Yes, I would prefer to remove code that isn't used. (Only caveat is that the 
two-arg constructor is really useful when writing tests. Particularly if you 
want to create a bitset that doesn't have a multiple of 8 number of bytes)

- Yes, I would prefer to have value!=null be an ivariant as well (Possible 
caveat; can you assign to value in the ctor used when doing de-serialization?)

- No, I don't like the way asserts are used either. Apart from what you mention 
it also makes it hard(er) to write tests that will work both in sane and insane 
mode.

- Yes, would prefer that isSet didn't catch ArrayIndexOutOfBoundsException, or 
always checked the validity of its arguments. If you want all access to invalid 
bit indices to be handled the same way, I think you will have to check the 
argument manually since you are not guaranteed that access to a bit index 
larger than the bitset's max index  will trigger an 
ArrayIndexOutOfBoundsException.

> 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

        

Reply via email to