This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 439206dec2 Missed two more instances of the same
439206dec2 is described below
commit 439206dec2160912cba2cec00dbb8a2c518c700d
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 1a1bcfca3f..252ae93527 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 jakarta.el.ArrayELResolver;
@@ -198,6 +199,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;
}
@@ -219,7 +221,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());
@@ -237,6 +240,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);
@@ -294,6 +301,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]