commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgoes...@apache.org
Subject svn commit: r713877 - /commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
Date Fri, 14 Nov 2008 00:06:53 GMT
Author: sgoeschl
Date: Thu Nov 13 16:06:52 2008
New Revision: 713877

URL: http://svn.apache.org/viewvc?rev=713877&view=rev
Log:
Providing a more correct toString() representation which does quoting

Modified:
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java?rev=713877&r1=713876&r2=713877&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
Thu Nov 13 16:06:52 2008
@@ -225,18 +225,13 @@
 
     /**
      * Determines if this is a quoted argumented - either single or
-     * double quote.
+     * double quoted.
      *
      * @param argument the argument to check
      * @return true when the argument is quoted
      */
     public static boolean isQuoted(final String argument) {
-        if((argument.startsWith(SINGLE_QUOTE) || argument.startsWith(DOUBLE_QUOTE)) &&

-           (argument.startsWith(SINGLE_QUOTE) || argument.startsWith(DOUBLE_QUOTE))  ) {
-            return true;
-        }
-        else {
-            return false;
-        }
+        return ( argument.startsWith( SINGLE_QUOTE ) || argument.startsWith( DOUBLE_QUOTE
) ) &&
+            ( argument.endsWith( SINGLE_QUOTE ) || argument.endsWith( DOUBLE_QUOTE ) );
     }
 }
\ No newline at end of file



Mime
View raw message