This is an automated email from the ASF dual-hosted git repository.
remm 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 7f3fdfa6b3 Missed two more instances of the same
7f3fdfa6b3 is described below
commit 7f3fdfa6b313ee1459fc1b50250bd64bedd2e2f5
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 6b57d9d133..31dd3e44c4 100644
--- a/java/org/apache/jasper/el/JasperELResolver.java
+++ b/java/org/apache/jasper/el/JasperELResolver.java
@@ -18,6 +18,7 @@ package org.apache.jasper.el;
import java.lang.reflect.Method;
import java.util.List;
+import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import jakarta.el.ArrayELResolver;
@@ -196,6 +197,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;
}
@@ -217,7 +219,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());
@@ -235,6 +238,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);
@@ -286,6 +293,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]