On 06/03/2010, Henri Yandell <flame...@gmail.com> wrote: > I find this a tricky one. > > When it's explicitly referring to the type, CharSequence seems fine, > but to change the text that is talking about what a method does to: > > "Work out a CharSequence's length" > > It feels very unwieldy. > > Do others find this weird, or is it just me?
That does look odd, but so does using String when the parameter is a CharSequence. Using "string" rather than "String" would be a bit better. How about "Works out the length of a string of characters" ? Still not ideal though. > > On Sat, Mar 6, 2010 at 2:28 PM, sebb <seb...@gmail.com> wrote: > > On 06/03/2010, ggreg...@apache.org <ggreg...@apache.org> wrote: > >> Author: ggregory > >> Date: Sat Mar 6 22:09:37 2010 > >> New Revision: 919859 > >> > >> URL: http://svn.apache.org/viewvc?rev=919859&view=rev > >> Log: > >> Change length(String) to length(CharSequence) > >> > >> Modified: > >> > commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java > >> > >> Modified: > commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java > >> URL: > http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java?rev=919859&r1=919858&r2=919859&view=diff > >> > ============================================================================== > >> --- > commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java > (original) > >> +++ > commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/StringUtils.java > Sat Mar 6 22:09:37 2010 > >> @@ -4614,7 +4614,7 @@ > >> * @return String length or <code>0</code> if the String is > <code>null</code>. > > > > s/String/CharSequence/g ? > > > >> * @since 2.4 > >> */ > >> - public static int length(String str) { > >> + public static int length(CharSequence str) { > >> return str == null ? 0 : str.length(); > >> } > > > > Perhaps the Javadoc needs changing too? > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > > For additional commands, e-mail: dev-h...@commons.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org