Skip to content

Commit 1883162

Browse files
committed
Revert "update bridge to match agent"
This reverts commit 2e2bb79.
1 parent 2e2bb79 commit 1883162

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

declarative-config-bridge/src/main/java/io/opentelemetry/contrib/sdk/autoconfigure/ConfigPropertiesTranslator.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ String translateProperty(String property) {
3030
return property;
3131
}
3232

33-
@SuppressWarnings("unchecked")
3433
@Nullable
35-
public <T> T get(String propertyName) {
36-
return (T) fixedValues.get(propertyName);
34+
public Object get(String propertyName) {
35+
return fixedValues.get(propertyName);
3736
}
3837
}

declarative-config-bridge/src/main/java/io/opentelemetry/contrib/sdk/autoconfigure/DeclarativeConfigPropertiesBridge.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,12 @@ public Duration getDuration(String propertyName) {
126126
return Duration.ofMillis(millis);
127127
}
128128

129+
@SuppressWarnings("unchecked")
129130
@Override
130131
public List<String> getList(String propertyName) {
131-
List<String> value = translator.get(propertyName);
132+
Object value = translator.get(propertyName);
132133
if (value != null) {
133-
return value;
134+
return (List<String>) value;
134135
}
135136
List<String> propertyValue =
136137
getPropertyValue(
@@ -139,11 +140,12 @@ public List<String> getList(String propertyName) {
139140
return propertyValue == null ? Collections.emptyList() : propertyValue;
140141
}
141142

143+
@SuppressWarnings("unchecked")
142144
@Override
143145
public Map<String, String> getMap(String propertyName) {
144-
Map<String, String> fixed = translator.get(propertyName);
146+
Object fixed = translator.get(propertyName);
145147
if (fixed != null) {
146-
return fixed;
148+
return (Map<String, String>) fixed;
147149
}
148150
DeclarativeConfigProperties propertyValue =
149151
getPropertyValue(propertyName, DeclarativeConfigProperties::getStructured);

0 commit comments

Comments
 (0)