mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-41215 (check files before adding to refresh queue)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* 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.
|
||||
@@ -13,10 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @author max
|
||||
*/
|
||||
package com.intellij.openapi.vfs.newvfs;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -25,11 +21,15 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
*/
|
||||
public abstract class RefreshSession {
|
||||
public abstract boolean isAsynchronous();
|
||||
|
||||
public abstract void addFile(@NotNull VirtualFile file);
|
||||
public abstract void addAllFiles(Collection<VirtualFile> files);
|
||||
|
||||
public abstract void addAllFiles(@NotNull Collection<VirtualFile> files);
|
||||
|
||||
public void addAllFiles(@NotNull VirtualFile[] files) {
|
||||
addAllFiles(Arrays.asList(files));
|
||||
|
||||
@@ -71,12 +71,19 @@ public class RefreshSessionImpl extends RefreshSession {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAllFiles(final Collection<VirtualFile> files) {
|
||||
myWorkQueue.addAll(files);
|
||||
public void addAllFiles(@NotNull Collection<VirtualFile> files) {
|
||||
for (VirtualFile file : files) {
|
||||
if (file == null) {
|
||||
LOG.error("null passed among " + files);
|
||||
}
|
||||
else {
|
||||
myWorkQueue.add(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFile(@NotNull final VirtualFile file) {
|
||||
public void addFile(@NotNull VirtualFile file) {
|
||||
myWorkQueue.add(file);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user