You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2020/04/22 16:05:30 UTC

[sling-org-apache-sling-feature-modelconverter] branch bug/SLING-9392-fixing-null-pointer updated: Fixing git SLING-9392 - Supplying default values for all array parameters

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

dklco pushed a commit to branch bug/SLING-9392-fixing-null-pointer
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-modelconverter.git


The following commit(s) were added to refs/heads/bug/SLING-9392-fixing-null-pointer by this push:
     new b9c4d56  Fixing git SLING-9392 - Supplying default values for all array parameters
b9c4d56 is described below

commit b9c4d56887d8a11c191312dcf36a0f0b2bd463b2
Author: Dan Klco <dk...@apache.org>
AuthorDate: Wed Apr 22 12:05:08 2020 -0400

    Fixing git SLING-9392 - Supplying default values for all array parameters
---
 src/main/java/org/apache/sling/feature/modelconverter/Main.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/modelconverter/Main.java b/src/main/java/org/apache/sling/feature/modelconverter/Main.java
index fbbee9a..e2582c7 100644
--- a/src/main/java/org/apache/sling/feature/modelconverter/Main.java
+++ b/src/main/java/org/apache/sling/feature/modelconverter/Main.java
@@ -65,16 +65,16 @@ public class Main implements Runnable {
     private String name;
 
     @Option(names = { "-d", "--dropVariable" }, description = "Variable (by name) in a Feature Model to be excluded (repeat for more)")
-    private List<String> dropVariables;
+    private List<String> dropVariables = new ArrayList<>();
 
     @Option(names = { "-a", "--addFrameworkProperty" }, description = "Adds Framework Property to Feature Models. Format: <Model Name>:<Property Name>=<value> (repeat for more)")
-    private List<String> addFrameworkProperties;
+    private List<String> addFrameworkProperties = new ArrayList<>();
 
     @Option(names = { "-D", "--noProvisioningModelName" }, description = "If flagged then the Provisioning Model Name is not added")
     private boolean noProvisioningModelName;
 
     @Option(names = { "-e", "--excludeBundle" }, description = "Bundle and/or Bundle Configuration to be excluded (repeat for more)")
-    private List<String> excludeBundles;
+    private List<String> excludeBundles = new ArrayList<>();
 
     @Option(names = { "-r", "--runMode" }, description = "Runmode to add to this build (all no-runmodes are included by default, repeat for more)")
     private List<String> runModes;
@@ -122,6 +122,7 @@ public class Main implements Runnable {
                     modelMap.put(propName, propValue);
                 }
             }
+            
             options.put("addFrameworkProperties", frameworkPropertiesMap);
             options.put("excludeBundles", excludeBundles);
             LOGGER.info("Excluded Bundles: '{}'", excludeBundles);