You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2021/11/21 22:52:41 UTC

[sling-org-apache-sling-feature-cpconverter] branch issues/SLING-10933 created (now 966a997)

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

pauls pushed a change to branch issues/SLING-10933
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git.


      at 966a997  SLING-10933: use QUOTE_TICK for parsing json.

This branch includes the following new commits:

     new 966a997  SLING-10933: use QUOTE_TICK for parsing json.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[sling-org-apache-sling-feature-cpconverter] 01/01: SLING-10933: use QUOTE_TICK for parsing json.

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch issues/SLING-10933
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git

commit 966a997b3f70d3abe31d321e0992ac6c22c440ee
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Sun Nov 21 23:52:27 2021 +0100

    SLING-10933: use QUOTE_TICK for parsing json.
---
 .../apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java b/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
index 5902d1e..248b97e 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/handlers/BundleEntryHandler.java
@@ -34,6 +34,7 @@ import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.EnumMap;
+import java.util.EnumSet;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.Map;
@@ -69,6 +70,7 @@ import org.apache.jackrabbit.vault.util.PlatformNameFormat;
 import org.apache.sling.commons.osgi.ManifestHeader;
 import org.apache.sling.contentparser.api.ContentParser;
 import org.apache.sling.contentparser.api.ParserOptions;
+import org.apache.sling.contentparser.json.JSONParserFeature;
 import org.apache.sling.contentparser.json.JSONParserOptions;
 import org.apache.sling.contentparser.json.internal.JSONContentParser;
 import org.apache.sling.feature.ArtifactId;
@@ -428,7 +430,7 @@ public class BundleEntryHandler extends AbstractRegexEntryHandler {
 
     Map.Entry<ContentParser, ParserOptions> getContentParserForEntry(JarEntry entry, PathEntry pathEntry) {
         if (entry.getName().endsWith(".json") && !pathEntry.isIgnoredImportProvider("json")) {
-            return new AbstractMap.SimpleEntry<>(new JSONContentParser(), new JSONParserOptions().withFeatures(JSONParserOptions.DEFAULT_JSON_PARSER_FEATURES));
+            return new AbstractMap.SimpleEntry<>(new JSONContentParser(), new JSONParserOptions().withFeatures(EnumSet.of(JSONParserFeature.COMMENTS, JSONParserFeature.QUOTE_TICK)));
         } else {
             return null;
         }