File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed
api/all/src/main/java/io/opentelemetry/api/internal Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change 55
66package io .opentelemetry .api .internal ;
77
8- import java .util .AbstractMap ;
98import java .util .Locale ;
109import java .util .Map ;
11- import java .util .Set ;
12- import java .util .stream .Collectors ;
10+ import java .util .Objects ;
1311import javax .annotation .Nullable ;
1412
1513/**
@@ -36,18 +34,12 @@ private ConfigUtil() {}
3634 */
3735 public static String getString (String key , String defaultValue ) {
3836 String normalizedKey = normalizePropertyKey (key );
39- Set <Map .Entry <String , String >> properties =
40- System .getProperties ().stringPropertyNames ().stream ()
41- .map (
42- propertyName ->
43- new AbstractMap .SimpleEntry <>(propertyName , System .getProperty (propertyName )))
44- .filter (entry -> entry .getKey () != null )
45- .collect (Collectors .<Map .Entry <String , String >>toSet ());
4637
4738 String systemProperty =
48- properties .stream ()
49- .filter (entry -> normalizedKey .equals (normalizePropertyKey (entry .getKey ())))
50- .map (Map .Entry ::getValue )
39+ System .getProperties ().stringPropertyNames ().stream ()
40+ .filter (propertyName -> normalizedKey .equals (normalizePropertyKey (propertyName )))
41+ .map (System ::getProperty )
42+ .filter (Objects ::nonNull )
5143 .findFirst ()
5244 .orElse (null );
5345 if (systemProperty != null ) {
You can’t perform that action at this time.
0 commit comments