mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IPP: use streams
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2003-2005 Dave Griffith
|
||||
* Copyright 2003-2017 Dave Griffith, Bas Leijdekkers
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,11 +17,12 @@ package com.siyeh.ipp.bool;
|
||||
|
||||
import com.intellij.psi.JavaTokenType;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiExpression;
|
||||
import com.intellij.psi.PsiPolyadicExpression;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.siyeh.ipp.base.PsiElementPredicate;
|
||||
import com.siyeh.ipp.psiutils.ErrorUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
class ConjunctionPredicate implements PsiElementPredicate {
|
||||
|
||||
@@ -34,14 +35,7 @@ class ConjunctionPredicate implements PsiElementPredicate {
|
||||
if (!tokenType.equals(JavaTokenType.ANDAND) && !tokenType.equals(JavaTokenType.OROR)) {
|
||||
return false;
|
||||
}
|
||||
if (ErrorUtil.containsError(expression)) {
|
||||
return false;
|
||||
}
|
||||
for (PsiExpression operand : expression.getOperands()) {
|
||||
if (ErrorUtil.containsError(operand)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return !PsiUtilCore.hasErrorElementChild(expression) &&
|
||||
Arrays.stream(expression.getOperands()).noneMatch(PsiUtilCore::hasErrorElementChild);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user