kylixs commented on a change in pull request #4225:
URL: https://github.com/apache/dubbo/pull/4225#discussion_r669370658



##########
File path: 
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractConfig.java
##########
@@ -590,6 +590,15 @@ public String toString() {
                     if (MethodUtils.isGetter(method)) {
                         String name = method.getName();
                         String key = calculateAttributeFromGetter(name);
+                        /**
+                         * make sure attribute exists
+                         */
+                        try {
+                            getClass().getField(key);

Review comment:
       Some attribute does not has a corresponding field, but has a pair of 
getter/setter methods, e.g. String getInterface()/setInterface(String) of 
ReferenceConfig. 
   So it’s better to check if the attribute is writable, see aslo: 
https://github.com/apache/dubbo/pull/8289/




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to