1010import java .nio .file .InvalidPathException ;
1111import java .nio .file .Paths ;
1212import java .util .Base64 ;
13- import java .util .Collections ;
14- import java .util .HashMap ;
1513import java .util .Map ;
1614import java .util .logging .Level ;
1715import java .util .logging .Logger ;
@@ -38,18 +36,25 @@ public class SecretSourceResolver {
3836 private final StringSubstitutor substitutor ;
3937
4038 public SecretSourceResolver (ConfigurationContext configurationContext ) {
41- // TODO update to use Map.of in JDK11+
42- Map <String , org .apache .commons .text .lookup .StringLookup > map = new HashMap <>(16 );
43- map .put ("base64" , Base64Lookup .INSTANCE );
44- map .put ("fileBase64" , FileBase64Lookup .INSTANCE );
45- map .put ("readFileBase64" , FileBase64Lookup .INSTANCE );
46- map .put ("file" , FileStringLookup .INSTANCE );
47- map .put ("readFile" , FileStringLookup .INSTANCE );
48- map .put ("sysProp" , SystemPropertyLookup .INSTANCE );
49- map .put ("decodeBase64" , DecodeBase64Lookup .INSTANCE );
50- map .put ("json" , JsonLookup .INSTANCE );
51- map .put ("trim" , TrimLookup .INSTANCE );
52- map = Collections .unmodifiableMap (map );
39+ Map <String , StringLookup > map = Map .of (
40+ "base64" ,
41+ Base64Lookup .INSTANCE ,
42+ "fileBase64" ,
43+ FileBase64Lookup .INSTANCE ,
44+ "readFileBase64" ,
45+ FileBase64Lookup .INSTANCE ,
46+ "file" ,
47+ FileStringLookup .INSTANCE ,
48+ "readFile" ,
49+ FileStringLookup .INSTANCE ,
50+ "sysProp" ,
51+ SystemPropertyLookup .INSTANCE ,
52+ "decodeBase64" ,
53+ DecodeBase64Lookup .INSTANCE ,
54+ "json" ,
55+ JsonLookup .INSTANCE ,
56+ "trim" ,
57+ TrimLookup .INSTANCE );
5358
5459 substitutor = new StringSubstitutor (new FixedInterpolatorStringLookup (
5560 map , new ConfigurationContextStringLookup (configurationContext )))
0 commit comments