Cleanup (formatting)

This commit is contained in:
Roman Shevchenko
2017-07-11 20:15:13 +02:00
parent f6645e484e
commit 1c8c3facb4
2 changed files with 4 additions and 6 deletions
@@ -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