EA-72290 - AIOOBE: LineSet.clearModificationFlags

This commit is contained in:
Aleksey Pivovarov
2015-09-04 14:43:24 +03:00
parent aba9734a6b
commit 3129f0d22f
@@ -184,10 +184,15 @@ public class LineSet{
}
LineSet clearModificationFlags(int startLine, int endLine) {
if (startLine == endLine) return this;
if (startLine > endLine) {
throw new IllegalArgumentException("endLine < startLine: " + endLine + " < " + startLine + "; lineCount: " + getLineCount());
}
checkLineIndex(startLine);
checkLineIndex(endLine - 1);
if (isLastEmptyLine(endLine - 1)) endLine--;
if (startLine >= endLine) return this;
byte[] flags = myFlags.clone();
for (int i = startLine; i < endLine; i++) {
flags[i] &= ~MODIFIED_MASK;