Bug 553753 - [console] Provide stacktrace if partitioner stream closed
is called twice
Change-Id: I7ce2f14e1dc14328d9bfdf7e7c126f47c5674ded
Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java
index d2f6fbc..003fe05 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java
@@ -265,7 +265,8 @@
*/
public void streamsClosed() {
if (streamsClosed) {
- log(IStatus.ERROR, "Streams are already closed."); //$NON-NLS-1$
+ String msg = "Streams are already closed.";//$NON-NLS-1$
+ log(IStatus.ERROR, msg, new IllegalStateException(msg));
return;
}
streamsClosed = true;
@@ -1381,6 +1382,10 @@
ConsolePlugin.log(new Status(status, ConsolePlugin.getUniqueIdentifier(), msg));
}
+ private static void log(int status, String msg, Throwable t) {
+ ConsolePlugin.log(new Status(status, ConsolePlugin.getUniqueIdentifier(), msg, t));
+ }
+
/**
* For debug purpose. Check if whole document is partitioned, partitions are
* ordered by offset, every partition has length greater 0 and all writable