mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Cleanup (formatting)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 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.
|
||||
@@ -27,7 +27,7 @@ import java.util.Collections;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* @see com.intellij.psi.util.PsiTreeUtil#processElements(com.intellij.psi.PsiElement, PsiElementProcessor)
|
||||
* @see com.intellij.psi.util.PsiTreeUtil#processElements(PsiElement, PsiElementProcessor)
|
||||
*/
|
||||
public interface PsiElementProcessor<T extends PsiElement> {
|
||||
/**
|
||||
|
||||
@@ -789,15 +789,13 @@ public class PsiTreeUtil {
|
||||
|
||||
@SafeVarargs
|
||||
@NotNull
|
||||
public static <T extends PsiElement> Collection<T> collectElementsOfType(@Nullable final PsiElement element,
|
||||
@NotNull final Class<T>... classes) {
|
||||
public static <T extends PsiElement> Collection<T> collectElementsOfType(@Nullable PsiElement element, @NotNull Class<T>... classes) {
|
||||
CollectFilteredElements<T> processor = new CollectFilteredElements<>(element1 -> {
|
||||
for (Class<T> clazz : classes) {
|
||||
if (clazz.isInstance(element1)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
processElements(element, processor);
|
||||
@@ -805,7 +803,7 @@ public class PsiTreeUtil {
|
||||
}
|
||||
|
||||
@Contract("null, _ -> true")
|
||||
public static boolean processElements(@Nullable PsiElement element, @NotNull final PsiElementProcessor processor) {
|
||||
public static boolean processElements(@Nullable PsiElement element, @NotNull PsiElementProcessor processor) {
|
||||
if (element == null) return true;
|
||||
if (element instanceof PsiCompiledElement || !element.isPhysical()) { // DummyHolders cannot be visited by walking visitors because children/parent relationship is broken there
|
||||
//noinspection unchecked
|
||||
|
||||
Reference in New Issue
Block a user