This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new c6421cd875 Missed two more instances of the same
c6421cd875 is described below
commit c6421cd875e794b9b3de8f7e0360ebc7a1d9e5f7
Author: remm <[email protected]>
AuthorDate: Wed Sep 20 14:52:14 2023 +0200
Missed two more instances of the same
Harmonize a bit more with BeanELResolver.
---
java/org/apache/jasper/el/JasperELResolver.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/jasper/el/JasperELResolver.java
b/java/org/apache/jasper/el/JasperELResolver.java
index 4ac327d3f1..3accc94c08 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -20,6 +20,7 @@ import java.beans.FeatureDescriptor;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.List;
+import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import javax.el.ArrayELResolver;
@@ -193,6 +194,7 @@ public class JasperELResolver extends CompositeELResolver {
@Override
public Object getValue(ELContext context, Object base,
Object property) {
+ Objects.requireNonNull(context);
if (base == null || property == null) {
return null;
}
@@ -214,7 +216,8 @@ public class JasperELResolver extends CompositeELResolver {
@Override
public void setValue(ELContext context, Object base, Object property,
Object value) {
- if (base == null) {
+ Objects.requireNonNull(context);
+ if (base == null || property == null) {
return;
}
Method method = getWriteMethod(base.getClass(),
property.toString(), value.getClass());
@@ -232,6 +235,10 @@ public class JasperELResolver extends CompositeELResolver {
@Override
public boolean isReadOnly(ELContext context, Object base,
Object property) {
+ Objects.requireNonNull(context);
+ if (base == null || property == null) {
+ return false;
+ }
Class<?> beanClass = base.getClass();
String prop = property.toString();
Method readMethod = getReadMethod(beanClass, prop);
@@ -289,6 +296,9 @@ public class JasperELResolver extends CompositeELResolver {
@Override
public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ if (base != null) {
+ return Object.class;
+ }
return null;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]