Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 3912 invoked from network); 21 Mar 2004 01:19:00 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 21 Mar 2004 01:19:00 -0000 Received: (qmail 39965 invoked by uid 500); 21 Mar 2004 01:18:42 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 39902 invoked by uid 500); 21 Mar 2004 01:18:41 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 39888 invoked by uid 500); 21 Mar 2004 01:18:41 -0000 Received: (qmail 39874 invoked from network); 21 Mar 2004 01:18:41 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 21 Mar 2004 01:18:41 -0000 Received: (qmail 3901 invoked by uid 1643); 21 Mar 2004 01:18:56 -0000 Date: 21 Mar 2004 01:18:56 -0000 Message-ID: <20040321011856.3900.qmail@minotaur.apache.org> From: ggregory@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/codec/src/test/org/apache/commons/codec/binary BinaryTest.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ggregory 2004/03/20 17:18:56 Modified: codec/src/java/org/apache/commons/codec/binary Binary.java codec/src/test/org/apache/commons/codec/binary BinaryTest.java Log: PR: Bugzilla Bug 27813 Alterations to Binary.java and its unit test for 1.3 release Submitted by: Alex Karasulu Reviewed by: Gary Gregory 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. Revision Changes Path 1.7 +94 -258 jakarta-commons/codec/src/java/org/apache/commons/codec/binary/Binary.java http://cvs.apache.org/viewcvs/jakarta-commons/codec/src/java/org/apache/commons/codec/binary/Binary.java.diff?r1=1.6&r2=1.7 1.7 +708 -630 jakarta-commons/codec/src/test/org/apache/commons/codec/binary/BinaryTest.java http://cvs.apache.org/viewcvs/jakarta-commons/codec/src/test/org/apache/commons/codec/binary/BinaryTest.java.diff?r1=1.6&r2=1.7 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org