Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-add DSPLaunchDelegate.createDebugTarget(...) as deprecated method #654

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,26 @@ public void close() {
* of {@link DSPDebugTarget}, but does not have to be. The arguments to this
* method are normally just passed to {@link DSPDebugTarget} constructor.
*/
protected IDebugTarget createDebugTarget(SubMonitor subMonitor, Supplier<TransportStreams> streamsSupplier, ILaunch launch, Map<String, Object> dspParameters) throws CoreException {
final var target = new DSPDebugTarget(launch, streamsSupplier, dspParameters);
protected IDebugTarget createDebugTarget(SubMonitor subMonitor, Supplier<TransportStreams> streamsSupplier,
ILaunch launch, Map<String, Object> dspParameters) throws CoreException {
/*
* TODO use the following code when removing createDebugTarget deprecated
* final var target = new DSPDebugTarget(launch, streamsSupplier,
* dspParameters); target.initialize(subMonitor.split(80)); return target;
* return target;
*/
final var supplier = streamsSupplier.get();
return createDebugTarget(subMonitor, supplier::close, supplier.in, supplier.out, launch, dspParameters);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newer/recommended method should not reference the deprecated one, it would better be the other way round.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That does not work since the new createDebugTarget method is invoked by public void launch(DSPLaunchDelegateLaunchBuilder builderSrc) of the same class. I would then have to revert all your changes to this class.

If I make the deprecated method delegate to the new method it will effectively never be called, thus overriding it will be without any effect.

}

/**
* @deprecated use
* {@link #createDebugTarget(SubMonitor, Supplier, ILaunch, Map)}
*/
@Deprecated(since = "0.15.2", forRemoval = true)
protected IDebugTarget createDebugTarget(SubMonitor subMonitor, Runnable cleanup, InputStream inputStream,
OutputStream outputStream, ILaunch launch, Map<String, Object> dspParameters) throws CoreException {
final var target = new DSPDebugTarget(launch, cleanup, inputStream, outputStream, dspParameters);
target.initialize(subMonitor.split(80));
return target;
}
Expand Down