You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by an...@apache.org on 2021/09/02 14:00:22 UTC

[sling-org-apache-sling-feature-cpconverter] branch SLING-10789 created (now c24efbd)

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

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


      at c24efbd  SLING-10789 : JsonConfigurationEntryHandler - sonar findings

This branch includes the following new commits:

     new c24efbd  SLING-10789 : JsonConfigurationEntryHandler - sonar findings

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-10789 : JsonConfigurationEntryHandler - sonar findings

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

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

commit c24efbda9b892c762d6f38824dd3da9e85dae954
Author: angela <an...@adobe.com>
AuthorDate: Thu Sep 2 15:59:56 2021 +0200

    SLING-10789 : JsonConfigurationEntryHandler - sonar findings
---
 .../cpconverter/handlers/JsonConfigurationEntryHandler.java       | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/cpconverter/handlers/JsonConfigurationEntryHandler.java b/src/main/java/org/apache/sling/feature/cpconverter/handlers/JsonConfigurationEntryHandler.java
index 2d5fb46..336cd26 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/handlers/JsonConfigurationEntryHandler.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/handlers/JsonConfigurationEntryHandler.java
@@ -21,10 +21,8 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
 import java.util.Dictionary;
-import java.util.Hashtable;
 
 import org.apache.felix.cm.json.Configurations;
-import org.apache.sling.feature.cpconverter.ConverterException;
 import org.jetbrains.annotations.NotNull;
 
 public final class JsonConfigurationEntryHandler extends AbstractConfigurationEntryHandler {
@@ -34,13 +32,11 @@ public final class JsonConfigurationEntryHandler extends AbstractConfigurationEn
     }
 
     @Override
-    protected @NotNull Dictionary<String, Object> parseConfiguration(@NotNull String name, @NotNull InputStream input) throws IOException, ConverterException {
-        final Hashtable<String, Object> props = Configurations.buildReader()
+    protected @NotNull Dictionary<String, Object> parseConfiguration(@NotNull String name, @NotNull InputStream input) throws IOException {
+        return Configurations.buildReader()
             .withIdentifier(name)
             .build(new InputStreamReader(input, StandardCharsets.UTF_8))
             .readConfiguration();
-
-        return props;
     }
 
 }