variable.getUseScope() removed from ReferencesSearch (IDEA-CR-14823)

This commit is contained in:
Tagir Valeev
2016-10-27 10:49:26 +07:00
parent 60b6d1093a
commit a71f76403a
8 changed files with 10 additions and 10 deletions
@@ -849,7 +849,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
return null;
}
if (!(nextElement instanceof PsiReturnStatement) && !ReferencesSearch.search(collectionVariable, collectionVariable.getUseScope())
if (!(nextElement instanceof PsiReturnStatement) && !ReferencesSearch.search(collectionVariable)
.forEach(ref ->
ref.getElement() == collectionVariable || PsiTreeUtil.isAncestor(statement, ref.getElement(), false) ||
PsiTreeUtil.isAncestor(toArrayCandidate, ref.getElement(), false)
@@ -1120,7 +1120,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
PsiElement element = ((PsiReferenceExpression)lValue).resolve();
if(!(element instanceof PsiLocalVariable)) return null;
PsiLocalVariable var = (PsiLocalVariable)element;
if(!ReferencesSearch.search(var, var.getUseScope()).forEach(ref -> {
if(!ReferencesSearch.search(var).forEach(ref -> {
return PsiTreeUtil.isAncestor(whileLoop, ref.getElement(), true);
})) {
return null;
@@ -84,7 +84,7 @@ public class InlineLocalHandler extends JavaInlineActionHandler {
final List<PsiElement> innerClassesWithUsages = Collections.synchronizedList(new ArrayList<PsiElement>());
final List<PsiElement> innerClassUsages = Collections.synchronizedList(new ArrayList<PsiElement>());
final PsiClass containingClass = PsiTreeUtil.getParentOfType(local, PsiClass.class);
final Query<PsiReference> query = ReferencesSearch.search(local, local.getUseScope());
final Query<PsiReference> query = ReferencesSearch.search(local);
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> {
if (query.findFirst() == null){
LOG.assertTrue(refExpr == null);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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.
@@ -577,7 +577,7 @@ class TypeMigrationStatementProcessor extends JavaRecursiveElementVisitor {
final PsiExpression rExpression = assignment.getRExpression();
if (rExpression == null) return null;
assignment.replace(rExpression);
if (ReferencesSearch.search(var, var.getUseScope()).forEach(new CommonProcessors.FindFirstProcessor<>())) {
if (ReferencesSearch.search(var).forEach(new CommonProcessors.FindFirstProcessor<>())) {
var.delete();
}
}