findbugs
[utils] / support / general / src / main / java / org / wamblee / io / SimpleProcess.java
index de93e547638d1db49d6c47e57be33665e83d37af..b0e96a90397326a9e8ec8f4c04fce9e34d4c36ad 100644 (file)
@@ -27,6 +27,7 @@ import java.io.OutputStream;
 import java.io.PrintStream;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.util.Arrays;
 
 /**
  * 
@@ -50,7 +51,7 @@ public class SimpleProcess {
      */
     public SimpleProcess(File aDirectory, String[] aCmd) {
         directory = aDirectory;
-        cmd = aCmd;
+        cmd = Arrays.copyOf(aCmd, aCmd.length);
     }
 
     /**
@@ -83,10 +84,10 @@ public class SimpleProcess {
 
     private int runImpl() throws IOException {
         try {
-            String fullcmd = "";
+            StringBuffer fullcmd = new StringBuffer();
 
             for (String part : cmd) {
-                fullcmd += (" " + part);
+                fullcmd.append(" " + part);
             }
 
             LOG.debug("Executing '" + fullcmd + "' in directory '" + directory +