diff options
author | Paul Pazderski | 2020-04-30 12:02:20 +0000 |
---|---|---|
committer | Paul Pazderski | 2020-04-30 12:02:20 +0000 |
commit | 4296b4127e2e3b8549f5733c4c7d8f2f24a4b891 (patch) | |
tree | 686492bd1c5185b8a8cdb3acea6f2531edf0e65f | |
parent | 4f121de60eb4d303fb20b4cb967c603a2a31aa1c (diff) | |
download | eclipse.platform.debug-4296b4127e2e3b8549f5733c4c7d8f2f24a4b891.tar.gz eclipse.platform.debug-4296b4127e2e3b8549f5733c4c7d8f2f24a4b891.tar.xz eclipse.platform.debug-4296b4127e2e3b8549f5733c4c7d8f2f24a4b891.zip |
Bug 562653 - an internal error occurred during: "Launching XXX Debug."
Some client code tries to create an internal class via a constructor
which was recently changed and therefore breaks. Since it is trivial for
us to keep the old constructor it was restored for the time being.
Change-Id: Ic03b2a559a3387a20c03d8ba07c509875ec257b4
Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
3 files changed, 50 insertions, 8 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java index 94e2fb733..ef77a0610 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java @@ -63,7 +63,7 @@ public class InputStreamMonitor { * @param stream output stream */ public InputStreamMonitor(OutputStream stream) { - this(stream, null); + this(stream, (Charset) null); } /** @@ -81,9 +81,22 @@ public class InputStreamMonitor { } /** - * Appends the given text to the stream, or - * queues the text to be written at a later time - * if the stream is blocked. + * Creates an input stream monitor which writes to system in via the given + * output stream. + * + * @param stream output stream + * @param encoding stream encoding or <code>null</code> for system default + * @deprecated use {@link #InputStreamMonitor(OutputStream, Charset)} + * instead + */ + @Deprecated + public InputStreamMonitor(OutputStream stream, String encoding) { + this(stream, Charset.forName(encoding)); + } + + /** + * Appends the given text to the stream, or queues the text to be written at + * a later time if the stream is blocked. * * @param text text to append */ diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java index 00daec44d..4c64c2654 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java @@ -93,6 +93,20 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor { fDone = new AtomicBoolean(false); } + /** + * Creates an output stream monitor on the given stream (connected to system + * out or err). + * + * @param stream input stream to read from + * @param encoding stream encoding or <code>null</code> for system default + * @deprecated use {@link #OutputStreamMonitor(InputStream, Charset)} + * instead + */ + @Deprecated + public OutputStreamMonitor(InputStream stream, String encoding) { + this(stream, Charset.forName(encoding)); + } + @Override public synchronized void addListener(IStreamListener listener) { fListeners.add(listener); diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java index 54fc4c9f6..f8aa4ef0d 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java @@ -66,10 +66,25 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 { } /** - * Causes the proxy to close all - * communications between it and the - * underlying streams after all remaining data - * in the streams is read. + * Creates a <code>StreamsProxy</code> on the streams of the given system + * process. + * + * @param process system process to create a streams proxy on + * @param encoding the process's encoding or <code>null</code> if default + * @deprecated use {@link #StreamsProxy(Process, Charset)} instead + */ + @Deprecated + public StreamsProxy(Process process, String encoding) { + // This constructor was once removed in favor of the Charset variant + // but Bug 562653 brought up a client which use this internal class via + // reflection and breaks without this constructor. So we restored the + // old constructor for the time being. + this(process, Charset.forName(encoding)); + } + + /** + * Causes the proxy to close all communications between it and the + * underlying streams after all remaining data in the streams is read. */ public void close() { if (!isClosed(true)) { |