mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 00:38:56 +00:00
Add message to IndexOutOfBoundsException in InternalNodeModelUtils (#1542)
Signed-off-by: Titouan Vervack <titouan.vervack@sigasi.com>
This commit is contained in:
parent
d6a96a8960
commit
a797694299
1 changed files with 3 additions and 3 deletions
|
@ -15,6 +15,7 @@ import java.util.List;
|
|||
import org.eclipse.xtext.nodemodel.INode;
|
||||
import org.eclipse.xtext.util.LineAndColumn;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
|
@ -57,9 +58,8 @@ public class InternalNodeModelUtils {
|
|||
* that point to the very first char in each line.
|
||||
*/
|
||||
protected static LineAndColumn getLineAndColumn(String text, int[] lineBreaks, int offset) {
|
||||
if (offset > text.length() || offset < 0) {
|
||||
throw new IndexOutOfBoundsException();
|
||||
}
|
||||
Preconditions.checkPositionIndex(offset, text.length());
|
||||
|
||||
int idx = Arrays.binarySearch(lineBreaks, offset);
|
||||
if (idx >= 0) {
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue