From: "Phil Steitz" <[EMAIL PROTECTED]>
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
buildGuess it depends on timelines etc.
We can spend the rest of the week checking on these bits, and I can
stayingan 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
theyout 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
testsare good-to-go since these really about bullet-proofing the release.
Gary
-----Original Message----- From: Phil Steitz [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 18:18 To: Jakarta Commons Developers List Subject: Re: [lang] So, about that 2.0....
--- Stephen Colebourne <[EMAIL PROTECTED]> 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
@throwsfor CharSetUtils.translate and there is a small javadoc error in the
untiltag), but I have not found any anomolies. I can wait to submit this stuff
after the release if you want to roll it now.
Phil
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
__________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]