IDEA-210339 AE at com.intellij.ide.plugins.newui.PluginUpdatesService.recalculateUpdates

EA-142902

GitOrigin-RevId: 5ddc215c041d32f2aba276d5b06690d9c671b1c7
This commit is contained in:
Alexander Lobas
2019-05-21 19:14:47 +03:00
committed by intellij-monorepo-bot
parent b5500da75c
commit 42b1f5ae3e
@@ -26,6 +26,7 @@ public class PluginUpdatesService {
private static Collection<PluginDownloader> myCache;
private static boolean myPrepared;
private static boolean myPreparing;
private static boolean myReset;
private Consumer<Integer> myTreeCallback;
private Consumer<Integer> myTabCallback;
@@ -117,13 +118,21 @@ public class PluginUpdatesService {
public void recalculateUpdates() {
checkAccess();
assert !myPreparing;
for (PluginUpdatesService service : SERVICES) {
service.runAllCallbacks(0);
}
calculateUpdates();
if (myPreparing) {
resetUpdates();
}
else {
calculateUpdates();
}
}
private static void resetUpdates() {
myReset = true;
}
public void dispose() {
@@ -178,6 +187,13 @@ public class PluginUpdatesService {
checkAccess();
myPreparing = false;
if (myReset) {
myReset = false;
calculateUpdates();
return;
}
myPrepared = true;
myCache = updates;