Skip to content

Commit

Permalink
GH-1459: Remove Unused Method
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed May 18, 2022
1 parent 5bf6bc3 commit 7090132
Showing 1 changed file with 0 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -71,37 +66,6 @@ final class MicrometerHolder {
}
}

private Map<String, MeterRegistry> filterRegistries(Map<String, MeterRegistry> registries,
ApplicationContext context) {

if (registries.size() == 1) {
return registries;
}
MeterRegistry primary = null;
if (context instanceof ConfigurableApplicationContext) {
BeanDefinitionRegistry bdr = (BeanDefinitionRegistry) ((ConfigurableApplicationContext) context)
.getBeanFactory();
for (Entry<String, MeterRegistry> 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);
}
Expand Down

0 comments on commit 7090132

Please sign in to comment.