Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-03-11 18:15:33 -0500
committerAndrey Loskutov2017-03-11 18:15:33 -0500
commitc88654a1094f40f402575bfd0e258aade7dac74b (patch)
tree0f68b5c92fed7b39946bfd43445cf0d33a4edcb6
parent8253bfb80f6510e5d1c7e2e757af04dd11343cac (diff)
downloadeclipse.platform.text-c88654a1094f40f402575bfd0e258aade7dac74b.tar.gz
eclipse.platform.text-c88654a1094f40f402575bfd0e258aade7dac74b.tar.xz
eclipse.platform.text-c88654a1094f40f402575bfd0e258aade7dac74b.zip
Bug 513517 - printStackTrace() should not be used in production codeI20170315-0500I20170314-2000I20170313-2000I20170312-2000
Change-Id: I7b4a4d0a1af3979852269b1ee53fb9a8ba444e93 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java1
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java3
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java1
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java2
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieProposalProcessor.java3
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java5
6 files changed, 7 insertions, 8 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
index af3863ab1..34cdcaaab 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
@@ -1029,7 +1029,6 @@ public final class RevisionPainter {
widgetStartLine= Math.max(0, range.getStartLine() - visibleStartLine);
widgetEndLine= Math.min(visibleEndLine, end(range) - 1);
} catch (BadLocationException x) {
- x.printStackTrace();
// ignore and return null
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java
index efb19eb5c..12a381ec1 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java
@@ -228,8 +228,7 @@ class AsyncCompletionProposalPopup extends CompletionProposalPopup {
try {
processors= fContentAssistant.getContentAssistProcessors(getTokenContentType(invocationOffset));
} catch (BadLocationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ // ignore
}
if (processors == null) {
return Collections.emptyList();
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java
index 940dfcb45..0946f5d99 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java
@@ -492,7 +492,6 @@ public final class ChangeRulerColumn implements IChangeRulerColumn, IRevisionRul
if (lastLine < bottomLine || bottomLine == -1)
bottomLine= lastLine;
} catch (BadLocationException x) {
- x.printStackTrace();
return null;
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java
index 0d76668a9..0e7889b06 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/templates/persistence/TemplateStore.java
@@ -292,7 +292,7 @@ public class TemplateStore {
load();
} catch (IOException x) {
// can't log from jface-text
- x.printStackTrace();
+ handleException(x);
}
if (oldValue != null) {
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieProposalProcessor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieProposalProcessor.java
index a169e279a..b196c83ce 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieProposalProcessor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/HippieProposalProcessor.java
@@ -107,8 +107,7 @@ public final class HippieProposalProcessor implements IContentAssistProcessor {
String replacement= fString.substring(offset - fOffset);
document.replace(offset, 0, replacement);
} catch (BadLocationException x) {
- // TODO Auto-generated catch block
- x.printStackTrace();
+ // ignore
}
}
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java
index f783dcfb7..04987fc3b 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java
@@ -48,6 +48,8 @@ import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -1307,7 +1309,8 @@ public abstract class AbstractTemplatesPage extends Page implements ITemplatesPa
try {
getTemplateStore().save();
} catch (IOException e) {
- e.printStackTrace();
+ TextEditorPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID,
+ TemplatesMessages.TemplatesPage_save_error_message, e));
MessageDialog.openError(getShell(),
TemplatesMessages.TemplatesPage_save_error_message, e.getMessage());
}

Back to the top