[Libreoffice-commits] core.git: qadevOOo/runner

Caolán McNamara caolanm at redhat.com
Sat Jan 21 20:37:22 UTC 2017


 qadevOOo/runner/helper/ProcessHandler.java |   42 ++++++-----------------------
 1 file changed, 9 insertions(+), 33 deletions(-)

New commits:
commit 711f203d1eeaeb0c2c75569c8606e98c394fd301
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 21 17:37:42 2017 +0000

    coverity#1399444 UwF: Unwritten field
    
    and
    
    coverity#1399441 NP: Null pointer dereference
    
    since
    
    commit 10cb59eb914ba722c203242272de244d795a51e8
    Date:   Mon Jan 16 16:41:53 2017 +0200
    
        remove some unused Java code
    
    Change-Id: Ieab0325c8685cdc89458570ac8e4d3292af84dff
    Reviewed-on: https://gerrit.libreoffice.org/33377
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/qadevOOo/runner/helper/ProcessHandler.java b/qadevOOo/runner/helper/ProcessHandler.java
index 7ec20a5..1e136d9 100644
--- a/qadevOOo/runner/helper/ProcessHandler.java
+++ b/qadevOOo/runner/helper/ProcessHandler.java
@@ -109,9 +109,7 @@ class Pump extends Thread
  */
 public class ProcessHandler
 {
-
     private String cmdLine;
-    private String[] cmdLineArray;
     private String[] envVars = null;
     private File workDir = null;
     private PrintWriter log;
@@ -254,47 +252,25 @@ public class ProcessHandler
         final Runtime runtime = Runtime.getRuntime();
         try
         {
-            if (cmdLine == null)
+            if (workDir != null)
             {
-                log.println(utils.getDateTime() + "execute: Starting command from array: ");
-                for (int i = 0; i < cmdLineArray.length; i++)
-                {
-                    log.println(cmdLineArray[i]);
-                }
+                log.println(utils.getDateTime() + "execute: Starting command: ");
+                log.println(cmdLine + " path=" + workDir.getAbsolutePath());
                 showEnvVars();
-                log.println("");
-                initializeProcessKiller();
-                m_aProcess = runtime.exec(cmdLineArray, envVars);
+                m_aProcess = runtime.exec(cmdLine, envVars, workDir);
             }
             else
             {
-                if (workDir != null)
-                {
-                    log.println(utils.getDateTime() + "execute: Starting command: ");
-                    log.println(cmdLine + " path=" + workDir.getAbsolutePath());
-                    showEnvVars();
-                    m_aProcess = runtime.exec(cmdLine, envVars, workDir);
-                }
-                else
-                {
-                    log.println(utils.getDateTime() + "execute: Starting command: ");
-                    log.println(cmdLine);
-                    showEnvVars();
-                    m_aProcess = runtime.exec(cmdLine, envVars);
-                }
+                log.println(utils.getDateTime() + "execute: Starting command: ");
+                log.println(cmdLine);
+                showEnvVars();
+                m_aProcess = runtime.exec(cmdLine, envVars);
             }
             isStarted = true;
         }
         catch (java.io.IOException e)
         {
-            if (cmdLine == null)
-            {
-                log.println(utils.getDateTime() + "execute: The command array can't be started: " + e);
-            }
-            else
-            {
-                log.println(utils.getDateTime() + "execute: The command " + cmdLine + " can't be started: " + e);
-            }
+            log.println(utils.getDateTime() + "execute: The command " + cmdLine + " can't be started: " + e);
             return;
         }
         dbg("execute: pump io-streams");


More information about the Libreoffice-commits mailing list