From 70901327e6ac0b8a5c7163c29cd8d05f4560dff8 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Wed, 18 May 2022 15:59:33 -0400 Subject: [PATCH] GH-1459: Remove Unused Method --- .../rabbit/listener/MicrometerHolder.java | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/MicrometerHolder.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/MicrometerHolder.java index fb00ae38d0..694dabe6e4 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/MicrometerHolder.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/MicrometerHolder.java @@ -16,17 +16,12 @@ package org.springframework.amqp.rabbit.listener; -import java.util.Collections; import java.util.Map; -import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import org.springframework.beans.factory.NoUniqueBeanDefinitionException; -import org.springframework.beans.factory.config.BeanDefinition; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.context.ApplicationContext; -import org.springframework.context.ConfigurableApplicationContext; import org.springframework.lang.Nullable; import io.micrometer.core.instrument.MeterRegistry; @@ -71,37 +66,6 @@ final class MicrometerHolder { } } - private Map filterRegistries(Map registries, - ApplicationContext context) { - - if (registries.size() == 1) { - return registries; - } - MeterRegistry primary = null; - if (context instanceof ConfigurableApplicationContext) { - BeanDefinitionRegistry bdr = (BeanDefinitionRegistry) ((ConfigurableApplicationContext) context) - .getBeanFactory(); - for (Entry entry : registries.entrySet()) { - BeanDefinition beanDefinition = bdr.getBeanDefinition(entry.getKey()); - if (beanDefinition.isPrimary()) { - if (primary != null) { - primary = null; - break; - } - else { - primary = entry.getValue(); - } - } - } - } - if (primary != null) { - return Collections.singletonMap("primary", primary); - } - else { - return registries; - } - } - Object start() { return Timer.start(this.registry); }