mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
more robust tests
This commit is contained in:
@@ -150,13 +150,22 @@ public class FileStatusMap implements Disposable {
|
||||
}
|
||||
|
||||
public void markAllFilesDirty() {
|
||||
assert myAllowDirt;
|
||||
assertAllowModifications();
|
||||
LOG.debug("********************************* Mark all dirty");
|
||||
synchronized (myDocumentToStatusMap) {
|
||||
myDocumentToStatusMap.clear();
|
||||
}
|
||||
}
|
||||
|
||||
private void assertAllowModifications() {
|
||||
try {
|
||||
assert myAllowDirt;
|
||||
}
|
||||
finally {
|
||||
myAllowDirt = true; //give next test a chance
|
||||
}
|
||||
}
|
||||
|
||||
public void markFileUpToDate(@NotNull Document document, @NotNull PsiFile file, int passId) {
|
||||
synchronized(myDocumentToStatusMap){
|
||||
FileStatus status = myDocumentToStatusMap.get(document);
|
||||
@@ -204,7 +213,7 @@ public class FileStatusMap implements Disposable {
|
||||
}
|
||||
|
||||
public void markFileScopeDirty(@NotNull Document document, int passId) {
|
||||
assert myAllowDirt;
|
||||
assertAllowModifications();
|
||||
synchronized(myDocumentToStatusMap){
|
||||
FileStatus status = myDocumentToStatusMap.get(document);
|
||||
if (status == null){
|
||||
@@ -226,7 +235,7 @@ public class FileStatusMap implements Disposable {
|
||||
}
|
||||
|
||||
public void markFileScopeDirtyDefensively(@NotNull PsiFile file) {
|
||||
assert myAllowDirt;
|
||||
assertAllowModifications();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("********************************* Mark dirty file defensively: "+file.getName());
|
||||
}
|
||||
@@ -242,7 +251,7 @@ public class FileStatusMap implements Disposable {
|
||||
}
|
||||
|
||||
public void markFileScopeDirty(@NotNull Document document, @NotNull TextRange scope, int fileLength) {
|
||||
assert myAllowDirt;
|
||||
assertAllowModifications();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("********************************* Mark dirty: "+scope);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user