File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed
api/incubator/src/main/java/io/opentelemetry/api/incubator/config
sdk-extensions/autoconfigure/src/testIncubating/java/io/opentelemetry/sdk/autoconfigure Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -42,10 +42,7 @@ public interface ConfigProvider {
4242 */
4343 default DeclarativeConfigProperties getJavaInstrumentationConfig (String name ) {
4444 DeclarativeConfigProperties config = getInstrumentationConfig ();
45- if (config == null ) {
46- return empty ();
47- }
48- return config .getStructured ("java" , empty ()).getStructured (name , empty ());
45+ return config == null ? empty () : config .get ("java" ).get (name );
4946 }
5047
5148 /**
@@ -59,10 +56,7 @@ default DeclarativeConfigProperties getJavaInstrumentationConfig(String name) {
5956 */
6057 default DeclarativeConfigProperties getGeneralInstrumentationConfig (String name ) {
6158 DeclarativeConfigProperties config = getInstrumentationConfig ();
62- if (config == null ) {
63- return empty ();
64- }
65- return config .getStructured ("general" , empty ()).getStructured (name , empty ());
59+ return config == null ? empty () : config .get ("general" ).get (name );
6660 }
6761
6862 /** Returns a no-op {@link ConfigProvider}. */
Original file line number Diff line number Diff line change 55
66package io .opentelemetry .sdk .autoconfigure ;
77
8- import static io .opentelemetry .api .incubator .config .DeclarativeConfigProperties .empty ;
98import static io .opentelemetry .sdk .testing .assertj .OpenTelemetryAssertions .assertThat ;
109import static java .util .Collections .singletonMap ;
1110import static org .assertj .core .api .Assertions .assertThatCode ;
@@ -239,7 +238,7 @@ void configFile_ConfigProvider() {
239238 assertThat (
240239 globalConfigProvider
241240 .getGeneralInstrumentationConfig ("http" )
242- .getStructured ("client" , empty () )
241+ .get ("client" )
243242 .getScalarList ("request_captured_headers" , String .class ))
244243 .isEqualTo (Arrays .asList ("Content-Type" , "Accept" ));
245244 }
You can’t perform that action at this time.
0 commit comments