This commit is contained in:
Alexey Kudravtsev
2009-11-02 14:12:13 +03:00
parent 770d01f6ef
commit 45d9439622
@@ -66,6 +66,7 @@ import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
/**
* This class also controls the auto-reparse and auto-hints.
@@ -104,7 +105,7 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx
private StatusBarUpdater myStatusBarUpdater;
private final PassExecutorService myPassExecutorService;
private static final Key<List<HighlightInfo>> HIGHLIGHTS_TO_REMOVE_KEY = Key.create("HIGHLIGHTS_TO_REMOVE");
private final AtomicInteger myModificationCount = new AtomicInteger();
public DaemonCodeAnalyzerImpl(Project project, DaemonCodeAnalyzerSettings daemonCodeAnalyzerSettings, EditorTracker editorTracker) {
myProject = project;
@@ -338,9 +339,8 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx
return myFileStatusMap;
}
@TestOnly
public synchronized ProgressIndicator getUpdateProgress() {
return myUpdateProgress;
public int getModificationCount() {
return myModificationCount.get();
}
public synchronized boolean isRunning() {
@@ -358,6 +358,7 @@ public class DaemonCodeAnalyzerImpl extends DaemonCodeAnalyzer implements JDOMEx
private synchronized void cancelUpdateProgress(final boolean start, @NonNls String reason) {
PassExecutorService.log(myUpdateProgress, null, reason, start);
myModificationCount.incrementAndGet();
if (myUpdateProgress != null) {
myUpdateProgress.cancel();