This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 043e9b3b33 Simplify logic
043e9b3b33 is described below
commit 043e9b3b3382ce8a2055b486d75d8eb9b4f9f6e6
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Aug 9 19:26:23 2024 +0100
Simplify logic
---
java/jakarta/el/OptionalELResolver.java | 6 +-----
webapps/docs/changelog.xml | 3 +++
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/java/jakarta/el/OptionalELResolver.java
b/java/jakarta/el/OptionalELResolver.java
index 5a6880278e..0d82293039 100644
--- a/java/jakarta/el/OptionalELResolver.java
+++ b/java/jakarta/el/OptionalELResolver.java
@@ -58,11 +58,7 @@ public class OptionalELResolver extends ELResolver {
if (base instanceof Optional) {
context.setPropertyResolved(base, property);
- if (((Optional<?>) base).isEmpty()) {
- if (property == null) {
- return null;
- }
- } else {
+ if (((Optional<?>) base).isPresent()) {
if (property == null) {
return ((Optional<?>) base).get();
} else {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9baf253535..7c4042e438 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -111,6 +111,9 @@
Switch the <code>TldScanner</code> back to logging detailed scan
results at debug level rather than trace level. (markt)
</fix>
+ <fix>
+ Simplify the implementation of <code>OptionalELResolver</code>. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="WebSocket">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]