summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorWainer S. Moschetta2013-07-04 22:08:37 (EDT)
committer Roland Grunberg2013-08-01 16:12:28 (EDT)
commit3ceff6ab55ed91637ddcb4233edb28c79a3a7ae4 (patch)
tree60ac13d3daed5fd64f727aa13f03baec5ee968cb
parent36fef4972acb09ff3f4898d4b23402b8c7f108c3 (diff)
downloadorg.eclipse.linuxtools-3ceff6ab55ed91637ddcb4233edb28c79a3a7ae4.zip
org.eclipse.linuxtools-3ceff6ab55ed91637ddcb4233edb28c79a3a7ae4.tar.gz
org.eclipse.linuxtools-3ceff6ab55ed91637ddcb4233edb28c79a3a7ae4.tar.bz2
Remote proxy: add getEnv() methodrefs/changes/95/14295/10
Added remote implementations of System.getenv() into the proxies. Change-Id: Ib62b072b351a99c5d0079d742f786ff38d2faa45 Signed-off-by: Wainer S. Moschetta <wainersm@linux.vnet.ibm.com> Signed-off-by: Rodrigo Fraxino Araujo <rfaraujo@linux.vnet.ibm.com> Reviewed-on: https://git.eclipse.org/r/14295 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com> IP-Clean: Roland Grunberg <rgrunber@redhat.com> Tested-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/IRemoteEnvProxyManager.java44
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteEnvProxyManager.java55
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java23
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF2
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/rdt/proxy/RDTProxyManager.java29
-rw-r--r--profiling/org.eclipse.linuxtools.ssh.proxy/META-INF/MANIFEST.MF2
-rw-r--r--profiling/org.eclipse.linuxtools.ssh.proxy/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/ssh/proxy/SSHProxyManager.java68
-rw-r--r--profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java21
12 files changed, 235 insertions, 17 deletions
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF
index 14e5e26..685b806 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.linuxtools.profiling.launch;singleton:=true
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.1.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.internal.profiling.launch.ProfileLaunchPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml b/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml
index d2c9dbf..d7d2455 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.profiling.launch</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools Profiling Launch Plug-in</name>
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/IRemoteEnvProxyManager.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/IRemoteEnvProxyManager.java
new file mode 100644
index 0000000..99c29ea
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/IRemoteEnvProxyManager.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - Rodrigo Fraxino De Araujo <rfaraujo@br.ibm.com>
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.profiling.launch;
+
+import java.net.URI;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * Interface to handle system's environment variables.
+ *
+ * @since 2.1
+ */
+public interface IRemoteEnvProxyManager extends IRemoteProxyManager {
+ /**
+ * Method to get system's environment variables.
+ *
+ * @param Project
+ * IProject
+ * @return Mapping of environment variables
+ * @since 2.1
+ */
+ public Map<String, String> getEnv(IProject project) throws CoreException;
+ /**
+ * Method to get system's environment variables.
+ *
+ * @param Resource URI
+ * URI
+ * @return Mapping of environment variables
+ * @since 2.1
+ */
+ public Map<String, String> getEnv(URI uri) throws CoreException;
+}
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteEnvProxyManager.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteEnvProxyManager.java
new file mode 100644
index 0000000..ce5c2f8
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteEnvProxyManager.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2013 IBM Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - Rodrigo Fraxino De Araujo <rfaraujo@br.ibm.com>
+ * IBM Corporation - Wainer Santos Moschetta <wainersm@br.ibm.com>
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.profiling.launch;
+
+import java.net.URI;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * Class to handle system's environment variables.
+ *
+ * @since 2.1
+ */
+public class RemoteEnvProxyManager extends RemoteProxyManager implements IRemoteEnvProxyManager {
+
+ public Map<String, String> getEnv(IProject project) throws CoreException {
+ String scheme = mapping.getSchemeFromNature(project);
+ if (scheme!=null) {
+ IRemoteProxyManager manager = getRemoteManager(scheme);
+ IRemoteEnvProxyManager envManager;
+ if (manager instanceof IRemoteEnvProxyManager) {
+ envManager = (IRemoteEnvProxyManager) manager;
+ return envManager.getEnv(project);
+ }
+ }
+ URI projectURI = project.getLocationURI();
+ return getEnv(projectURI);
+ }
+
+ public Map<String, String> getEnv(URI uri) throws CoreException {
+ String scheme = uri.getScheme();
+ if (scheme != null && !scheme.equals(LOCALSCHEME)){
+ IRemoteProxyManager manager = getRemoteManager(scheme);
+ IRemoteEnvProxyManager envManager;
+ if (manager instanceof IRemoteEnvProxyManager) {
+ envManager = (IRemoteEnvProxyManager) manager;
+ return envManager.getEnv(uri);
+ }
+ }
+ return System.getenv();
+ }
+
+}
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
index 84c74c7..387338b 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
@@ -29,14 +29,23 @@ import org.eclipse.linuxtools.internal.profiling.launch.ProfileLaunchPlugin;
public class RemoteProxyManager implements IRemoteProxyManager {
private static final String EXT_ATTR_CLASS = "class"; //$NON-NLS-1$
- private static final String LOCALSCHEME = "file"; //$NON-NLS-1$
+ /**
+ * @since 2.1
+ */
+ protected static final String LOCALSCHEME = "file"; //$NON-NLS-1$
private static RemoteProxyManager manager;
private LocalFileProxy lfp;
- private RemoteProxyNatureMapping mapping = new RemoteProxyNatureMapping();
+ /**
+ * @since 2.1
+ */
+ protected RemoteProxyNatureMapping mapping = new RemoteProxyNatureMapping();
private Map<String, IRemoteProxyManager> remoteManagers = new HashMap<String, IRemoteProxyManager>();
- private RemoteProxyManager() {
+ /**
+ * @since 2.1
+ */
+ protected RemoteProxyManager() {
// do nothing
}
@@ -51,8 +60,10 @@ public class RemoteProxyManager implements IRemoteProxyManager {
lfp = new LocalFileProxy(uri);
return lfp;
}
-
- private IRemoteProxyManager getRemoteManager(String schemeId) throws CoreException {
+ /**
+ * @since 2.1
+ */
+ protected IRemoteProxyManager getRemoteManager(String schemeId) throws CoreException {
IRemoteProxyManager remoteManager = remoteManagers.get(schemeId);
if (remoteManager == null) {
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(ProfileLaunchPlugin.PLUGIN_ID, IRemoteProxyManager.EXTENSION_POINT_ID);
@@ -143,4 +154,6 @@ public class RemoteProxyManager implements IRemoteProxyManager {
URI projectURI = project.getLocationURI();
return getOS(projectURI);
}
+
+
}
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF
index 06253e3..908bf7f 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.linuxtools.rdt.proxy;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.rdt.proxy.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml b/profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml
index 5058074..67f98c0 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.rdt.proxy</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools RDT Proxy Plug-in</name>
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/rdt/proxy/RDTProxyManager.java b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/rdt/proxy/RDTProxyManager.java
index 236db16..bd361eb 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/rdt/proxy/RDTProxyManager.java
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/rdt/proxy/RDTProxyManager.java
@@ -11,19 +11,24 @@
package org.eclipse.linuxtools.rdt.proxy;
import java.net.URI;
+import java.util.Collections;
+import java.util.Map;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.linuxtools.internal.rdt.proxy.RDTCommandLauncher;
import org.eclipse.linuxtools.internal.rdt.proxy.RDTFileProxy;
import org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher;
+import org.eclipse.linuxtools.profiling.launch.IRemoteEnvProxyManager;
import org.eclipse.linuxtools.profiling.launch.IRemoteFileProxy;
-import org.eclipse.linuxtools.profiling.launch.IRemoteProxyManager;
import org.eclipse.ptp.remote.core.IRemoteConnection;
import org.eclipse.ptp.remote.core.IRemoteServices;
import org.eclipse.ptp.remote.core.RemoteServices;
+import org.eclipse.ptp.remote.core.exception.RemoteConnectionException;
-public class RDTProxyManager implements IRemoteProxyManager {
+public class RDTProxyManager implements IRemoteEnvProxyManager {
public final static String SYNC_NATURE = "org.eclipse.ptp.rdt.sync.core.remoteSyncNature"; //$NON-NLS-1$
@@ -64,4 +69,24 @@ public class RDTProxyManager implements IRemoteProxyManager {
return getOS(uri);
}
+ public Map<String, String> getEnv(URI uri) throws CoreException {
+ IRemoteServices services = RemoteServices.getRemoteServices(uri);
+ IRemoteConnection connection = services.getConnectionManager().getConnection(uri);
+ if(!connection.isOpen()) {
+ try {
+ connection.open(null);
+ } catch (RemoteConnectionException e) {
+ Status status = new Status(IStatus.ERROR, e.getMessage(), Activator.PLUGIN_ID);
+ Activator.getDefault().getLog().log(status);
+ return Collections.emptyMap();
+ }
+ }
+ return connection.getEnv();
+ }
+
+ public Map<String, String> getEnv(IProject project) throws CoreException {
+ URI uri = project.getLocationURI();
+ return getEnv(uri);
+ }
+
}
diff --git a/profiling/org.eclipse.linuxtools.ssh.proxy/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.ssh.proxy/META-INF/MANIFEST.MF
index ae33b47..2a92ba7 100644
--- a/profiling/org.eclipse.linuxtools.ssh.proxy/META-INF/MANIFEST.MF
+++ b/profiling/org.eclipse.linuxtools.ssh.proxy/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.linuxtools.ssh.proxy;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.ssh.proxy.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
diff --git a/profiling/org.eclipse.linuxtools.ssh.proxy/pom.xml b/profiling/org.eclipse.linuxtools.ssh.proxy/pom.xml
index de6901b..b93e5f3 100644
--- a/profiling/org.eclipse.linuxtools.ssh.proxy/pom.xml
+++ b/profiling/org.eclipse.linuxtools.ssh.proxy/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.ssh.proxy</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools SSH Proxy Plug-in</name>
diff --git a/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/ssh/proxy/SSHProxyManager.java b/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/ssh/proxy/SSHProxyManager.java
index 0786398..26a3ddc 100644
--- a/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/ssh/proxy/SSHProxyManager.java
+++ b/profiling/org.eclipse.linuxtools.ssh.proxy/src/org/eclipse/linuxtools/ssh/proxy/SSHProxyManager.java
@@ -11,20 +11,28 @@
*******************************************************************************/
package org.eclipse.linuxtools.ssh.proxy;
+import java.io.BufferedReader;
import java.io.InputStream;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.net.URI;
+import java.util.Collections;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.linuxtools.internal.ssh.proxy.SSHCommandLauncher;
import org.eclipse.linuxtools.internal.ssh.proxy.SSHFileProxy;
import org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher;
+import org.eclipse.linuxtools.profiling.launch.IRemoteEnvProxyManager;
import org.eclipse.linuxtools.profiling.launch.IRemoteFileProxy;
-import org.eclipse.linuxtools.profiling.launch.IRemoteProxyManager;
-public class SSHProxyManager implements IRemoteProxyManager {
+public class SSHProxyManager implements IRemoteEnvProxyManager {
@Override
public IRemoteFileProxy getFileProxy(URI uri) {
@@ -72,4 +80,60 @@ public class SSHProxyManager implements IRemoteProxyManager {
URI uri = project.getLocationURI();
return getOS(uri);
}
+
+ @Override
+ public Map<String, String> getEnv(URI uri) throws CoreException {
+ Map<String, String> env = Collections.emptyMap();
+ SSHCommandLauncher cmdLauncher = new SSHCommandLauncher(uri);
+ Process p = cmdLauncher.execute(new Path("/bin/env"), new String[] {}, new String[] {}, null, null);
+ BufferedReader error = new BufferedReader(new InputStreamReader(p.getErrorStream()));
+ BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String errorLine;
+ try {
+ if((errorLine = error.readLine()) != null){
+ throw new IOException(errorLine);
+ }
+ error.close();
+ } catch (IOException e) {
+ Status status = new Status(IStatus.ERROR, e.getMessage(), Activator.PLUGIN_ID);
+ Activator.getDefault().getLog().log(status);
+ return Collections.emptyMap();
+ }
+ /*
+ * It is common to export functions declaration in the environment so
+ * this pattern filters out them because they get truncated
+ * and might end up on failure.
+ *
+ * Patterns added in the env list:
+ * var=value
+ * var=value
+ *
+ * Patterns not added in the env list:
+ * var=() { something
+ *
+ * TODO: implement a parser for function declarations so that they do not need to be excluded
+ */
+ Pattern variablePattern = Pattern.compile("^(.+)=([^\\(\\)\\s{].*|)$");
+ Matcher m;
+ try {
+ String readLine = reader.readLine();
+ while (readLine != null) {
+ m = variablePattern.matcher(readLine);
+ if(m.matches())
+ env.put(m.group(1), m.group(2));
+ readLine = reader.readLine();
+ }
+ } catch (IOException e) {
+ Status status = new Status(IStatus.ERROR, e.getMessage(), Activator.PLUGIN_ID);
+ Activator.getDefault().getLog().log(status);
+ return Collections.emptyMap();
+ }
+ return env;
+ }
+
+ @Override
+ public Map<String, String> getEnv(IProject project) throws CoreException {
+ URI uri = project.getLocationURI();
+ return getEnv(uri);
+ }
}
diff --git a/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java b/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java
index f1bcfb8..306832d 100644
--- a/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java
+++ b/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java
@@ -15,6 +15,8 @@ import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.profiling.launch.RemoteEnvProxyManager;
import org.eclipse.linuxtools.tools.launch.core.properties.LinuxtoolsPathProperty;
/*
@@ -45,7 +47,20 @@ public abstract class LinuxtoolsProcessFactory {
envp = new String[0];
String ltPath = LinuxtoolsPathProperty.getInstance().getLinuxtoolsPath(project);
String envpPath = getEnvpPath(envp);
- String systemPath = System.getenv(PATH);
+ String systemPath = null;
+ Map<String, String> systemEnvMap = null;
+ try {
+ systemEnvMap = RemoteEnvProxyManager.class.newInstance().getEnv(project);
+ systemPath = systemEnvMap.get(PATH);
+ if (systemPath==null)
+ systemPath = System.getenv(PATH);
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
StringBuffer newPath = new StringBuffer();
newPath.append(PATH_EQUAL);
@@ -74,7 +89,7 @@ public abstract class LinuxtoolsProcessFactory {
newEnvp[i] = newPath.toString();
else
newEnvp[i] = envp[i];
- } else {
+ } else if (systemEnvMap != null) {
Map<String, String> envVars = System.getenv();
Set<String> keySet = envVars.keySet();
newEnvp = new String[envVars.size()];
@@ -84,6 +99,8 @@ public abstract class LinuxtoolsProcessFactory {
newEnvp[i] = key + "=" + envVars.get(key);
i++;
}
+ } else {
+ newEnvp = new String[] {};
}
return newEnvp;
}