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
This commit is contained in:
Andy Clement
2012-08-03 10:41:19 -07:00
committed by Sam Brannen
parent 529e62921d
commit a7418f480c
3 changed files with 134 additions and 120 deletions

View File

@@ -513,7 +513,7 @@ class InternalSpelExpressionParser extends TemplateAwareExpressionParser {
private boolean maybeEatNullReference() {
if (peekToken(TokenKind.IDENTIFIER)) {
Token nullToken = peekToken();
if (!nullToken.stringValue().equals("null")) {
if (!nullToken.stringValue().toLowerCase().equals("null")) {
return false;
}
nextToken();