> -Original Message-
> From: Stephen Colebourne [mailto:scolebou...@btopenworld.com]
> Sent: Sunday, March 14, 2010 06:44
> To: Commons Developers List
> Subject: Re: [lang] LANG-510
>
> I do fear that this discussion may be over-thinking. Most users will, I
>
ation for length()
and subSequence().
Thoughts?
Gary
-Original Message-
From: Jörg Schaible [mailto:joerg.schai...@gmx.de]
Sent: Sunday, March 07, 2010 05:54
To: dev@commons.apache.org
Subject: RE: [lang] LANG-510
Gary Gregory wrote:
When I replaced the current implementation of St
for length()
and subSequence().
Thoughts?
Gary
> -Original Message-
> From: Jörg Schaible [mailto:joerg.schai...@gmx.de]
> Sent: Sunday, March 07, 2010 05:54
> To: dev@commons.apache.org
> Subject: RE: [lang] LANG-510
>
> Gary Gregory wrote:
>
> > Whe
Well, sure, I was just hoping there was a way to make match input and output
types.
Gary
> -Original Message-
> From: Jörg Schaible [mailto:joerg.schai...@gmx.de]
> Sent: Sunday, March 07, 2010 05:54
> To: dev@commons.apache.org
> Subject: RE: [lang] LANG-510
>
&g
Gary Gregory wrote:
> When I replaced the current implementation of StringUtils.left(String,int)
> with:
>
> @SuppressWarnings("unchecked")
> public static T left(T cs, int len) {
> if (cs == null) {
> return null;
> }
> if (len < 0) {
> re
Here is another issue that I find confusing at first glance with Generics. I
redefined defaultIfEmpty in my sandbox as follows:
public static T defaultIfEmpty(T str, T
defaultStr) {
return StringUtils.isEmpty(str) ? defaultStr : str;
}
This is simple enough but I was surprised
Here is another low hanging fruit:
public static int length(CharSequence str) {
return str == null ? 0 : str.length();
}
I committed that one since it is trivial and matches the is*(CharSequence)
methods already there.
Gary
> -Original Message-
> From: Henri Yandell [m
To: Commons Developers List
> Subject: Re: [lang] LANG-510
>
> On Fri, Mar 5, 2010 at 9:32 AM, Henri Yandell wrote:
> > Thinking further on moving StringUtils to CharSequence, I'd like to
> > take the String left(String, int) method as an example. It depends on
> >
Paul Benedict wrote:
> On Fri, Mar 5, 2010 at 6:17 AM, Niall Pemberton
> wrote:
>> Hmmm - I expected/assumed it would return the same type.
>
> Type T means exactly that: one type. It wouldn't be type-safe if the
> types were changed between input and output.
?? There is no generic type anymor
On Fri, Mar 5, 2010 at 6:17 AM, Niall Pemberton
wrote:
> Hmmm - I expected/assumed it would return the same type.
Type T means exactly that: one type. It wouldn't be type-safe if the
types were changed between input and output.
On Fri, Mar 5, 2010 at 11:12 AM, Jörg Schaible wrote:
> Henri Yandell wrote at Freitag, 5. März 2010 10:32:
>
>> Thinking further on moving StringUtils to CharSequence, I'd like to
>> take the String left(String, int) method as an example. It depends on
>> substring(int, int), so is entirely possi
Henri Yandell wrote at Freitag, 5. März 2010 10:32:
> Thinking further on moving StringUtils to CharSequence, I'd like to
> take the String left(String, int) method as an example. It depends on
> substring(int, int), so is entirely possibly to move over to
> subSequence(int, int).
>
> Hypothetica
On Fri, Mar 5, 2010 at 9:32 AM, Henri Yandell wrote:
> Thinking further on moving StringUtils to CharSequence, I'd like to
> take the String left(String, int) method as an example. It depends on
> substring(int, int), so is entirely possibly to move over to
> subSequence(int, int).
>
> Hypothetica
13 matches
Mail list logo