This is an automated email from the ASF dual-hosted git repository.

davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git


The following commit(s) were added to refs/heads/master by this push:
     new 53ef77e  FELIX-6441 Make it possible to run the Configuration 
Interpolation independently of Configuration Admin
     new 0b9b7d2  Merge pull request #85 from bosschaert/FELIX-6441-2
53ef77e is described below

commit 53ef77e2b8e2f5656d66283b766b6016d6b4e406
Author: David Bosschaert <dav...@apache.org>
AuthorDate: Tue Aug 3 10:28:13 2021 +0100

    FELIX-6441 Make it possible to run the Configuration Interpolation 
independently of Configuration Admin
    
    Prevent NPE when null passed in for secrets locations
---
 .../felix/configadmin/plugin/interpolation/StandaloneInterpolator.java | 3 +++
 .../configadmin/plugin/interpolation/StandaloneInterpolatorTest.java   | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/configadmin-plugins/interpolation/src/main/java/org/apache/felix/configadmin/plugin/interpolation/StandaloneInterpolator.java
 
b/configadmin-plugins/interpolation/src/main/java/org/apache/felix/configadmin/plugin/interpolation/StandaloneInterpolator.java
index 7facda1..880026f 100644
--- 
a/configadmin-plugins/interpolation/src/main/java/org/apache/felix/configadmin/plugin/interpolation/StandaloneInterpolator.java
+++ 
b/configadmin-plugins/interpolation/src/main/java/org/apache/felix/configadmin/plugin/interpolation/StandaloneInterpolator.java
@@ -50,6 +50,9 @@ public class StandaloneInterpolator {
      * @param secretsLocations The directories where secrets files can be 
found.
      */
     public StandaloneInterpolator(Map<String,String> frameworkProperties, 
String encoding, File ... secretsLocations) {
+        if (secretsLocations == null)
+            secretsLocations = new File[] {};
+
         String locations = Arrays.asList(secretsLocations).stream()
                 .map(File::toString)
                 .collect(Collectors.joining(","));
diff --git 
a/configadmin-plugins/interpolation/src/test/java/org/apache/felix/configadmin/plugin/interpolation/StandaloneInterpolatorTest.java
 
b/configadmin-plugins/interpolation/src/test/java/org/apache/felix/configadmin/plugin/interpolation/StandaloneInterpolatorTest.java
index be250b3..6566de1 100644
--- 
a/configadmin-plugins/interpolation/src/test/java/org/apache/felix/configadmin/plugin/interpolation/StandaloneInterpolatorTest.java
+++ 
b/configadmin-plugins/interpolation/src/test/java/org/apache/felix/configadmin/plugin/interpolation/StandaloneInterpolatorTest.java
@@ -62,7 +62,7 @@ public class StandaloneInterpolatorTest {
             userVar = "USER";
         }
 
-        StandaloneInterpolator interpolator = new 
StandaloneInterpolator(Collections.emptyMap());
+        StandaloneInterpolator interpolator = new 
StandaloneInterpolator(Collections.emptyMap(), null);
 
         Dictionary<String, Object> dict = new Hashtable<>();
         dict.put("someuser", "$[env:" + userVar + "]");

Reply via email to