vcs: Removed unnecessary "ConstantZipperUpdater"

Used "ZipperUpdater" directly instead.
This commit is contained in:
Konstantin Kolosovsky
2016-09-20 14:21:38 +03:00
parent dd28016dd2
commit 5af823ea8e
2 changed files with 5 additions and 47 deletions
@@ -1,42 +0,0 @@
/*
* Copyright 2000-2012 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;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.util.ZipperUpdater;
import com.intellij.util.Alarm;
import org.jetbrains.annotations.NotNull;
/**
* Created with IntelliJ IDEA.
* User: Irina.Chernushina
* Date: 4/11/12
* Time: 3:10 PM
*/
public class ConstantZipperUpdater {
private final ZipperUpdater myZipperUpdater;
private final Runnable myRunnable;
public ConstantZipperUpdater(final int delay, final Alarm.ThreadToUse threadToUse, @NotNull Disposable parentDisposable,
final Runnable runnable) {
myRunnable = runnable;
myZipperUpdater = new ZipperUpdater(delay, threadToUse, parentDisposable);
}
public void request() {
myZipperUpdater.queue(myRunnable);
}
}
@@ -20,7 +20,7 @@ import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vcs.ConstantZipperUpdater;
import com.intellij.openapi.util.ZipperUpdater;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vfs.VirtualFile;
@@ -45,10 +45,10 @@ public class VcsDirtyScopeVfsListener implements BulkFileListener, Disposable {
private boolean myForbid; // for tests only
private final ConstantZipperUpdater myZipperUpdater;
@NotNull private final ZipperUpdater myZipperUpdater;
private final List<FilesAndDirs> myQueue;
private final Object myLock;
private final Runnable myDirtReporter;
@NotNull private final Runnable myDirtReporter;
public VcsDirtyScopeVfsListener(@NotNull Project project,
@NotNull ProjectLevelVcsManager vcsManager,
@@ -77,7 +77,7 @@ public class VcsDirtyScopeVfsListener implements BulkFileListener, Disposable {
}
}
};
myZipperUpdater = new ConstantZipperUpdater(300, Alarm.ThreadToUse.POOLED_THREAD, this, myDirtReporter);
myZipperUpdater = new ZipperUpdater(300, Alarm.ThreadToUse.POOLED_THREAD, this);
Disposer.register(project, this);
project.getMessageBus().connect().subscribe(VirtualFileManager.VFS_CHANGES, this);
}
@@ -169,7 +169,7 @@ public class VcsDirtyScopeVfsListener implements BulkFileListener, Disposable {
synchronized (myLock) {
myQueue.add(dirtyFilesAndDirs);
}
myZipperUpdater.request();
myZipperUpdater.queue(myDirtReporter);
}
}