diagnostics

This commit is contained in:
Alexey Kudravtsev
2010-02-03 19:00:51 +03:00
parent f46dff8da3
commit 00aa44dda5
@@ -37,6 +37,7 @@ public class RangeMarkerImpl extends UserDataHolderBase implements RangeMarkerEx
private static final AtomicLong counter = new AtomicLong();
private final long myId;
private volatile int modCount;
protected RangeMarkerImpl(@NotNull DocumentEx document, int start, int end) {
if (start < 0) {
@@ -102,6 +103,7 @@ public class RangeMarkerImpl extends UserDataHolderBase implements RangeMarkerEx
}
public final void documentChanged(DocumentEvent e) {
int modCount = this.modCount++;
int oldStart = myStart;
int oldEnd = myEnd;
int docLength = myDocument.getTextLength();
@@ -119,7 +121,10 @@ public class RangeMarkerImpl extends UserDataHolderBase implements RangeMarkerEx
changedUpdateImpl(e);
if (isValid && (myStart > myEnd || myStart < 0 || myEnd > docLength)) {
LOG.error("RangeMarker" + (isExpandToLeft ? "[" : "(") + oldStart + ", " + oldEnd + (isExpandToRight ? "]" : ")") +
" update failed. Event = " + e + ". Result[" + myStart + ", " + myEnd + "], doc length=" + docLength + "; "+getClass());
" update failed. Event = " + e + ". Result[" + myStart + ", " + myEnd + "], " +
"old doc length=" + docLength + "; real doc length = "+myDocument.getTextLength()+
"; old mod count="+modCount+"; mod count="+this.modCount+
"; "+getClass());
isValid = false;
}
}