Simplify if-statements with instanceof checks

Closes gh-25449
This commit is contained in:
XenoAmess
2020-07-22 16:34:27 +08:00
committed by GitHub
parent c7f44ff671
commit 3b12beb1b8
10 changed files with 10 additions and 11 deletions

View File

@@ -62,7 +62,7 @@ public class OperatorInstanceof extends Operator {
Object leftValue = left.getValue();
Object rightValue = right.getValue();
BooleanTypedValue result;
if (rightValue == null || !(rightValue instanceof Class)) {
if (!(rightValue instanceof Class)) {
throw new SpelEvaluationException(getRightOperand().getStartPosition(),
SpelMessage.INSTANCEOF_OPERATOR_NEEDS_CLASS_OPERAND,
(rightValue == null ? "null" : rightValue.getClass().getName()));