File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
java/org/apache/el/parser Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 1919
2020import java .util .Collection ;
2121import java .util .Map ;
22+ import java .util .Optional ;
2223
2324import jakarta .el .ELException ;
2425
@@ -52,7 +53,8 @@ public Object getValue(EvaluationContext ctx) throws ELException {
5253 if (obj == null || obj instanceof String && ((String ) obj ).isEmpty () ||
5354 obj instanceof Object [] && ((Object []) obj ).length == 0 ||
5455 obj instanceof Collection <?> && ((Collection <?>) obj ).isEmpty () ||
55- obj instanceof Map <?,?> && ((Map <?,?>) obj ).isEmpty ()) {
56+ obj instanceof Map <?,?> && ((Map <?,?>) obj ).isEmpty () ||
57+ obj instanceof Optional && ((Optional <?>) obj ).isEmpty ()) {
5658 return RETURN_EMPTY ;
5759 }
5860 return RETURN_NOT_EMPTY ;
Original file line number Diff line number Diff line change 355355 Add support for coercion to <code >java.time.Instant</code > and
356356 <code >java.util.Date</code >. (markt)
357357 </add >
358+ <add >
359+ Add support for <code >java.util.Optional</code > to the empty operator.
360+ (markt)
361+ </add >
358362 <!-- Entries for backport and removal before 12.0.0-M1 below this line -->
359363 <fix >
360364 <bug >69948</bug >: Avoid ArrayOutOfBoundsException instead of
You can’t perform that action at this time.
0 commit comments