You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2021/02/19 07:22:48 UTC
[myfaces] branch master updated: MYFACES-4380 LambdaBeanELResolver:
Fix PropertyNotFoundException condition.
This is an automated email from the ASF dual-hosted git repository.
tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git
The following commit(s) were added to refs/heads/master by this push:
new 4f320aa MYFACES-4380 LambdaBeanELResolver: Fix PropertyNotFoundException condition.
new 29a0a9f Merge pull request #178 from benkard/master
4f320aa is described below
commit 4f320aacd3f03b5e42de768fb9273013353108a8
Author: Matthias Andreas Benkard <co...@mail.matthias.benkard.de>
AuthorDate: Tue Feb 16 13:09:20 2021 +0100
MYFACES-4380 LambdaBeanELResolver: Fix PropertyNotFoundException condition.
PropertyNotFoundException was thrown if the name of the poperty
requested was null, but it should really be thrown when the property
itself is not found. This patch changes the nullness check
accordingly.
Before:
java.lang.NullPointerException: Cannot invoke "org.apache.myfaces.core.api.shared.lang.PropertyDescriptorWrapper.getWrapped()" because "pd" is null
at org.apache.myfaces.el.resolver.LambdaBeanELResolver.getValue(LambdaBeanELResolver.java:78)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:136)
After:
javax.el.PropertyNotFoundException: Property [x] not found on type [com.example.FooBar_ClientProxy]
at org.apache.myfaces.el.resolver.LambdaBeanELResolver.getPropertyDescriptor(LambdaBeanELResolver.java:162)
at org.apache.myfaces.el.resolver.LambdaBeanELResolver.getValue(LambdaBeanELResolver.java:72)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:136)
---
.../main/java/org/apache/myfaces/el/resolver/LambdaBeanELResolver.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/impl/src/main/java/org/apache/myfaces/el/resolver/LambdaBeanELResolver.java b/impl/src/main/java/org/apache/myfaces/el/resolver/LambdaBeanELResolver.java
index a0aa1ff..b07dc77 100644
--- a/impl/src/main/java/org/apache/myfaces/el/resolver/LambdaBeanELResolver.java
+++ b/impl/src/main/java/org/apache/myfaces/el/resolver/LambdaBeanELResolver.java
@@ -156,7 +156,7 @@ public class LambdaBeanELResolver extends BeanELResolver
}
PropertyDescriptorWrapper pd = beanCache.get((String) property);
- if (property == null)
+ if (pd == null)
{
throw new PropertyNotFoundException("Property [" + property
+ "] not found on type [" + base.getClass().getName() + "]");