Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java
index 299e9c647..d8e12d815 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java
@@ -132,8 +132,11 @@ abstract class ListLineTracker implements ILineTracker {
@Override
public final int getLineNumberOfOffset(int position) throws BadLocationException {
- if (position < 0 || position > fTextLength)
- throw new BadLocationException();
+ if (position < 0) {
+ throw new BadLocationException("Negative offset : " + position); //$NON-NLS-1$
+ } else if (position > fTextLength) {
+ throw new BadLocationException("Offset > length: " + position + " > " + fTextLength); //$NON-NLS-1$//$NON-NLS-2$
+ }
if (position == fTextLength) {
@@ -151,7 +154,7 @@ abstract class ListLineTracker implements ILineTracker {
@Override
public final IRegion getLineInformationOfOffset(int position) throws BadLocationException {
if (position > fTextLength)
- throw new BadLocationException();
+ throw new BadLocationException("Offset > length: " + position + " > " + fTextLength); //$NON-NLS-1$//$NON-NLS-2$
if (position == fTextLength) {
int size= fLines.size();

Back to the top