You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/12/20 08:36:08 UTC

[dubbo] 02/02: Fixes https://github.com/apache/dubbo/pull/4225

This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch fix-netutils-log-endless-recursive
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 8af951f7ebde761c0fad32f52c95c1c6f8331553
Author: ken.lj <ke...@gmail.com>
AuthorDate: Fri Dec 20 16:35:18 2019 +0800

    Fixes https://github.com/apache/dubbo/pull/4225
---
 .../src/main/java/org/apache/dubbo/config/AbstractConfig.java     | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java
index c86183e..a88df5c 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java
@@ -511,6 +511,14 @@ public abstract class AbstractConfig implements Serializable {
                     if (MethodUtils.isGetter(method)) {
                         String name = method.getName();
                         String key = calculateAttributeFromGetter(name);
+
+                        try {
+                            getClass().getField(key);
+                        } catch (NoSuchFieldException e) {
+                            // ignore
+                            continue;
+                        }
+
                         Object value = method.invoke(this);
                         if (value != null) {
                             buf.append(" ");