You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2020/11/24 12:35:50 UTC

[sling-org-apache-sling-installer-console] branch master updated: SLING-9932 prevent binding configurations to the Installer Console Bundle

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

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-installer-console.git


The following commit(s) were added to refs/heads/master by this push:
     new 7780d9b  SLING-9932 prevent binding configurations to the Installer Console Bundle
7780d9b is described below

commit 7780d9b22da491b3932a9fbc36c425a61b9a5aa9
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Tue Nov 24 12:36:56 2020 +0100

    SLING-9932 prevent binding configurations to the Installer Console
    Bundle
---
 .../core/impl/console/ConfigurationSerializerWebConsolePlugin.java   | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/installer/core/impl/console/ConfigurationSerializerWebConsolePlugin.java b/src/main/java/org/apache/sling/installer/core/impl/console/ConfigurationSerializerWebConsolePlugin.java
index b90e1cb..5ff745c 100644
--- a/src/main/java/org/apache/sling/installer/core/impl/console/ConfigurationSerializerWebConsolePlugin.java
+++ b/src/main/java/org/apache/sling/installer/core/impl/console/ConfigurationSerializerWebConsolePlugin.java
@@ -148,7 +148,7 @@ public class ConfigurationSerializerWebConsolePlugin extends AbstractWebConsoleP
             tdLabel(pw, "Serialized Configuration Properties");
             tdContent(pw);
             
-            Configuration configuration = configurationAdmin.getConfiguration(pid);
+            Configuration configuration = configurationAdmin.getConfiguration(pid, null);
             Dictionary<String, Object> properties = configuration.getProperties();
             if (properties == null) {
                 pw.print("<p class='ui-state-error-text'>");
@@ -156,8 +156,7 @@ public class ConfigurationSerializerWebConsolePlugin extends AbstractWebConsoleP
                 pw.println("</p>");
             } else {
                 properties = cleanConfiguration(properties);
-                try {
-                    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
                     ConfigurationSerializerFactory.create(serializationFormat).serialize(properties, baos);
                     pw.println("<textarea rows=\"20\" cols=\"120\" id=\"output\" readonly>");
                     pw.print(new String(baos.toByteArray(), StandardCharsets.UTF_8));