Skip to content

Commit 2ec39f5

Browse files
committed
TypedValue.NULL_TYPED_VALUE -> TypedValue.NULL
1 parent dc99df2 commit 2ec39f5

File tree

13 files changed

+23
-23
lines changed

13 files changed

+23
-23
lines changed

org.springframework.expression/src/main/java/org/springframework/expression/TypedValue.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
*/
2929
public class TypedValue {
3030

31-
public static final TypedValue NULL_TYPED_VALUE = new TypedValue(null, TypeDescriptor.NULL);
31+
public static final TypedValue NULL = new TypedValue(null, TypeDescriptor.NULL);
3232

3333

3434
private final Object value;
3535

3636
private TypeDescriptor typeDescriptor;
37-
37+
3838

3939
/**
4040
* Create a TypedValue for a simple object. The type descriptor is inferred
@@ -43,9 +43,9 @@ public class TypedValue {
4343
*/
4444
public TypedValue(Object value) {
4545
this.value = value;
46-
this.typeDescriptor = null;// initialized when/if requested
46+
this.typeDescriptor = null; // initialized when/if requested
4747
}
48-
48+
4949
/**
5050
* Create a TypedValue for a particular value with a particular type descriptor.
5151
* @param value the object value
@@ -62,8 +62,8 @@ public Object getValue() {
6262
}
6363

6464
public TypeDescriptor getTypeDescriptor() {
65-
if (this.typeDescriptor==null) {
66-
this.typeDescriptor = TypeDescriptor.forObject(value);
65+
if (this.typeDescriptor == null) {
66+
this.typeDescriptor = TypeDescriptor.forObject(this.value);
6767
}
6868
return this.typeDescriptor;
6969
}

org.springframework.expression/src/main/java/org/springframework/expression/spel/ExpressionState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void setVariable(String name, Object value) {
121121
public TypedValue lookupVariable(String name) {
122122
Object value = this.relatedContext.lookupVariable(name);
123123
if (value == null) {
124-
return TypedValue.NULL_TYPED_VALUE;
124+
return TypedValue.NULL;
125125
}
126126
else {
127127
return new TypedValue(value, TypeDescriptor.forObject(value));

org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public TypedValue getValueInternal(ExpressionState state) throws EvaluationExcep
6363
}
6464
if (currentContext.getValue() == null) {
6565
if (nullSafe) {
66-
return TypedValue.NULL_TYPED_VALUE;
66+
return TypedValue.NULL;
6767
} else {
6868
throw new SpelEvaluationException(getStartPosition(), SpelMessage.METHOD_CALL_ON_NULL_OBJECT_NOT_ALLOWED,
6969
FormatHelper.formatMethodForMessage(name, getTypes(arguments)));

org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/NullLiteral.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public NullLiteral(int pos) {
3030

3131
@Override
3232
public TypedValue getLiteralValue() {
33-
return TypedValue.NULL_TYPED_VALUE;
33+
return TypedValue.NULL;
3434
}
3535

3636
@Override

org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/OpAnd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public TypedValue getValueInternal(ExpressionState state) throws EvaluationExcep
7070
}
7171

7272
private void assertTypedValueNotNull(TypedValue typedValue) {
73-
if (TypedValue.NULL_TYPED_VALUE.equals(typedValue)) {
73+
if (TypedValue.NULL.equals(typedValue)) {
7474
throw new SpelEvaluationException(SpelMessage.TYPE_CONVERSION_ERROR, "null", "boolean");
7575
}
7676
}

org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/OpOr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public BooleanTypedValue getValueInternal(ExpressionState state) throws Evaluati
6969
}
7070

7171
private void assertTypedValueNotNull(TypedValue typedValue) {
72-
if (TypedValue.NULL_TYPED_VALUE.equals(typedValue)) {
72+
if (TypedValue.NULL.equals(typedValue)) {
7373
throw new SpelEvaluationException(SpelMessage.TYPE_CONVERSION_ERROR, "null", "boolean");
7474
}
7575
}

org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/OperatorNot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public OperatorNot(int pos, SpelNodeImpl operand) {
4141
public BooleanTypedValue getValueInternal(ExpressionState state) throws EvaluationException {
4242
try {
4343
TypedValue typedValue = children[0].getValueInternal(state);
44-
if (TypedValue.NULL_TYPED_VALUE.equals(typedValue)) {
44+
if (TypedValue.NULL.equals(typedValue)) {
4545
throw new SpelEvaluationException(SpelMessage.TYPE_CONVERSION_ERROR, "null", "boolean");
4646
}
4747
boolean value = (Boolean) state.convertValue(typedValue, TypeDescriptor.valueOf(Boolean.class));

org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/Projection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public TypedValue getValueInternal(ExpressionState state) throws EvaluationExcep
109109
} else {
110110
if (operand==null) {
111111
if (nullSafe) {
112-
return TypedValue.NULL_TYPED_VALUE;
112+
return TypedValue.NULL;
113113
} else {
114114
throw new SpelEvaluationException(getStartPosition(),SpelMessage.PROJECTION_NOT_SUPPORTED_ON_TYPE, "null");
115115
}

org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/PropertyOrFieldReference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private TypedValue readProperty(ExpressionState state, String name) throws Evalu
136136
Object targetObject = contextObject.getValue();
137137

138138
if (targetObject == null && nullSafe) {
139-
return TypedValue.NULL_TYPED_VALUE;
139+
return TypedValue.NULL;
140140
}
141141

142142
PropertyAccessor accessorToUse = this.cachedReadAccessor;

org.springframework.expression/src/main/java/org/springframework/expression/spel/ast/Selection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public TypedValue getValueInternal(ExpressionState state) throws EvaluationExcep
133133
}
134134
}
135135
if ((variant == FIRST || variant == LAST) && result.size() == 0) {
136-
return TypedValue.NULL_TYPED_VALUE;
136+
return TypedValue.NULL;
137137
}
138138
if (variant == LAST) {
139139
return new TypedValue(result.get(result.size() - 1),TypeDescriptor.valueOf(op.getTypeDescriptor().getElementType()));
@@ -150,7 +150,7 @@ public TypedValue getValueInternal(ExpressionState state) throws EvaluationExcep
150150
} else {
151151
if (operand==null) {
152152
if (nullSafe) {
153-
return TypedValue.NULL_TYPED_VALUE;
153+
return TypedValue.NULL;
154154
} else {
155155
throw new SpelEvaluationException(getStartPosition(), SpelMessage.INVALID_TYPE_FOR_SELECTION,
156156
"null");

0 commit comments

Comments
 (0)