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 2020/04/19 12:44:42 UTC

[myfaces] branch master updated: MYFACES-2602

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 7bf6c8b  MYFACES-2602
7bf6c8b is described below

commit 7bf6c8ba3b2c3eb640d4c30f0ce266e306e72641
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Sun Apr 19 14:44:35 2020 +0200

    MYFACES-2602
---
 .../java/org/apache/myfaces/application/ApplicationImpl.java   | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java b/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
index faad42f..46349ba 100755
--- a/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
@@ -1607,6 +1607,16 @@ public class ApplicationImpl extends Application
                 try
                 {
                     PropertyDescriptor pd = pds.get(property.getPropertyName());
+                    // see MYFACES-2602 - skip set value if it was already set via constructor and now != null
+                    if (!pd.getPropertyType().isPrimitive())
+                    {
+                        Object defaultValue = pd.getReadMethod().invoke(converter);
+                        if (defaultValue != null)
+                        {
+                            continue;
+                        }
+                    }
+
                     Object convertedValue = ClassUtils.convertToType(property.getDefaultValue(), pd.getPropertyType());
                     pd.getWriteMethod().invoke(converter, convertedValue);
                 }