Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-02-02 08:59:04 +0000
committerAndrey Loskutov2017-02-02 20:21:07 +0000
commit7a0eb42a180d25360a95657e2727e17b7d6d2132 (patch)
treeabec7b09df9cfa5109d91e585078fcdcb164c498
parent987947306302e3c4960fc6f7d57b82e2a5a2435a (diff)
downloadeclipse.platform.text-7a0eb42a180d25360a95657e2727e17b7d6d2132.tar.gz
eclipse.platform.text-7a0eb42a180d25360a95657e2727e17b7d6d2132.tar.xz
eclipse.platform.text-7a0eb42a180d25360a95657e2727e17b7d6d2132.zip
Bug 325434 - [rulers] ArrayIndexOutOfBoundsException inI20170202-2000
LineNumberRulerColumn.paintLine If the paint request has line with higher index, just don't paint, our internal state is not up-to-date with the document. Change-Id: I04c04d7030d790bfcf352182d596e883adde6779 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
index d0671754d..b26f78ac2 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
@@ -841,7 +841,12 @@ public class LineNumberRulerColumn implements IVerticalRulerColumn {
int widgetLine= JFaceTextUtil.modelLineToWidgetLine(fCachedTextViewer, line);
String s= createDisplayString(line);
- int indentation= fIndentation[s.length()];
+ int index= s.length();
+ if (index >= fIndentation.length) {
+ // Bug 325434: our data is not in-sync with the document, don't try to paint
+ return;
+ }
+ int indentation= fIndentation[index];
int baselineBias= getBaselineBias(gc, widgetLine);
gc.drawString(s, indentation, y + baselineBias, true);
}

Back to the top