commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell" <flame...@gmail.com>
Subject Re: [lang] After 2.2, what to add?
Date Tue, 01 Aug 2006 19:49:55 GMT
On 8/1/06, Miguel Farah <miguel.farah@gmail.com> wrote:
> On 8/1/06, Niall Pemberton <niall.pemberton@gmail.com> wrote:
> > On 8/1/06, Miguel Farah <miguel.farah@gmail.com> wrote:
> > > (I'm new here, so please be a little kind if I'm royally screwing up)
> >
> > Welcome :-)
>
> Thanks.
>
> >[...]
> > > I think I can contribute new methods for string manipulation and text
> > > formatting, but I need to know wether some of my utilities have been
> > > considered previously and turned down, for any reason. Is there some
> > > sort of log with this information?
> >
> > The best place to look is JIRA which we use for issue tracking:
> >
> >    http://issues.apache.org/jira/browse/LANG
> >[...]
>
> Great.
>
> I looked at everything, trimmed/pruned my stuff, and now I'm down to a
> few methods that haven't been done or proposed. I'll start with
> something simple:
>
> StringUtils has the repeat(String, int) method, which repeats a string
> the given number of times.
>
> 1) I propose adding repeatToLength(String, int), which repeats the
>    string enough times for the result to have exactly the given length.
>
>    StringUtils.repeatToLength("abc", 9)  == "abcabcabc"
>    StringUtils.repeatToLength("abc", 8)  == "abcabcab"
>
>    A second method, repeatToLengthFromTheRight(String, int) cuts the
>    possible excess at the beginning:
>
>    StringUtils.repeatToLengthFromTheRight("abc", 9)  == "abcabcabc"
>    StringUtils.repeatToLengthFromTheRight("abc", 8)  == "bcabcabc"

These seem like one-liners, using StringUtils.repeat and
StringUtils.trimToSize together (or something like that). ?

> 2) I propose adding repeat(char, int), which simply invokes
>    repeat(String.valueOf(char), int). This makes it easier on the
>    programmer, who doesn't have to do the conversion himself.

I can't see the harm in this one :) Easiest thing to do is to grab the
latest source code from svn, add your code and unit test and create
patches to put on a JIRA issue. Leave it without a fix-version, and it
can then be discussed for 2.3 or 3.0 inclusion.

Largely 3.0 inclusion means it has an API change, or it doesn't have
patch/unit-test :)

Hen

Hen

---------------------------------------------------------------------
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