Bug 532557 - BadLocationException below ConsoleDocument.getLineOfOffset
Small workaround to avoid setting console text at same time console is
shown.
Change-Id: Icf1215219cf713112ffd94192456b2b978a85817
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
diff --git a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/console/JavaStackTraceConsoleFactory.java b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/console/JavaStackTraceConsoleFactory.java
index 3a8e3d6..15aee2a 100644
--- a/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/console/JavaStackTraceConsoleFactory.java
+++ b/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/console/JavaStackTraceConsoleFactory.java
@@ -68,10 +68,13 @@
public void openConsole(String initialText) {
if (fConsole == null) {
fConsole = new JavaStackTraceConsole();
- fConsole.initializeDocument();
+ if (initialText != null) {
+ fConsole.getDocument().set(initialText);
+ } else {
+ fConsole.initializeDocument();
+ }
fConsoleManager.addConsoles(new IConsole[] { fConsole });
- }
- if (initialText != null) {
+ } else if (initialText != null) {
fConsole.getDocument().set(initialText);
}
fConsoleManager.showConsoleView(fConsole);