mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
EA-49127 - assert: CachingSoftWrapDataMapper.onRecalculationEnd - added more diagnostics
This commit is contained in:
+20
-13
@@ -465,21 +465,12 @@ public class CachingSoftWrapDataMapper implements SoftWrapDataMapper, SoftWrapAw
|
||||
|| (beforeLast.visualLine + 1 == last.visualLine && last.startOffset - beforeLast.endOffset > 1)
|
||||
|| last.startOffset > myEditor.getDocument().getTextLength())
|
||||
{
|
||||
CharSequence editorState = "";
|
||||
if (myEditor instanceof EditorImpl) {
|
||||
editorState = ((EditorImpl)myEditor).dumpState();
|
||||
}
|
||||
LOG.error(
|
||||
"Detected invalid soft wraps cache update",
|
||||
String.format(
|
||||
"Event: %s, normal: %b.%n%nTail cache entries: %s%n%nAffected by change cache entries: %s%n%nBefore change state: %s%n%n"
|
||||
+ "After change state: %s%n%nEditor state: %s",
|
||||
event, normal, myNotAffectedByUpdateTailCacheEntries, myAffectedByUpdateCacheEntries,
|
||||
myBeforeChangeState, myAfterChangeState, editorState
|
||||
)
|
||||
);
|
||||
logInvalidUpdate(event, normal);
|
||||
}
|
||||
}
|
||||
if (!myCache.isEmpty() && myEditor.getDocument().getTextLength() == 0) {
|
||||
logInvalidUpdate(event, normal);
|
||||
}
|
||||
|
||||
myAffectedByUpdateCacheEntries.clear();
|
||||
myNotAffectedByUpdateTailCacheEntries.clear();
|
||||
@@ -492,6 +483,22 @@ public class CachingSoftWrapDataMapper implements SoftWrapDataMapper, SoftWrapAw
|
||||
myBeforeChangeState.cacheShouldBeUpdated = false;
|
||||
}
|
||||
|
||||
private void logInvalidUpdate(@NotNull IncrementalCacheUpdateEvent event, boolean normal) {
|
||||
CharSequence editorState = "";
|
||||
if (myEditor instanceof EditorImpl) {
|
||||
editorState = ((EditorImpl)myEditor).dumpState();
|
||||
}
|
||||
LOG.error(
|
||||
"Detected invalid soft wraps cache update",
|
||||
String.format(
|
||||
"Event: %s, normal: %b.%n%nTail cache entries: %s%n%nAffected by change cache entries: %s%n%nBefore change state: %s%n%n"
|
||||
+ "After change state: %s%n%nEditor state: %s",
|
||||
event, normal, myNotAffectedByUpdateTailCacheEntries, myAffectedByUpdateCacheEntries,
|
||||
myBeforeChangeState, myAfterChangeState, editorState
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
myCache.clear();
|
||||
|
||||
Reference in New Issue
Block a user