From 56c68fe5d5204c225a7d43305d65ab69f98c943d Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Tue, 7 Jan 2025 18:02:59 +0100 Subject: [PATCH] format Signed-off-by: Gregor Zeitlinger --- checkstyle.xml | 2 -- .../instrumentation/dropwizard5/DropwizardExports.java | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/checkstyle.xml b/checkstyle.xml index ef205414d..fd483abfa 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -255,7 +255,6 @@ - diff --git a/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExports.java b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExports.java index bd3a163ac..c050871ce 100644 --- a/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExports.java +++ b/prometheus-metrics-instrumentation-dropwizard5/src/main/java/io/prometheus/metrics/instrumentation/dropwizard5/DropwizardExports.java @@ -24,6 +24,7 @@ import java.util.Collections; import java.util.Map; import java.util.Optional; +import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; @@ -196,8 +197,9 @@ MetricSnapshot fromMeter(String dropwizardName, Meter meter) { @Override public MetricSnapshots collect() { MetricSnapshots.Builder metricSnapshots = MetricSnapshots.builder(); - for (@SuppressWarnings("rawtypes") - Map.Entry entry : registry.getGauges(metricFilter).entrySet()) { + @SuppressWarnings("rawtypes") + Set> entries = registry.getGauges(metricFilter).entrySet(); + for (@SuppressWarnings("rawtypes") Map.Entry entry : entries) { Optional.ofNullable(fromGauge(entry.getKey().getKey(), entry.getValue())) .ifPresent(metricSnapshots::metricSnapshot); }