dsmiley commented on code in PR #2694:
URL: https://github.com/apache/solr/pull/2694#discussion_r1775906018


##########
solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java:
##########
@@ -787,10 +787,16 @@ public static <T extends PlatformManagedObject> void 
addMXBeanMetrics(
                 }
               });
 
+      // if BeanInfo retrieval failed, return early
       if (beanInfo == null) {
         return;
       }
       for (final PropertyDescriptor desc : beanInfo.getPropertyDescriptors()) {
+        // skip properties without a read method
+        if (desc.getReadMethod() == null) {

Review Comment:
   this is fine but I think it'd be nicer to save the result and use it later 
rather than double-lookup.  Also nicer to get the read method inside the 
try-finally in case there's some issue even calling getReadMethod



-- 
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: issues-unsubscr...@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to