[
https://issues.apache.org/jira/browse/DERBY-2191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463156
]
Knut Anders Hatlen commented on DERBY-2191:
-------------------------------------------
Hi Dyre,
Thanks for writing the test and posting the issues!
Some comments/questions to the results from your test:
* I think some of the methods that have issues/bugs are not used
(seems to be the case for concatenate and two-arg constructor, at
least). Would it be better to remove the dead/broken code than to
fix it?
* Some of the issues/inconsistencies are caused by the handling of
(value == null). In the code coverage report, it seems like the code
paths for null handling are rarely (never?) exercised. Is it
possible to make (value != null) invariant (for instance by checking
in the constructor)? Then we could remove most of the null checks. I
think that would make the code cleaner (and it would increase the
code coverage percentage).
* I would expect and(), or() and xor() to handle arguments (null,
differing length, etc) the same way. Since FormatableBitSet is a
library class in the services.io package, I think it is strange if
its methods throw assert error for special cases or boundary
conditions. In my opinion, such asserts belong at a higher level
where one can tell from the context that it's a bad state.
* In addition to the issue you noticed, I think isSet() might hide
some errors because it catches ArrayIndexOutOfBoundsException and
returns false (in insane mode). Do you think it would be safe to
remove the try/catch? To me, it sounds more correct to propagate the
exception than to silently ignore it.
> 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