Polishing

This commit is contained in:
Juergen Hoeller
2017-07-19 23:55:47 +02:00
parent 12978b8185
commit c752ba5b38
28 changed files with 228 additions and 233 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@ import org.springframework.expression.spel.SpelEvaluationException;
import org.springframework.expression.spel.SpelMessage;
import org.springframework.expression.spel.support.BooleanTypedValue;
/**
* The operator 'instanceof' checks if an object is of the class specified in the right
* hand operand, in the same way that {@code instanceof} does in Java.
@@ -38,6 +37,7 @@ public class OperatorInstanceof extends Operator {
private Class<?> type;
public OperatorInstanceof(int pos, SpelNodeImpl... operands) {
super("instanceof", pos, operands);
}
@@ -47,8 +47,8 @@ public class OperatorInstanceof extends Operator {
* Compare the left operand to see it is an instance of the type specified as the
* right operand. The right operand must be a class.
* @param state the expression state
* @return true if the left operand is an instanceof of the right operand, otherwise
* false
* @return {@code true} if the left operand is an instanceof of the right operand,
* otherwise {@code false}
* @throws EvaluationException if there is a problem evaluating the expression
*/
@Override
@@ -58,7 +58,7 @@ public class OperatorInstanceof extends Operator {
TypedValue right = rightOperand.getValueInternal(state);
Object leftValue = left.getValue();
Object rightValue = right.getValue();
BooleanTypedValue result = null;
BooleanTypedValue result;
if (rightValue == null || !(rightValue instanceof Class)) {
throw new SpelEvaluationException(getRightOperand().getStartPosition(),
SpelMessage.INSTANCEOF_OPERATOR_NEEDS_CLASS_OPERAND,
@@ -96,7 +96,7 @@ public class OperatorInstanceof extends Operator {
mv.visitInsn(ICONST_0); // value of false
}
else {
mv.visitTypeInsn(INSTANCEOF,Type.getInternalName(this.type));
mv.visitTypeInsn(INSTANCEOF, Type.getInternalName(this.type));
}
cf.pushDescriptor(this.exitTypeDescriptor);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,11 +38,11 @@ public class TypeReference extends SpelNodeImpl {
public TypeReference(int pos, SpelNodeImpl qualifiedId) {
this(pos,qualifiedId,0);
this(pos, qualifiedId, 0);
}
public TypeReference(int pos, SpelNodeImpl qualifiedId, int dims) {
super(pos,qualifiedId);
super(pos, qualifiedId);
this.dimensions = dims;
}