Issue Details (XML | Word | Printable)

Key: CODEC-21
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Alex Karasulu
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Codec

[codec] Alterations to Binary.java and its unit test for 1.3 release

Created: 20/Mar/04 10:47 AM   Updated: 27/Oct/07 06:49 AM
Return to search
Component/s: None
Affects Version/s: 1.2
Fix Version/s: 1.3

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Binary-BitSet.patch 2004-03-21 09:36 AM Gary Gregory 4 kB
Text File BinaryTest-BitSet.patch 2004-03-21 09:36 AM Gary Gregory 17 kB
Java Archive File patch.jar 2004-03-20 10:49 AM Alex Karasulu 7 kB
Environment:
Operating System: other
Platform: All

Bugzilla Id: 27813


 Description  « Hide
  • BIT_n constants made private
  • Used BITS in for loop to make code shorter and cleaner
  • Added two new methods for encoding and decoding to BitSet
    curtesy of Vish Krishnan - sorry Vish I had to change some
    things on your contribs.
  • Made 100% test coverage as validated by clover


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alex Karasulu added a comment - 20/Mar/04 10:49 AM
Created an attachment (id=10882)
jar compressed file containing BinaryAndTest.patch

Gary Gregory added a comment - 21/Mar/04 09:19 AM
Patch partially applied and modified:

(1) The bitset methods and tests do not compile on <1.4. I've fixed that in
another patch attached to this ticket if/when we want to use it here.

(2) I did not include the bit set methods in this pass as they seem to be out of
context for this class but would like to discuss this. The Binary codec as is
today converts between byte arrays and "0/1" strings. If we want to convert to
and from BitSet objects, maybe this is another codec or a BitSetUtils class in
[lang]?

(3) All Java strings are Unicode, so the use of "ASCII" in comments and method
names is misleading IMO, especially when what is meant are "Strings of 0s and
1s" so I'd like to not use "Ascii" in method names. I'll try to address that on
commons-dev.

(4) I've also renamed the instance method "byte[] decode(Object)" to
"toByteArray" because the name "decode" was being overloaded but not overriden,
which to makes the class more confusing to understand IMHO considering the codec
interfaces Decoder, StringDecoder, and BinaryDecoder. I found this tricky since
Binary is NOT a StringDecoder but a BinaryDecoder. Using "decode" the method
look like a framework implementation method when it is not. This is all I
suppose a reflection on how truly useful these interfaces are in the first
place, a different topic I know.


Gary Gregory added a comment - 21/Mar/04 09:36 AM
Created an attachment (id=10885)
Patch to Binary v.1.8 for bit set methods.

Gary Gregory added a comment - 21/Mar/04 09:36 AM
Created an attachment (id=10886)
Patch to BinaryTest v.1.9 for BitSet methods.

Michael Heuer added a comment - 23/Mar/04 02:06 AM
Re: 2)

COM-1068 contains a BitSetUtils class submitted to [lang].


Gary Gregory added a comment - 14/Apr/04 04:00 AM
Set to FIXED. The class BinaryCodec seems ready for release.