commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1553830 - in /commons/proper/exec/trunk/src: main/java/org/apache/commons/exec/ main/java/org/apache/commons/exec/launcher/ main/java/org/apache/commons/exec/util/ test/java/org/apache/commons/exec/util/
Date Sat, 28 Dec 2013 14:18:58 GMT
Author: ggregory
Date: Sat Dec 28 14:18:57 2013
New Revision: 1553830

URL: http://svn.apache.org/r1553830
Log:
Remove unnecessary parentheses.

Modified:
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteException.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/LogOutputStream.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/PumpStreamHandler.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/StreamPumper.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java
    commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/StringUtils.java
    commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/util/MapUtilTest.java

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/CommandLine.java Sat Dec
28 14:18:57 2013
@@ -262,7 +262,7 @@ public class CommandLine {
         for(int i=0; i<result.length; i++) {
             currArgument = (Argument) arguments.get(i);
             expandedArgument = expandArgument(currArgument.getValue());
-            result[i] = (currArgument.isHandleQuoting() ? StringUtils.quoteArgument(expandedArgument)
: expandedArgument);
+            result[i] = currArgument.isHandleQuoting() ? StringUtils.quoteArgument(expandedArgument)
: expandedArgument;
         }
 
         return result;

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/DefaultExecutor.java Sat
Dec 28 14:18:57 2013
@@ -217,7 +217,7 @@ public class DefaultExecutor implements 
 
     /** @see org.apache.commons.exec.Executor#setExitValues(int[]) */
     public void setExitValues(final int[] values) {
-        this.exitValues = (values == null ? null : (int[]) values.clone());
+        this.exitValues = values == null ? null : (int[]) values.clone();
     }
 
     /** @see org.apache.commons.exec.Executor#isFailure(int) */

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteException.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteException.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteException.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteException.java
Sat Dec 28 14:18:57 2013
@@ -72,7 +72,7 @@ public class ExecuteException extends IO
      * Return the underlying cause of this exception (if any).
      */
     public Throwable getCause() {
-        return (this.cause);
+        return this.cause;
     }
 
     /**

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java Sat
Dec 28 14:18:57 2013
@@ -81,7 +81,7 @@ public class ExecuteWatchdog implements 
     public ExecuteWatchdog(final long timeout) {
         this.killedProcess = false;
         this.watch = false;
-        this.hasWatchdog = (timeout != INFINITE_TIMEOUT);
+        this.hasWatchdog = timeout != INFINITE_TIMEOUT;
         this.processStarted = false;
         if(this.hasWatchdog) {
             this.watchdog = new Watchdog(timeout);

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/LogOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/LogOutputStream.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/LogOutputStream.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/LogOutputStream.java Sat
Dec 28 14:18:57 2013
@@ -74,14 +74,14 @@ public abstract class LogOutputStream
      */
     public void write(final int cc) throws IOException {
         final byte c = (byte) cc;
-        if ((c == '\n') || (c == '\r')) {
+        if (c == '\n' || c == '\r') {
             if (!skip) {
                 processBuffer();
             }
         } else {
             buffer.write(cc);
         }
-        skip = (c == '\r');
+        skip = c == '\r';
     }
 
     /**

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/PumpStreamHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/PumpStreamHandler.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/PumpStreamHandler.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/PumpStreamHandler.java
Sat Dec 28 14:18:57 2013
@@ -250,7 +250,7 @@ public class PumpStreamHandler implement
      * @return the stream pumper thread
      */
     protected Thread createPump(final InputStream is, final OutputStream os) {
-        boolean closeWhenExhausted = (os instanceof PipedOutputStream ? true : false);
+        boolean closeWhenExhausted = os instanceof PipedOutputStream ? true : false;
         return createPump(is, os, closeWhenExhausted);
     }
 

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/StreamPumper.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/StreamPumper.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/StreamPumper.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/StreamPumper.java Sat
Dec 28 14:18:57 2013
@@ -74,7 +74,7 @@ public class StreamPumper implements Run
             final boolean closeWhenExhausted, final int size) {
         this.is = is;
         this.os = os;
-        this.size = (size > 0 ? size : DEFAULT_SIZE);
+        this.size = size > 0 ? size : DEFAULT_SIZE;
         this.closeWhenExhausted = closeWhenExhausted;
     }
 

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
(original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/launcher/VmsCommandLauncher.java
Sat Dec 28 14:18:57 2013
@@ -68,7 +68,7 @@ public class VmsCommandLauncher extends 
     public boolean isFailure( final int exitValue )
     {
         // even exit value signals failure
-        return (exitValue % 2) == 0;        
+        return exitValue % 2 == 0;        
     }
 
     /*

Modified: commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java (original)
+++ commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/util/MapUtils.java Sat
Dec 28 14:18:57 2013
@@ -89,10 +89,10 @@ public class MapUtils
 
         Map result = null;
 
-        if((lhs == null) || (lhs.size() == 0)) {
+        if(lhs == null || lhs.size() == 0) {
             result = copy(rhs);
         }
-        else if((rhs == null) || (rhs.size() == 0)) {
+        else if(rhs == null || rhs.size() == 0) {
             result = copy(lhs);
         }
         else {

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=1553830&r1=1553829&r2=1553830&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
Sat Dec 28 14:18:57 2013
@@ -109,7 +109,7 @@ public class StringUtils {
                                 value = fixFileSeparatorChar(((File) temp).getAbsolutePath());
                             }
                             else {
-                                value = (temp != null ? temp.toString() : null);    
+                                value = temp != null ? temp.toString() : null;    
                             }
 
                             if (value != null) {
@@ -253,7 +253,7 @@ public class StringUtils {
      * @return true when the argument is quoted
      */
     public static boolean isQuoted(final String argument) {
-        return ( argument.startsWith( SINGLE_QUOTE ) && argument.endsWith( SINGLE_QUOTE
) ) ||
-            ( argument.startsWith( DOUBLE_QUOTE ) && argument.endsWith( DOUBLE_QUOTE
) );
+        return argument.startsWith( SINGLE_QUOTE ) && argument.endsWith( SINGLE_QUOTE
) ||
+            argument.startsWith( DOUBLE_QUOTE ) && argument.endsWith( DOUBLE_QUOTE
);
     }
 }
\ No newline at end of file

Modified: commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/util/MapUtilTest.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/util/MapUtilTest.java?rev=1553830&r1=1553829&r2=1553830&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/util/MapUtilTest.java
(original)
+++ commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/util/MapUtilTest.java
Sat Dec 28 14:18:57 2013
@@ -55,7 +55,7 @@ public class MapUtilTest extends TestCas
 
         applicationEnvironment.put("appMainClass", "foo.bar.Main");
         Map result = MapUtils.merge(procEnvironment, applicationEnvironment);
-        assertTrue((procEnvironment.size() + applicationEnvironment.size()) == result.size());
+        assertTrue(procEnvironment.size() + applicationEnvironment.size() == result.size());
         assertEquals("foo.bar.Main", result.get("appMainClass"));
     }
 



Mime
View raw message