mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
refactorings processors are short living objects and thus can't leak data GitOrigin-RevId: 926db62710964be0a162a08cd9307ed4ecf07dea
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4ca188384d
commit
102b188350
+3
-2
@@ -24,13 +24,13 @@ import com.intellij.usageView.UsageInfo;
|
||||
import com.intellij.usageView.UsageInfoFactory;
|
||||
import com.intellij.usageView.UsageViewDescriptor;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author ven
|
||||
@@ -43,6 +43,7 @@ public class InlineConstantFieldProcessor extends BaseRefactoringProcessor {
|
||||
private final boolean mySearchInCommentsAndStrings;
|
||||
private final boolean mySearchForTextOccurrences;
|
||||
private final boolean myDeleteDeclaration;
|
||||
@SuppressWarnings("LeakableMapKey") //short living refactoring
|
||||
private Map<Language, InlineHandler.Inliner> myInliners;
|
||||
|
||||
public InlineConstantFieldProcessor(PsiField field, Project project, PsiElement ref, boolean isInlineThisOnly) {
|
||||
@@ -291,7 +292,7 @@ public class InlineConstantFieldProcessor extends BaseRefactoringProcessor {
|
||||
}
|
||||
}
|
||||
if (element instanceof PsiLiteralExpression &&
|
||||
Stream.of(element.getReferences()).anyMatch(JavaLangClassMemberReference.class::isInstance)) {
|
||||
ContainerUtil.or(element.getReferences(), JavaLangClassMemberReference.class::isInstance)) {
|
||||
conflicts.putValue(element, JavaRefactoringBundle.message("inline.field.used.in.reflection"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.intellij.usageView.UsageViewDescriptor;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.JavaPsiConstructorUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import com.siyeh.ig.psiutils.CommentTracker;
|
||||
import com.siyeh.ig.psiutils.SideEffectChecker;
|
||||
@@ -55,7 +56,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.intellij.util.ObjectUtils.tryCast;
|
||||
|
||||
@@ -80,6 +80,7 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
|
||||
private final String myDescriptiveName;
|
||||
private Map<PsiField, PsiClassInitializer> myAddedClassInitializers;
|
||||
private PsiMethod myMethodCopy;
|
||||
@SuppressWarnings("LeakableMapKey") //short living refactoring
|
||||
private Map<Language,InlineHandler.Inliner> myInliners;
|
||||
|
||||
public InlineMethodProcessor(@NotNull Project project,
|
||||
@@ -235,7 +236,7 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
|
||||
conflicts.putValue(element, JavaRefactoringBundle.message("inline.method.used.in.javadoc"));
|
||||
}
|
||||
if (element instanceof PsiLiteralExpression &&
|
||||
Stream.of(element.getReferences()).anyMatch(JavaLangClassMemberReference.class::isInstance)) {
|
||||
ContainerUtil.or(element.getReferences(), JavaLangClassMemberReference.class::isInstance)) {
|
||||
conflicts.putValue(element, JavaRefactoringBundle.message("inline.method.used.in.reflection"));
|
||||
}
|
||||
if (element instanceof PsiMethodReferenceExpression) {
|
||||
|
||||
Reference in New Issue
Block a user