From 9eefc50719abcc82b5d6fce6f6443a0b1242e4ab Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Wed, 28 Feb 2024 09:03:52 +0100 Subject: [PATCH] remove ConfigurableProvider --- .../internal/SpringComponentLoader.java | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/SpringComponentLoader.java b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/SpringComponentLoader.java index dba1790927c1..f7f33514272c 100644 --- a/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/SpringComponentLoader.java +++ b/instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/internal/SpringComponentLoader.java @@ -5,14 +5,11 @@ package io.opentelemetry.instrumentation.spring.autoconfigure.internal; -import io.opentelemetry.sdk.autoconfigure.ComponentLoader; +import io.opentelemetry.sdk.autoconfigure.internal.ComponentLoader; import io.opentelemetry.sdk.autoconfigure.internal.SpiHelper; -import io.opentelemetry.sdk.autoconfigure.spi.ConfigurableProvider; import io.opentelemetry.sdk.autoconfigure.spi.Ordered; import java.util.Comparator; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.stream.Collectors; import org.springframework.context.ApplicationContext; @@ -54,23 +51,4 @@ public List loadOrdered(Class spiClass) { result.addAll(beans); return result; } - - @Override - public Map loadConfigurableProviders( - Class spiClass) { - Map components = new HashMap<>(); - addComponents(components, spiHelper.load(spiClass)); - // beans have a higher priority than spi and overwrite values with the same name - addComponents( - components, - applicationContext.getBeanProvider(spiClass).orderedStream().collect(Collectors.toList())); - return components; - } - - private static void addComponents(Map target, List components) { - for (T component : components) { - String name = ((ConfigurableProvider) component).getName(); - target.put(name, component); - } - } }