From 1ac907184bc8f8e89bbabbfbe06e249dcda7cdfd Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Mon, 14 Jun 2021 15:37:36 -0400 Subject: [PATCH] Bug 573677: Mark methods that don't handle commands well as deprecated Some of these commands work "by accident" on Windows, but there are lots of special/corner cases that may not. On Linux they almost certainly never do the correct thing when spaces are in arguments. (follow up for 1557c2c4f50d780f03fdae91d4eefa73981b0111) Change-Id: I126d60423b0e4ff6d9d240d7de2c1a4905763415 --- .../org.eclipse.cdt.core.native/META-INF/MANIFEST.MF | 2 +- core/org.eclipse.cdt.core.native/pom.xml | 2 +- .../eclipse/cdt/utils/spawner/ProcessFactory.java | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF index 95b98efa95d..9ec7bd30317 100644 --- a/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF +++ b/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.core.native;singleton:=true -Bundle-Version: 6.1.200.qualifier +Bundle-Version: 6.1.300.qualifier Bundle-Activator: org.eclipse.cdt.internal.core.natives.CNativePlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/core/org.eclipse.cdt.core.native/pom.xml b/core/org.eclipse.cdt.core.native/pom.xml index f5ae96e0350..8e5f5af013b 100644 --- a/core/org.eclipse.cdt.core.native/pom.xml +++ b/core/org.eclipse.cdt.core.native/pom.xml @@ -23,7 +23,7 @@ ../../pom.xml - 6.1.200-SNAPSHOT + 6.1.300-SNAPSHOT org.eclipse.cdt.core.native eclipse-plugin diff --git a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java index cb9b49d8295..a8dda6be4de 100644 --- a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java +++ b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java @@ -58,6 +58,10 @@ public class ProcessFactory { return instance; } + /** + * @deprecated Do not use this method it splits command line arguments on whitespace with no regard to quoting rules. See Bug 573677 + */ + @Deprecated public Process exec(String cmd) throws IOException { cmd = modifyCmdIfFlatpak(cmd); if (hasSpawner) @@ -79,6 +83,10 @@ public class ProcessFactory { return runtime.exec(cmdarray, envp); } + /** + * @deprecated Do not use this method it splits command line arguments on whitespace with no regard to quoting rules. See Bug 573677 + */ + @Deprecated public Process exec(String cmd, String[] envp) throws IOException { cmd = modifyCmdIfFlatpak(cmd); if (hasSpawner) @@ -86,6 +94,10 @@ public class ProcessFactory { return runtime.exec(cmd, envp); } + /** + * @deprecated Do not use this method it splits command line arguments on whitespace with no regard to quoting rules. See Bug 573677 + */ + @Deprecated public Process exec(String cmd, String[] envp, File dir) throws IOException { cmd = modifyCmdIfFlatpak(cmd); if (hasSpawner)