From 4cfac8006412037e5fc17f478dce7ac25d641348 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 27 Apr 2017 19:58:23 +0300 Subject: [PATCH] vcs: remove VcsDirtyScopeManagerProxy it was introduced in 913d97bb21ad7ef92cff10d9c1c2bf6c1a74d1df not longer needed after c96dbc29e93052279418aaeb442de0e7258b3893 as the guarding lock was removed --- .../vcs/changes/UpdateRequestsQueue.java | 9 +- .../changes/VcsDirtyScopeManagerProxy.java | 129 ------------------ 2 files changed, 2 insertions(+), 136 deletions(-) delete mode 100644 platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeManagerProxy.java diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java index 351f56719f1b..bc77f23c1199 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UpdateRequestsQueue.java @@ -177,13 +177,8 @@ public class UpdateRequestsQueue { LOG.debug("invokeAfterUpdate for project: " + myProject.getName()); final CallbackData data = CallbackData.create(myProject, mode, afterUpdate, title, state); - if (dirtyScopeManagerFiller != null) { - VcsDirtyScopeManagerProxy managerProxy = new VcsDirtyScopeManagerProxy(); - - dirtyScopeManagerFiller.consume(managerProxy); - if (!myProject.isDisposed()) { - managerProxy.callRealManager(VcsDirtyScopeManager.getInstance(myProject)); - } + if (dirtyScopeManagerFiller != null && !myProject.isDisposed()) { + dirtyScopeManagerFiller.consume(VcsDirtyScopeManager.getInstance(myProject)); } boolean stopped; diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeManagerProxy.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeManagerProxy.java deleted file mode 100644 index 5be4bcf3dced..000000000000 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/VcsDirtyScopeManagerProxy.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.openapi.vcs.changes; - -import com.intellij.openapi.vcs.FilePath; -import com.intellij.openapi.vfs.VirtualFile; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -/** - * to do not allow user to perform unknown activity under lock, pass mock manager - * use it later to call real manager under lock - */ -class VcsDirtyScopeManagerProxy extends VcsDirtyScopeManager { - private boolean myEverythingDirty; - // no grouping etc., let real manager do stuff - private final Set myVFiles; - private final Set myVDirs; - private final Set myFiles; - private final Set myDirs; - - VcsDirtyScopeManagerProxy() { - myEverythingDirty = false; - - myVFiles = new HashSet<>(); - myVDirs = new HashSet<>(); - myFiles = new HashSet<>(); - myDirs = new HashSet<>(); - } - - public void markEverythingDirty() { - myEverythingDirty = true; - - myVDirs.clear(); - myVFiles.clear(); - myDirs.clear(); - myFiles.clear(); - } - - public void fileDirty(@NotNull final VirtualFile file) { - myVFiles.add(file); - } - - public void fileDirty(@NotNull final FilePath file) { - myFiles.add(file); - } - - public void dirDirtyRecursively(final VirtualFile dir, final boolean scheduleUpdate) { - myVDirs.add(dir); - } - - public void dirDirtyRecursively(final VirtualFile dir) { - myVDirs.add(dir); - } - - public void dirDirtyRecursively(final FilePath path) { - myDirs.add(path); - } - - public VcsInvalidated retrieveScopes() { - throw new UnsupportedOperationException(); - } - - @NotNull - @Override - public Collection whatFilesDirty(@NotNull Collection files) { - throw new UnsupportedOperationException(); - } - - public void filePathsDirty(@Nullable final Collection filesDirty, @Nullable final Collection dirsRecursivelyDirty) { - if (filesDirty != null) { - myFiles.addAll(filesDirty); - } - if (dirsRecursivelyDirty != null) { - myDirs.addAll(dirsRecursivelyDirty); - } - } - - public void filesDirty(@Nullable final Collection filesDirty, @Nullable final Collection dirsRecursivelyDirty) { - if (filesDirty != null) { - myVFiles.addAll(filesDirty); - } - if (dirsRecursivelyDirty != null) { - myVDirs.addAll(dirsRecursivelyDirty); - } - } - - public void callRealManager(final VcsDirtyScopeManager manager) { - if (myEverythingDirty) { - manager.markEverythingDirty(); - return; - } - - for (FilePath file : myFiles) { - manager.fileDirty(file); - } - for (VirtualFile file : myVFiles) { - manager.fileDirty(file); - } - for (FilePath dir : myDirs) { - manager.dirDirtyRecursively(dir); - } - for (VirtualFile dir : myVDirs) { - manager.dirDirtyRecursively(dir); - } - } - - @Override - public void changesProcessed() { - throw new UnsupportedOperationException(); - } -}