You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2020/08/20 14:46:24 UTC

[sling-org-apache-sling-installer-factory-feature] branch SLING-9658 updated: Filter nulls on map to dictionary copy

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

davidb pushed a commit to branch SLING-9658
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-factory-feature.git


The following commit(s) were added to refs/heads/SLING-9658 by this push:
     new 6b34499  Filter nulls on map to dictionary copy
6b34499 is described below

commit 6b34499d6702bada3a5370a936cba3b82c6c85dd
Author: David Bosschaert <da...@apache.org>
AuthorDate: Thu Aug 20 15:45:48 2020 +0100

    Filter nulls on map to dictionary copy
---
 .../sling/installer/factory/model/impl/InstallFeatureModelTask.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/installer/factory/model/impl/InstallFeatureModelTask.java b/src/main/java/org/apache/sling/installer/factory/model/impl/InstallFeatureModelTask.java
index f114821..b4f4bb3 100644
--- a/src/main/java/org/apache/sling/installer/factory/model/impl/InstallFeatureModelTask.java
+++ b/src/main/java/org/apache/sling/installer/factory/model/impl/InstallFeatureModelTask.java
@@ -287,7 +287,9 @@ public class InstallFeatureModelTask extends AbstractFeatureModelTask {
         public void addInstallableArtifact(ArtifactId id, URL url, Map<String,Object> props) {
             try {
                 Dictionary <String,Object> dict = new Hashtable<>();
-                props.entrySet().stream().forEach(e -> dict.put(e.getKey(), e.getValue()));
+                props.entrySet().stream()
+                    .filter(e -> e.getValue() != null)
+                    .forEach(e -> dict.put(e.getKey(), e.getValue()));
 
                 InputStream is = url.openStream();
                 results.add(new InstallableResource("/".concat(id.toMvnName()), is, dict, null /* TODO digest? */,