You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/06/22 13:45:55 UTC

[GitHub] [hadoop-ozone] elek commented on a change in pull request #1105: HDDS-3828. Configuration parsing of ozone insight should be based on fields

elek commented on a change in pull request #1105:
URL: https://github.com/apache/hadoop-ozone/pull/1105#discussion_r443568885



##########
File path: hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/ConfigurationSubCommand.java
##########
@@ -71,9 +71,9 @@ private void showConfig(Class clazz, Type type) {
 
     String prefix = configGroup.prefix();
 
-    for (Method method : clazz.getMethods()) {
-      if (method.isAnnotationPresent(Config.class)) {
-        Config config = method.getAnnotation(Config.class);
+    for (Field field : clazz.getDeclaredFields()) {

Review comment:
       Good point.
   
   But I am afraid we need a unit test to here to prove if it works as it's a more complex logic. I added one to prove it work.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org