commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <p...@steitz.com>
Subject Re: [lang] So, about that 2.0....
Date Tue, 29 Jul 2003 09:01:07 GMT
Stephen Colebourne wrote:
> From: "Phil Steitz" <phil@steitz.com>
> 
>>I did discover one
>>small wrinkle in the behavior of CharSetUtils.translate.  When the repl
>>string has positive length and the with string is "", an
>>ArrayOutOfBoundsException is thrown.  The patch does not change this,
>>just documents it.
> 
> 
> Sounds wrong to me. (Method should do nothing?)

Actually, I was expecting it to behave like delete in this case -- e.g.,

translate("hello", "el", "") = "ho", but it throws instead.

I agree that this (throwing ArrayOutOfBoundsException) is not the best 
behavior.  If we want to make a change, I would suggest adding a guard 
and throwing IllegalArgumentException (or something else?) whenever with 
or repl is "" or null, since the semantics are a bit flaky in these cases.

Alternatively, we could just make translate(*,*,"") = * for all * and 
document via examples.  Note that we now have

translate("hello", "", "x") = "hello" and
translate("hello", "", "") =  "hello".

Assuming that repl and with are supposed to behave like CharSets, then 
"" shouldn't be allowed. So my vote would be to add the guard and 
disallow these arguments.

Phil


>We should change this now.
> 
> Stephen
> 
> 
> 
> 
> 
>>>>Guess it depends on timelines etc.
>>>>
>>>>We can spend the rest of the week checking on these bits, and I can
>>>
> build
> 
>>>>an rc2 at the weekend for checking, or I can go ahead and build an rc2
>>>>tomorrow night and we can spend the week checking?
>>>>
>>>>Apart from Wednesday nights I'm pretty good for time and I've been
>>>
> staying
> 
>>>>out of the way from the recent changes so I'll have the mental energy to
>>>>update the release-notes etc. No matter what we decide, I'll start
>>>>updating the changelog/release-notes tomorrow night.
>>>>
>>>>Hen
>>>>
>>>>On Mon, 28 Jul 2003, Gary Gregory wrote:
>>>>
>>>>
>>>>
>>>>>If it were all up to me, I would go ahead and commit these changes if
>>>>
> they
> 
>>>>>are good-to-go since these really about bullet-proofing the release.
>>>>>
>>>>>Gary
>>>>>
>>>>>-----Original Message-----
>>>>>From: Phil Steitz [mailto:steitzp@yahoo.com]
>>>>>Sent: Monday, July 28, 2003 18:18
>>>>>To: Jakarta Commons Developers List
>>>>>Subject: Re: [lang] So, about that 2.0....
>>>>>
>>>>>
>>>>>--- Stephen Colebourne <scolebourne@btopenworld.com> wrote:
>>>>>
>>>>>
>>>>>>has anybody got anything outstanding?
>>>>>>
>>>>>>Stephen
>>>>>>
>>>>>
>>>>>I have been working on some additional/improved unit tests for
>>>>>StringEscapeUtils and CharSetUtils (I notice that there are no unit
>>>>
> tests
> 
>>>>>for
>>>>>CharSetUtils.translate and there is a small javadoc error in the
>>>>
> @throws
> 
>>>>>tag),
>>>>>but I have not found any anomolies.  I can wait to submit this stuff
>>>>
> until
> 
>>>>>after the release if you want to roll it now.
>>>>>
>>>>>Phil
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>>>>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>>>>>
>>>>>
>>>>>
>>>>>__________________________________
>>>>>Do you Yahoo!?
>>>>>Yahoo! SiteBuilder - Free, easy-to-use web site design software
>>>>>http://sitebuilder.yahoo.com
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>>
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message