You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "dsmiley (via GitHub)" <gi...@apache.org> on 2024/09/25 19:43:30 UTC

Re: [PR] SOLR-17441 MetricUtils: Skip Unreadable Properties [solr]

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-unsubscribe@solr.apache.org

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


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