diff --git a/build/org.eclipse.cdt.autotools.ui.tests/src/org/eclipse/cdt/autotools/ui/tests/autoconf/BaseParserTest.java b/build/org.eclipse.cdt.autotools.ui.tests/src/org/eclipse/cdt/autotools/ui/tests/autoconf/BaseParserTest.java index 864da2fad67..485493b6648 100644 --- a/build/org.eclipse.cdt.autotools.ui.tests/src/org/eclipse/cdt/autotools/ui/tests/autoconf/BaseParserTest.java +++ b/build/org.eclipse.cdt.autotools.ui.tests/src/org/eclipse/cdt/autotools/ui/tests/autoconf/BaseParserTest.java @@ -50,9 +50,10 @@ public abstract class BaseParserTest { public static void beforeClassMethod() { // Verify that the necessary binaries are available, and if they are not, // the tests will be ignored. - String[] testBinaryCommands = { "libtool --version", "autoconf --version", "automake --version" }; + String[][] testBinaryCommands = { { "libtool", "--version" }, { "autoconf", "--version" }, + { "automake", "--version" } }; try { - for (String cmd : testBinaryCommands) { + for (String[] cmd : testBinaryCommands) { Process process = ProcessFactory.getFactory().exec(cmd); process.destroy(); } diff --git a/build/org.eclipse.cdt.autotools.ui.tests/src/org/eclipse/cdt/autotools/ui/tests/autoconf/TestTokenizer.java b/build/org.eclipse.cdt.autotools.ui.tests/src/org/eclipse/cdt/autotools/ui/tests/autoconf/TestTokenizer.java index f498ad8b59b..d1c59a75351 100644 --- a/build/org.eclipse.cdt.autotools.ui.tests/src/org/eclipse/cdt/autotools/ui/tests/autoconf/TestTokenizer.java +++ b/build/org.eclipse.cdt.autotools.ui.tests/src/org/eclipse/cdt/autotools/ui/tests/autoconf/TestTokenizer.java @@ -48,9 +48,10 @@ public class TestTokenizer { public static void beforeClassMethod() { // Verify that the necessary binaries are available, and if they are not, // the tests will be ignored. - String[] testBinaryCommands = { "libtool --version", "autoconf --version", "automake --version" }; + String[][] testBinaryCommands = { { "libtool", "--version" }, { "autoconf", "--version" }, + { "automake", "--version" } }; try { - for (String cmd : testBinaryCommands) { + for (String[] cmd : testBinaryCommands) { Process process = ProcessFactory.getFactory().exec(cmd); process.destroy(); } diff --git a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/ApplicationWorkbenchWindowAdvisor.java b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/ApplicationWorkbenchWindowAdvisor.java index f18fc6d800d..cec15800201 100644 --- a/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/ApplicationWorkbenchWindowAdvisor.java +++ b/debug/org.eclipse.cdt.debug.application/src/org/eclipse/cdt/debug/application/ApplicationWorkbenchWindowAdvisor.java @@ -109,7 +109,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { Path x = new Path(input); try { if (!x.isAbsolute() && x.segmentCount() == 1) { - String command = "which " + input; //$NON-NLS-1$ + String[] command = new String[] { "which", input }; //$NON-NLS-1$ Process p = null; InputStream in = null; try { diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java index b753b13052e..3c14f0050cf 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java @@ -680,7 +680,7 @@ public class BaseTestCase { String server = (String) launchAttributes.get(ATTR_DEBUG_SERVER_NAME); String port = (String) launchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_PORT); String program = (String) launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME); - String commandLine = server + " :" + port + " " + program; + String[] commandLine = { server, ":" + port, program }; try { if (GdbDebugOptions.DEBUG) GdbDebugOptions.trace("Starting gdbserver with command: " + commandLine + "\n"); @@ -787,7 +787,7 @@ public class BaseTestCase { } protected static String doReadGdbVersion(String gdb) throws IOException { - Process process = ProcessFactory.getFactory().exec(gdb + " --version"); + Process process = ProcessFactory.getFactory().exec(new String[] { gdb, "--version" }); try { String streamOutput; try (BufferedReader buffer = new BufferedReader(new InputStreamReader(process.getInputStream()))) { diff --git a/launch/org.eclipse.cdt.flatpak.launcher-feature/feature.properties b/launch/org.eclipse.cdt.flatpak.launcher-feature/feature.properties index 628aaaaf9a6..d2607680dc3 100644 --- a/launch/org.eclipse.cdt.flatpak.launcher-feature/feature.properties +++ b/launch/org.eclipse.cdt.flatpak.launcher-feature/feature.properties @@ -1,5 +1,5 @@ ################################################################################# -# Copyright (c) 2020 Red Hat, Inc. +# Copyright (c) 2020, 2021 Red Hat, Inc. # # This program and the accompanying materials # are made available under the terms of the Eclipse Public License 2.0 @@ -15,7 +15,7 @@ featureName=C/C++ Flatpak Launch Support description=Plugins for launching C/C++ applications in Eclipse Flatpak. provider=Eclipse CDT copyright=\ -Copyright (c) 2020 Red Hat, Inc. and others.\n\ +Copyright (c) 2020, 2021 Red Hat, Inc. and others.\n\ This program and the accompanying materials\n\ are made available under the terms of the Eclipse Public License 2.0\n\ which accompanies this distribution, and is available at\n\ diff --git a/launch/org.eclipse.cdt.flatpak.launcher/META-INF/MANIFEST.MF b/launch/org.eclipse.cdt.flatpak.launcher/META-INF/MANIFEST.MF index c8b42462e33..42a2790d287 100644 --- a/launch/org.eclipse.cdt.flatpak.launcher/META-INF/MANIFEST.MF +++ b/launch/org.eclipse.cdt.flatpak.launcher/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %Plugin.name Bundle-SymbolicName: org.eclipse.cdt.flatpak.launcher;singleton:=true -Bundle-Version: 1.0.100.qualifier +Bundle-Version: 1.0.200.qualifier Bundle-Activator: org.eclipse.cdt.flatpak.launcher.FlatpakLaunchPlugin Bundle-Vendor: %Plugin.vendor Bundle-Localization: plugin diff --git a/launch/org.eclipse.cdt.flatpak.launcher/src/org/eclipse/cdt/flatpak/launcher/FlatpakCommandLauncherFactory.java b/launch/org.eclipse.cdt.flatpak.launcher/src/org/eclipse/cdt/flatpak/launcher/FlatpakCommandLauncherFactory.java index 697046afa54..1bfa1edbc3a 100644 --- a/launch/org.eclipse.cdt.flatpak.launcher/src/org/eclipse/cdt/flatpak/launcher/FlatpakCommandLauncherFactory.java +++ b/launch/org.eclipse.cdt.flatpak.launcher/src/org/eclipse/cdt/flatpak/launcher/FlatpakCommandLauncherFactory.java @@ -191,11 +191,11 @@ public class FlatpakCommandLauncherFactory } try { Process p1 = ProcessFactory.getFactory() - .exec("mkdir -p " + pluginPath.append(path).toOSString()); //$NON-NLS-1$ + .exec(new String[] { "mkdir", "-p", pluginPath.append(path).toOSString() }); //$NON-NLS-1$ //$NON-NLS-2$ int rc1 = waitFor(p1); if (rc1 == 0) { - Process p2 = ProcessFactory.getFactory().exec("cp -ru " + path //$NON-NLS-1$ - + " " + pluginPath.append(path).removeLastSegments(1).toOSString()); //$NON-NLS-1$ + Process p2 = ProcessFactory.getFactory().exec(new String[] { "cp", "-ru", "path", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + pluginPath.append(path).removeLastSegments(1).toOSString() }); int rc2 = waitFor(p2); if (rc2 == 0) { copiedDirs.add(path); @@ -270,11 +270,11 @@ public class FlatpakCommandLauncherFactory if (!copiedDirs.contains(path)) { try { Process p1 = ProcessFactory.getFactory() - .exec("mkdir -p " + copiedPath.append(path).toOSString()); //$NON-NLS-1$ + .exec(new String[] { "mkdir", "-p", copiedPath.append(path).toOSString() }); //$NON-NLS-1$ //$NON-NLS-2$ int rc1 = waitFor(p1); if (rc1 == 0) { - Process p2 = ProcessFactory.getFactory().exec("cp -ru " + path //$NON-NLS-1$ - + " " + copiedPath.append(path).removeLastSegments(1).toOSString()); //$NON-NLS-1$ + Process p2 = ProcessFactory.getFactory().exec(new String[] { "cp", "-ru", path, //$NON-NLS-1$ //$NON-NLS-2$ + copiedPath.append(path).removeLastSegments(1).toOSString() }); int rc2 = waitFor(p2); if (rc2 == 0) { copiedDirs.add(path); @@ -321,11 +321,11 @@ public class FlatpakCommandLauncherFactory if (removedDirs.contains(path)) { try { Process p1 = ProcessFactory.getFactory() - .exec("mkdir -p " + hostDir.append(path).toOSString()); //$NON-NLS-1$ + .exec(new String[] { "mkdir", "-p", hostDir.append(path).toOSString() }); //$NON-NLS-1$ //$NON-NLS-2$ int rc1 = waitFor(p1); if (rc1 == 0) { - Process p2 = ProcessFactory.getFactory().exec("cp -ru " + path //$NON-NLS-1$ - + " " + hostDir.append(path).removeLastSegments(1).toOSString()); //$NON-NLS-1$ + Process p2 = ProcessFactory.getFactory().exec(new String[] { "cp", "-ru", path, //$NON-NLS-1$ //$NON-NLS-2$ + hostDir.append(path).removeLastSegments(1).toOSString() }); int rc2 = waitFor(p2); if (rc2 == 0) { copiedDirs.add(path);