Revise PropertyOrFieldReference since isNullSafe() is not final
This commit is contained in:
parent
c7c61e13e1
commit
d4495a5654
|
|
@ -181,7 +181,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
|
||||||
throws EvaluationException {
|
throws EvaluationException {
|
||||||
|
|
||||||
Object targetObject = contextObject.getValue();
|
Object targetObject = contextObject.getValue();
|
||||||
if (targetObject == null && this.nullSafe) {
|
if (targetObject == null && isNullSafe()) {
|
||||||
return TypedValue.NULL;
|
return TypedValue.NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -233,7 +233,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
|
||||||
TypedValue contextObject, EvaluationContext evalContext, String name, @Nullable Object newValue)
|
TypedValue contextObject, EvaluationContext evalContext, String name, @Nullable Object newValue)
|
||||||
throws EvaluationException {
|
throws EvaluationException {
|
||||||
|
|
||||||
if (contextObject.getValue() == null && this.nullSafe) {
|
if (contextObject.getValue() == null && isNullSafe()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (contextObject.getValue() == null) {
|
if (contextObject.getValue() == null) {
|
||||||
|
|
@ -353,7 +353,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
Label skipIfNull = null;
|
Label skipIfNull = null;
|
||||||
if (this.nullSafe) {
|
if (isNullSafe()) {
|
||||||
mv.visitInsn(DUP);
|
mv.visitInsn(DUP);
|
||||||
skipIfNull = new Label();
|
skipIfNull = new Label();
|
||||||
Label continueLabel = new Label();
|
Label continueLabel = new Label();
|
||||||
|
|
@ -381,7 +381,7 @@ public class PropertyOrFieldReference extends SpelNodeImpl {
|
||||||
// If this property or field access would return a primitive - and yet
|
// If this property or field access would return a primitive - and yet
|
||||||
// it is also marked null safe - then the exit type descriptor must be
|
// it is also marked null safe - then the exit type descriptor must be
|
||||||
// promoted to the box type to allow a null value to be passed on
|
// promoted to the box type to allow a null value to be passed on
|
||||||
if (this.nullSafe && CodeFlow.isPrimitive(descriptor)) {
|
if (isNullSafe() && CodeFlow.isPrimitive(descriptor)) {
|
||||||
this.originalPrimitiveExitTypeDescriptor = descriptor;
|
this.originalPrimitiveExitTypeDescriptor = descriptor;
|
||||||
this.exitTypeDescriptor = CodeFlow.toBoxedDescriptor(descriptor);
|
this.exitTypeDescriptor = CodeFlow.toBoxedDescriptor(descriptor);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue