risdenk commented on code in PR #1133:
URL: https://github.com/apache/solr/pull/1133#discussion_r1006071283
##########
solr/core/src/test/org/apache/solr/metrics/JvmMetricsTest.java:
##########
@@ -92,9 +91,10 @@ public void testSystemProperties() {
}
SolrMetricManager metricManager =
jetty.getCoreContainer().getMetricManager();
Map<String, Metric> metrics =
metricManager.registry("solr.jvm").getMetrics();
- MetricsMap map =
- (MetricsMap) ((SolrMetricManager.GaugeWrapper)
metrics.get("system.properties")).getGauge();
- assertNotNull(map);
+ Metric metric = metrics.get("system.properties");
+ assertNotNull(metrics.toString(), metric);
+ MetricsMap map = (MetricsMap) ((SolrMetricManager.GaugeWrapper<?>)
metric).getGauge();
+ assertNotNull(metrics.toString(), map);
Review Comment:
This addresses the NPE by adding an assertion. Doesn't fix the underlying
cause - haven't found one yet.
--
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]