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] CharSequenceUtils resurrection? [Was: Remaining work]
Date Fri, 18 Mar 2011 03:40:42 GMT
Yeah, I didn't stress the "will want a name change if made public"
enough in the comment higher up in the file. I wanted a style that
wasn't overlapping with the public StringUtils classes; that one is
sequenceToString more to keep in sync with the other methods than
because it's a good name.

It's a bad method anyway - calling .toString() is the one method that
is fine as a String will merely return itself.

Hen

On Thu, Mar 17, 2011 at 8:58 AM, Gary Gregory <garydgregory@gmail.com> wrote:
> Minor nit:
>
> String sequenceToString(CharSequence cs)
>
> should be:
>
> String toString(CharSequence cs)
>
> because the we do not need to add the method arg type to the method name. If
> we did, we should use:
>
> String charSequenceToString(CharSequence cs)
>
> which I do not like.
>
> Gary
>
> On Thu, Mar 17, 2011 at 3:08 AM, Henri Yandell <flamefew@gmail.com> wrote:
>>
>> On Tue, Mar 15, 2011 at 9:39 PM, Henri Yandell <flamefew@gmail.com> wrote:
>>
>> > 4) Stephen urged that we revisit StringUtils to see what else can move
>> > to CharSequence.
>> >
>> > 5) Stephen recommended that CharSequenceUtils move into StringUtils.
>> > This seems fair, CharSequenceUtils is never going to get a lot of
>> > methods unless we move half of StringUtils out and make it feel very
>> > odd. [DONE].
>>
>> So having done #5, and working on #4, I'm starting to come up with a
>> bunch of methods that might make sense on CharSequenceUtils.
>>
>> Basically it's a set of methods on java.lang.String that are being
>> implemented to support CharSequence. The first step is to check if the
>> CharSequence is a String; if so then optimize and use the
>> java.lang.String code. Otherwise use a basic implementation built on
>> top of the CharSequence API. They're currently living at the end of
>> the StringUtils class, but I'm leaning towards making them their own
>> class. CharSequenceUtils, or is there a better name?
>>
>> I'd also appreciate feedback on the current changes in case it's felt
>> I'm reaching too much to support CharSequence as an API; I'm 20 of 76
>> unique method names along :)
>>
>> Hen
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
>
> --
> Thank you,
> Gary
>
> http://garygregory.wordpress.com/
> http://garygregory.com/
> http://people.apache.org/~ggregory/
> http://twitter.com/GaryGregory
>

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


Mime
View raw message