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:53 UTC

[myfaces] branch 2.3-next 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 2.3-next
in repository https://gitbox.apache.org/repos/asf/myfaces.git


The following commit(s) were added to refs/heads/2.3-next by this push:
     new d79ca61  MYFACES-4380 LambdaBeanELResolver: Fix PropertyNotFoundException condition.
     new 89cc89f  Merge pull request #177 from benkard/2.3-next
d79ca61 is described below

commit d79ca6100bba7db9f82a72f46f31a877285f0b82
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 5ccfb9b..cb8cb0d 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() + "]");