mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-72290 - AIOOBE: LineSet.clearModificationFlags
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user