From 4de9516e97d7a347b44a665532284416049d2ba8 Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Fri, 1 Jul 2022 09:30:59 +0100 Subject: [PATCH] Bug 580314 - Remove deprecated methods from core build Deprecated methods in CommandLauncher and CBuildConfiguration are now removed. --- NewAndNoteworthy/CHANGELOG-API.md | 24 ++++++++++++ .../org/eclipse/cdt/core/CommandLauncher.java | 14 ------- .../cdt/core/build/CBuildConfiguration.java | 37 ------------------- 3 files changed, 24 insertions(+), 51 deletions(-) diff --git a/NewAndNoteworthy/CHANGELOG-API.md b/NewAndNoteworthy/CHANGELOG-API.md index df4b275e059..7dd3b7305fe 100644 --- a/NewAndNoteworthy/CHANGELOG-API.md +++ b/NewAndNoteworthy/CHANGELOG-API.md @@ -10,6 +10,8 @@ This section describes API removals that occurred in past releases, and upcoming - [org.eclipse.cdt.ui.newui.AbstractPage reduced visibility of many fields](#newUIAbstractPage) - [org.eclipse.cdt.dsf.gdb.breakpoints.Messages is no longer API](#org.eclipse.cdt.dsf.gdb.breakpoints.Messages) +- [Removal of deprecated CommandLauncher.execute() method](#executeCommandLauncher) +- [Removal of deprecated CBuildConfiguration.watchProcess() methods](#watchProcessCBuildConfig) ## API Changes in CDT 10.5.0 @@ -109,6 +111,28 @@ org.eclipse.cdt.dsf.gdb.breakpoints.Messages should never have been API, Message See https://github.com/eclipse-cdt/cdt/pull/90 +### Removal of deprecated CommandLauncher.execute() method + +The following method is removed because it does not implement the ICommandLauncher +interface. It has been deprecated since 2009: + +- org.eclipse.cdt.core.CommandLauncher.execute(IPath, String[], String[], IPath) + +Clients should instead use the equivilent method from the ICommandLauncher interface. +See [Bug 268615](https://bugs.eclipse.org/bugs/show_bug.cgi?id=268615). + +### Removal of deprecated CBuildConfiguration.watchProcess() methods + +The following methods are removed because their use prevents cancellation of +in-progress builds of core-build projects: + +- org.eclipse.cdt.core.build.CBuildConfiguration.watchProcess(Process, IConsoleParser[], IConsole) +- org.eclipse.cdt.core.build.CBuildConfiguration.watchProcess(Process, IConsole) +- org.eclipse.cdt.core.build.CBuildConfiguration.watchProcess(Process, IConsoleParser[]) + +Clients should instead use the methods of the same name that take a progress monitor object. +See [Bug 580314](https://bugs.eclipse.org/bugs/show_bug.cgi?id=580314). + --- ## API Changes in CDT 10.5.0. diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java index f8d0a66c074..0f7984a6e16 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java @@ -142,20 +142,6 @@ public class CommandLauncher implements ICommandLauncher { } } - /** - * @deprecated - * @since 5.1 - */ - @Deprecated - public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory) { - try { - return execute(commandPath, args, env, changeToDirectory, null); - } catch (CoreException e) { - CCorePlugin.log(e); - } - return null; - } - /** * @since 5.1 * @see org.eclipse.cdt.core.ICommandLauncher#execute(IPath, String[], String[], IPath, IProgressMonitor) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java index 039e1a4518b..5b86c43b642 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java @@ -516,32 +516,6 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu return process; } - /** - * @return The exit code of the build process. - * - * @deprecated use {@link #watchProcess(IConsole, IProgressMonitor)} or {@link #watchProcess(IConsoleParser[], IProgressMonitor)} instead - */ - @Deprecated - protected int watchProcess(Process process, IConsoleParser[] consoleParsers, IConsole console) - throws CoreException { - if (consoleParsers == null || consoleParsers.length == 0) { - return watchProcess(process, console); - } else { - return watchProcess(process, consoleParsers); - } - } - - /** - * @return The exit code of the build process. - * @since 6.4 - * - * @deprecated use {@link #watchProcess(IConsole, IProgressMonitor)} instead and pass in a monitor - */ - @Deprecated - protected int watchProcess(Process process, IConsole console) throws CoreException { - return watchProcess(console, new NullProgressMonitor()); - } - /** * @return The exit code of the build process. * @since 7.5 @@ -550,17 +524,6 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu return launcher.waitAndRead(console.getInfoStream(), console.getErrorStream(), monitor); } - /** - * @return The exit code of the build process. - * @since 6.4 - * - * @deprecated use {@link #watchProcess(IConsoleParser[], IProgressMonitor)} instead and pass in a monitor - */ - @Deprecated - protected int watchProcess(Process process, IConsoleParser[] consoleParsers) throws CoreException { - return watchProcess(consoleParsers, new NullProgressMonitor()); - } - /** * @return The exit code of the build process. * @since 7.5