Skip to content

Commit a7418f4

Browse files
aclementsbrannen
authored andcommitted
Support case-insensitive null literals in SpEL
Prior to this commit null literals in SpEL expressions had to be specified as "null" (i.e., all lowercase). With this commit null literals in SpEL expressions are interpreted in a case-insensitive manner, analogous to the current support for boolean literals. Issue: SPR-9613
1 parent 529e629 commit a7418f4

File tree

3 files changed

+134
-120
lines changed

3 files changed

+134
-120
lines changed

spring-expression/src/main/java/org/springframework/expression/spel/standard/InternalSpelExpressionParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ private boolean maybeEatTypeReference() {
513513
private boolean maybeEatNullReference() {
514514
if (peekToken(TokenKind.IDENTIFIER)) {
515515
Token nullToken = peekToken();
516-
if (!nullToken.stringValue().equals("null")) {
516+
if (!nullToken.stringValue().toLowerCase().equals("null")) {
517517
return false;
518518
}
519519
nextToken();

0 commit comments

Comments
 (0)