You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/06/28 11:34:07 UTC
[tomcat] branch main updated: Fix formatting and copy/paste error
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 91d3d59727 Fix formatting and copy/paste error
91d3d59727 is described below
commit 91d3d5972737cee7ece90fc0672bc4842130ea72
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jun 28 12:33:59 2023 +0100
Fix formatting and copy/paste error
---
java/jakarta/el/OptionalELResolver.java | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/java/jakarta/el/OptionalELResolver.java b/java/jakarta/el/OptionalELResolver.java
index 6f9c3da73f..95eb1c5323 100644
--- a/java/jakarta/el/OptionalELResolver.java
+++ b/java/jakarta/el/OptionalELResolver.java
@@ -21,32 +21,27 @@ import java.util.Optional;
/**
* Defines property resolution behaviour on {@link Optional}s.
- *
* <p>
* This resolver handles base objects that are instances of {@link Optional}.
- *
* <p>
* If the {@link Optional#isEmpty()} is {@code true} for the base object and the property is {@code null} then the
* resulting value is {@code null}.
- *
* <p>
* If the {@link Optional#isEmpty()} is {@code true} for the base object and the property is not {@code null} then the
* resulting value is the base object (an empty {@link Optional}).
- *
* <p>
* If the {@link Optional#isPresent()} is {@code true} for the base object and the property is {@code null} then the
* resulting value is the result of calling {@link Optional#get()} on the base object.
- *
* <p>
* If the {@link Optional#isPresent()} is {@code true} for the base object and the property is not {@code null} then the
* resulting value is the result of calling {@link ELResolver#getValue(ELContext, Object, Object)} using the
* {@link ELResolver} obtained from {@link ELContext#getELResolver()} with the following parameters:
* <ul>
* <li>The {@link ELContext} is the current context</li>
- * <li>The base object is the result of calling {@link Optional#get()} on the current base object<li>
+ * <li>The base object is the result of calling {@link Optional#get()} on the current base object
+ * <li>
* <li>The property object is the current property object</li>
* </ul>
- *
* <p>
* This resolver is always a read-only resolver.
*/
@@ -77,9 +72,9 @@ public class OptionalELResolver extends ELResolver {
return null;
}
+
/**
* {@inheritDoc}
- *
* <p>
* If the base object is an {@link Optional} this method always returns {@code null} since instances of this
* resolver are always read-only.
@@ -95,9 +90,9 @@ public class OptionalELResolver extends ELResolver {
return null;
}
+
/**
* {@inheritDoc}
- *
* <p>
* If the base object is an {@link Optional} this method always throws a {@link PropertyNotWritableException} since
* instances of this resolver are always read-only.
@@ -112,9 +107,9 @@ public class OptionalELResolver extends ELResolver {
}
}
+
/**
* {@inheritDoc}
- *
* <p>
* If the base object is an {@link Optional} this method always returns {@code true} since instances of this
* resolver are always read-only.
@@ -131,9 +126,9 @@ public class OptionalELResolver extends ELResolver {
return false;
}
+
/**
* {@inheritDoc}
- *
* <p>
* If the base object is an {@link Optional} this method always returns {@code Object.class}.
*/
@@ -146,6 +141,7 @@ public class OptionalELResolver extends ELResolver {
return null;
}
+
@Override
public <T> T convertToType(ELContext context, Object obj, Class<T> type) {
Objects.requireNonNull(context);
@@ -168,8 +164,8 @@ public class OptionalELResolver extends ELResolver {
return result;
} catch (ELException e) {
/*
- * TODO: This isn't pretty but it works. Significant refactoring would be required to avoid the
- * exception. See also OptionalELResolver.convertToType().
+ * TODO: This isn't pretty but it works. Significant refactoring would be required to avoid the
+ * exception. See also Util.isCoercibleFrom().
*/
}
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org