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/03/19 11:51:43 UTC

[sling-org-apache-sling-installer-provider-jcr] branch master updated: SLING-9218 configuration writeback must emit comments starting with correct prefix

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-provider-jcr.git


The following commit(s) were added to refs/heads/master by this push:
     new 57c9cf5  SLING-9218 configuration writeback must emit comments starting with correct prefix
57c9cf5 is described below

commit 57c9cf59f20447704b8a413ffc7ca7d0cba41634
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Mar 19 12:51:31 2020 +0100

    SLING-9218 configuration writeback must emit comments starting with
    correct prefix
---
 .../sling/installer/provider/jcr/impl/JcrInstaller.java    | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java b/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
index 371a5cc..5d8dcc1 100644
--- a/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
+++ b/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java
@@ -586,17 +586,6 @@ public class JcrInstaller implements UpdateHandler {
     }
 
     /**
-     * @see org.apache.sling.installer.api.UpdateHandler#handleUpdate(java.lang.String, java.lang.String, java.lang.String, java.util.Dictionary, Map)
-     */
-    public UpdateResult handleUpdate(final String resourceType,
-            final String id,
-            final String url,
-            final Dictionary<String, Object> dict,
-            final Map<String, Object> attributes) {
-        return this.handleUpdate(resourceType, id, url, null, dict, attributes);
-    }
-
-    /**
      * @see org.apache.sling.installer.api.UpdateHandler#handleUpdate(java.lang.String, java.lang.String, java.lang.String, java.io.InputStream, Map)
      */
     public UpdateResult handleUpdate(final String resourceType,
@@ -692,7 +681,8 @@ public class JcrInstaller implements UpdateHandler {
 
             // write to a byte array stream
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            baos.write("# Configuration created by Apache Sling JCR Installer\n".getBytes("UTF-8"));
+            // comments starting with "//"  allowed according to https://osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html#d0e131566
+            baos.write("// Configuration created by Apache Sling JCR Installer\n".getBytes("UTF-8"));
             ConfigurationSerializer serializer = ConfigurationSerializerFactory.create(ConfigurationSerializerFactory.Format.JSON);
             serializer.serialize(dict, baos);
             baos.close();