Bug 575509 - IllegalArgumentException in OverviewRuler.doPaint

Change-Id: Ic75b78a48eb00576ef5f30df9c659fbdb7c3a1b2
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/184239
Reviewed-by: Mickael Istria <mistria@redhat.com>
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java
index 14693a3..74e7ce7 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java
@@ -815,7 +815,9 @@
 							gc.setLineWidth(0); // NOTE: 0 means width is 1 but with optimized performance
 							gc.drawRectangle(r);
 						}
-					} catch (BadLocationException x) {
+					} catch (BadLocationException | IllegalArgumentException x) {
+						// We don't care if the widget's content is changed since the annotation was created
+						// and do not match the annotation line/offset etc
 					}
 				}
 			}