migrate more usages of deprecated com.intellij.util.containers.HashMap/Set to java.util

This commit is contained in:
peter
2018-01-23 23:39:14 +01:00
parent b0e0f9a769
commit 7ad81e7906
9 changed files with 35 additions and 80 deletions

View File

@@ -23,6 +23,7 @@ import com.intellij.psi.PsiField;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiMethod;
import com.intellij.util.ArrayUtil;
import com.intellij.util.CommonProcessors;
import com.intellij.util.Processor;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.containers.HashSet;
@@ -31,6 +32,8 @@ import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
/**
* Allows to retrieve files and Java classes, methods and fields in a project by non-qualified names.
*/
@@ -100,8 +103,12 @@ public abstract class PsiShortNamesCache {
* to the specified set.
*
* @param dest the set to add the names to.
* @see #processAllClassNames
*/
public abstract void getAllClassNames(@NotNull HashSet<String> dest);
@Deprecated
public void getAllClassNames(@NotNull HashSet<String> dest) {
processAllClassNames(new CommonProcessors.CollectProcessor<>(dest));
}
/**
* Returns the list of all methods with the specified name in the specified scope.
@@ -147,8 +154,12 @@ public abstract class PsiShortNamesCache {
* to the specified set.
*
* @param set the set to add the names to.
* @see #processAllMethodNames
*/
public abstract void getAllMethodNames(@NotNull HashSet<String> set);
@Deprecated
public void getAllMethodNames(@NotNull HashSet<String> set) {
Collections.addAll(set, getAllMethodNames());
}
/**
* Returns the list of all fields with the specified name in the specified scope.
@@ -174,8 +185,12 @@ public abstract class PsiShortNamesCache {
* to the specified set.
*
* @param set the set to add the names to.
* @see #processAllFieldNames
*/
public abstract void getAllFieldNames(@NotNull HashSet<String> set);
@Deprecated
public void getAllFieldNames(@NotNull HashSet<String> set) {
Collections.addAll(set, getAllFieldNames());
}
public boolean processFieldsWithName(@NotNull String name,
@NotNull Processor<? super PsiField> processor,