-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate StringUtils.isEmpty(Object) and replace remaining usage
Closes gh-25945
- Loading branch information
Showing
8 changed files
with
13 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
import org.springframework.expression.spel.ExpressionState; | ||
import org.springframework.util.Assert; | ||
import org.springframework.util.ObjectUtils; | ||
import org.springframework.util.StringUtils; | ||
|
||
/** | ||
* Represents the elvis operator ?:. For an expression "a?:b" if a is not null, the value | ||
|
@@ -52,7 +51,7 @@ public Elvis(int startPos, int endPos, SpelNodeImpl... args) { | |
public TypedValue getValueInternal(ExpressionState state) throws EvaluationException { | ||
TypedValue value = this.children[0].getValueInternal(state); | ||
// If this check is changed, the generateCode method will need changing too | ||
if (!StringUtils.isEmpty(value.getValue())) { | ||
if (value.getValue() != null && !"".equals(value.getValue())) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jhoeller
Author
Contributor
|
||
return value; | ||
} | ||
else { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It seems
ObjectUtils.isNotEmpty
should be used here. Or the javadoc should be updated to mention that an emptyString
is considered 'null' here (unlike, e.g. an emptyList
).