[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    Re: svn commit: r159551 - jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringU
From:       Stephen Colebourne <scolebourne () btopenworld ! com>
Date:       2005-03-31 22:49:05
Message-ID: 424C7E61.2080108 () btopenworld ! com
[Download RAW message or body]

For the record, this is my preferred style for calculated return 
statements. I'm not going to -1 the change, but I do view it as a 
stylistic choice that isn't wrong.

Stephen

ggregory@apache.org wrote:
> Author: ggregory
> Date: Wed Mar 30 16:56:20 2005
> New Revision: 159551
> 
> URL: http://svn.apache.org/viewcvs?view=rev&rev=159551
> Log:
> Removed extra C style parens in return statements.
> 
> Modified:
> jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java
> 
> Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java
>                 
> URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java?view=diff&r1=159550&r2=159551
>  ==============================================================================
> --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java \
>                 (original)
> +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java \
> Wed Mar 30 16:56:20 2005 @@ -192,7 +192,7 @@
> * @return <code>true</code> if the String is empty or null
> */
> public static boolean isEmpty(String str) {
> -        return (str == null || str.length() == 0);
> +        return str == null || str.length() == 0;
> }
> 
> /**
> @@ -210,7 +210,7 @@
> * @return <code>true</code> if the String is not empty and not null
> */
> public static boolean isNotEmpty(String str) {
> -        return (str != null && str.length() > 0);
> +        return str != null && str.length() > 0;
> }
> 
> /**
> @@ -292,7 +292,7 @@
> *             Method will be removed in Commons Lang 3.0.
> */
> public static String clean(String str) {
> -        return (str == null ? EMPTY : str.trim());
> +        return str == null ? EMPTY : str.trim();
> }
> 
> /**
> @@ -319,7 +319,7 @@
> * @return the trimmed string, <code>null</code> if null String input
> */
> public static String trim(String str) {
> -        return (str == null ? null : str.trim());
> +        return str == null ? null : str.trim();
> }
> 
> /**
> @@ -346,7 +346,7 @@
> */
> public static String trimToNull(String str) {
> String ts = trim(str);
> -        return (isEmpty(ts) ? null : ts);
> +        return isEmpty(ts) ? null : ts;
> }
> 
> /**
> @@ -371,7 +371,7 @@
> * @since 2.0
> */
> public static String trimToEmpty(String str) {
> -        return (str == null ? EMPTY : str.trim());
> +        return str == null ? EMPTY : str.trim();
> }
> 
> // Stripping
> @@ -4397,7 +4397,7 @@
> *  was <code>null</code>
> */
> public static String defaultString(String str) {
> -        return (str == null ? EMPTY : str);
> +        return str == null ? EMPTY : str;
> }
> 
> /**
> @@ -4418,7 +4418,7 @@
> * @return the passed in String, or the default if it was <code>null</code>
> */
> public static String defaultString(String str, String defaultStr) {
> -        return (str == null ? defaultStr : str);
> +        return str == null ? defaultStr : str;
> }
> 
> // Reversing
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic