File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
api/all/src/main/java/io/opentelemetry/api/internal Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 66package io .opentelemetry .api .internal ;
77
88import java .util .AbstractMap ;
9- import java .util .HashSet ;
109import java .util .Locale ;
1110import java .util .Map ;
1211import java .util .Set ;
@@ -38,15 +37,12 @@ private ConfigUtil() {}
3837 public static String getString (String key , String defaultValue ) {
3938 String normalizedKey = normalizePropertyKey (key );
4039 Set <Map .Entry <String , String >> properties =
41- new HashSet <>(System .getProperties ().entrySet ())
42- .stream ()
43- .filter (
44- entry -> entry .getKey () instanceof String && entry .getValue () instanceof String )
45- .map (
46- entry ->
47- new AbstractMap .SimpleEntry <>(
48- (String ) entry .getKey (), (String ) entry .getValue ()))
49- .collect (Collectors .<Map .Entry <String , String >>toSet ());
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 ());
5046
5147 String systemProperty =
5248 properties .stream ()
You can’t perform that action at this time.
0 commit comments