Skip to content

Commit a011497

Browse files
committed
cleanup
1 parent 937b157 commit a011497

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/EmbeddedConfigFile.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ private EmbeddedConfigFile() {
3131
}
3232

3333
static OpenTelemetryConfigurationModel extractModel(ConfigurableEnvironment environment) {
34-
Map<String, Object> props = extractSpringProperties(environment);
34+
Map<String, String> props = extractSpringProperties(environment);
3535
return convertToOpenTelemetryConfigurationModel(props);
3636
}
3737

38-
private static Map<String, Object> extractSpringProperties(ConfigurableEnvironment environment) {
38+
private static Map<String, String> extractSpringProperties(ConfigurableEnvironment environment) {
3939
MutablePropertySources propertySources = environment.getPropertySources();
4040

41-
Map<String, Object> props = new HashMap<>();
41+
Map<String, String> props = new HashMap<>();
4242
for (PropertySource<?> propertySource : propertySources) {
4343
if (propertySource instanceof EnumerablePropertySource<?>) {
4444
for (String propertyName :
@@ -61,7 +61,7 @@ private static Map<String, Object> extractSpringProperties(ConfigurableEnvironme
6161
}
6262

6363
static OpenTelemetryConfigurationModel convertToOpenTelemetryConfigurationModel(
64-
Map<String, Object> flatProps) {
64+
Map<String, String> flatProps) {
6565
Map<String, Object> nested = convertFlatPropsToNested(flatProps);
6666

6767
return getObjectMapper().convertValue(nested, OpenTelemetryConfigurationModel.class);
@@ -83,12 +83,12 @@ static ObjectMapper getObjectMapper() {
8383
* ["one", "two"]}}}}
8484
*/
8585
@SuppressWarnings("unchecked")
86-
static Map<String, Object> convertFlatPropsToNested(Map<String, Object> flatProps) {
86+
static Map<String, Object> convertFlatPropsToNested(Map<String, String> flatProps) {
8787
Map<String, Object> result = new HashMap<>();
8888

89-
for (Map.Entry<String, Object> entry : flatProps.entrySet()) {
89+
for (Map.Entry<String, String> entry : flatProps.entrySet()) {
9090
String key = entry.getKey();
91-
Object value = entry.getValue();
91+
String value = entry.getValue();
9292

9393
// Split the key by dots
9494
String[] parts = key.split("\\.");

instrumentation/spring/spring-boot-autoconfigure/src/main/java/io/opentelemetry/instrumentation/spring/autoconfigure/SpringDeclarativeConfigProperties.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ public static SpringDeclarativeConfigProperties create(
9090
}
9191
if (isMap(value)) {
9292
SpringDeclarativeConfigProperties configProperties =
93-
SpringDeclarativeConfigProperties.create(
94-
(Map<String, Object>) value, componentLoader);
93+
SpringDeclarativeConfigProperties.create((Map<String, Object>) value, componentLoader);
9594
mapEntries.put(key, configProperties);
9695
continue;
9796
}

0 commit comments

Comments
 (0)