get rid of getPsiRoots() usages since they are indeterminate

This commit is contained in:
Alexey Kudravtsev
2012-02-08 16:29:35 +04:00
parent deb6850e59
commit 57f889295b
16 changed files with 84 additions and 67 deletions
@@ -34,6 +34,8 @@ import gnu.trove.TIntProcedure;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
/**
* @author ven
*/
@@ -104,7 +106,7 @@ public class AddOnDemandStaticImportAction extends PsiElementBaseIntentionAction
}
importList.add(importStaticStatement);
PsiFile[] roots = file.getPsiRoots();
List<PsiFile> roots = file.getViewProvider().getAllFiles();
for (final PsiFile root : roots) {
PsiElement copy = root.copy();
final PsiManager manager = root.getManager();
@@ -696,7 +696,7 @@ public class ImportHelper{
PsiFile context) {
String packageName = file.getPackageName();
final PsiElement[] roots = file.getPsiRoots();
final List<PsiFile> roots = file.getViewProvider().getAllFiles();
for (PsiElement root : roots) {
addNamesToImport(names, comments, root, packageName, context);
}
@@ -153,7 +153,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
}
else {
redundants = allImports;
final PsiElement[] roots = file.getPsiRoots();
final List<PsiFile> roots = file.getViewProvider().getAllFiles();
for (PsiElement root : roots) {
root.accept(new JavaRecursiveElementWalkingVisitor() {
@Override public void visitReferenceElement(PsiJavaCodeReferenceElement reference) {