sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject [sling-org-apache-sling-clam] branch master updated: style
Date Tue, 01 Sep 2020 19:16:55 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 248fcdf  style
248fcdf is described below

commit 248fcdf5dabe5f27941f488e6156530e34261c6e
Author: Oliver Lietz <olli@apache.org>
AuthorDate: Tue Sep 1 20:52:57 2020 +0200

    style
---
 .../org/apache/sling/clam/http/internal/ClamJcrScanServlet.java     | 2 +-
 src/main/java/org/apache/sling/clam/http/internal/ResponseUtil.java | 5 ++++-
 src/main/java/org/apache/sling/clam/internal/ClamUtil.java          | 3 +++
 .../clam/jcr/internal/DefaultNodeDescendingJcrPropertyDigger.java   | 2 +-
 .../apache/sling/clam/job/internal/JcrPropertyScanJobConsumer.java  | 2 +-
 .../clam/result/internal/EventPublishingScanResultHandler.java      | 2 +-
 .../sling/clam/result/internal/MailSendingScanResultHandler.java    | 2 +-
 .../clam/result/internal/ResourcePersistingScanResultHandler.java   | 6 +++---
 8 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/clam/http/internal/ClamJcrScanServlet.java b/src/main/java/org/apache/sling/clam/http/internal/ClamJcrScanServlet.java
index 8f50454..63dc53b 100644
--- a/src/main/java/org/apache/sling/clam/http/internal/ClamJcrScanServlet.java
+++ b/src/main/java/org/apache/sling/clam/http/internal/ClamJcrScanServlet.java
@@ -83,7 +83,7 @@ public class ClamJcrScanServlet extends SlingAllMethodsServlet {
 
     private final Logger logger = LoggerFactory.getLogger(ClamJcrScanServlet.class);
 
-    public ClamJcrScanServlet() {
+    public ClamJcrScanServlet() { //
     }
 
     @Activate
diff --git a/src/main/java/org/apache/sling/clam/http/internal/ResponseUtil.java b/src/main/java/org/apache/sling/clam/http/internal/ResponseUtil.java
index de8a09c..2406286 100644
--- a/src/main/java/org/apache/sling/clam/http/internal/ResponseUtil.java
+++ b/src/main/java/org/apache/sling/clam/http/internal/ResponseUtil.java
@@ -25,6 +25,7 @@ import javax.jcr.PropertyType;
 import javax.json.Json;
 import javax.json.JsonException;
 import javax.json.JsonObjectBuilder;
+import javax.json.stream.JsonGenerator;
 import javax.servlet.ServletException;
 
 import org.apache.sling.api.SlingHttpServletResponse;
@@ -45,7 +46,9 @@ public class ResponseUtil {
             if (message != null) {
                 final JsonObjectBuilder error = Json.createObjectBuilder();
                 error.add("message", message);
-                Json.createGenerator(response.getWriter()).write(error.build()).flush();
+                try (final JsonGenerator generator = Json.createGenerator(response.getWriter()))
{
+                    generator.write(error.build()).flush();
+                }
             }
         } catch (final JsonException e) {
             throw new ServletException("Building response failed.");
diff --git a/src/main/java/org/apache/sling/clam/internal/ClamUtil.java b/src/main/java/org/apache/sling/clam/internal/ClamUtil.java
index 9c5244a..d7bb45a 100644
--- a/src/main/java/org/apache/sling/clam/internal/ClamUtil.java
+++ b/src/main/java/org/apache/sling/clam/internal/ClamUtil.java
@@ -41,6 +41,9 @@ public final class ClamUtil {
 
     private static final String RESULT_EVENT_TOPIC_ROOT = "org/apache/sling/clam/result/jcr/property";
 
+    private ClamUtil() {
+    }
+
     public static String scanJobTopic(final int propertyType) {
         return String.format("%s/%s", SCAN_JOB_TOPIC_ROOT, PropertyType.nameFromValue(propertyType));
     }
diff --git a/src/main/java/org/apache/sling/clam/jcr/internal/DefaultNodeDescendingJcrPropertyDigger.java
b/src/main/java/org/apache/sling/clam/jcr/internal/DefaultNodeDescendingJcrPropertyDigger.java
index 4f60e66..0719bf7 100644
--- a/src/main/java/org/apache/sling/clam/jcr/internal/DefaultNodeDescendingJcrPropertyDigger.java
+++ b/src/main/java/org/apache/sling/clam/jcr/internal/DefaultNodeDescendingJcrPropertyDigger.java
@@ -59,7 +59,7 @@ public class DefaultNodeDescendingJcrPropertyDigger implements NodeDescendingJcr
 
     private final Logger logger = LoggerFactory.getLogger(DefaultNodeDescendingJcrPropertyDigger.class);
 
-    public DefaultNodeDescendingJcrPropertyDigger() {
+    public DefaultNodeDescendingJcrPropertyDigger() { //
     }
 
     public void dig(@NotNull final Node node, @NotNull final Pattern pattern, @NotNull final
Set<Integer> propertyTypes, final long maxLength, final int maxDepth) throws Exception
{
diff --git a/src/main/java/org/apache/sling/clam/job/internal/JcrPropertyScanJobConsumer.java
b/src/main/java/org/apache/sling/clam/job/internal/JcrPropertyScanJobConsumer.java
index 4a2725f..a0bbcfa 100644
--- a/src/main/java/org/apache/sling/clam/job/internal/JcrPropertyScanJobConsumer.java
+++ b/src/main/java/org/apache/sling/clam/job/internal/JcrPropertyScanJobConsumer.java
@@ -84,7 +84,7 @@ public class JcrPropertyScanJobConsumer implements JobConsumer {
 
     private final Logger logger = LoggerFactory.getLogger(JcrPropertyScanJobConsumer.class);
 
-    public JcrPropertyScanJobConsumer() {
+    public JcrPropertyScanJobConsumer() { //
     }
 
     @Override
diff --git a/src/main/java/org/apache/sling/clam/result/internal/EventPublishingScanResultHandler.java
b/src/main/java/org/apache/sling/clam/result/internal/EventPublishingScanResultHandler.java
index eb173e1..5bfef06 100644
--- a/src/main/java/org/apache/sling/clam/result/internal/EventPublishingScanResultHandler.java
+++ b/src/main/java/org/apache/sling/clam/result/internal/EventPublishingScanResultHandler.java
@@ -63,7 +63,7 @@ public class EventPublishingScanResultHandler implements JcrPropertyScanResultHa
 
     private final Logger logger = LoggerFactory.getLogger(EventPublishingScanResultHandler.class);
 
-    public EventPublishingScanResultHandler() {
+    public EventPublishingScanResultHandler() { //
     }
 
     @Activate
diff --git a/src/main/java/org/apache/sling/clam/result/internal/MailSendingScanResultHandler.java
b/src/main/java/org/apache/sling/clam/result/internal/MailSendingScanResultHandler.java
index f0b2eda..a6590ba 100644
--- a/src/main/java/org/apache/sling/clam/result/internal/MailSendingScanResultHandler.java
+++ b/src/main/java/org/apache/sling/clam/result/internal/MailSendingScanResultHandler.java
@@ -79,7 +79,7 @@ public class MailSendingScanResultHandler implements JcrPropertyScanResultHandle
 
     private final Logger logger = LoggerFactory.getLogger(MailSendingScanResultHandler.class);
 
-    public MailSendingScanResultHandler() {
+    public MailSendingScanResultHandler() { //
     }
 
     @Activate
diff --git a/src/main/java/org/apache/sling/clam/result/internal/ResourcePersistingScanResultHandler.java
b/src/main/java/org/apache/sling/clam/result/internal/ResourcePersistingScanResultHandler.java
index fc9a9f4..04808f9 100644
--- a/src/main/java/org/apache/sling/clam/result/internal/ResourcePersistingScanResultHandler.java
+++ b/src/main/java/org/apache/sling/clam/result/internal/ResourcePersistingScanResultHandler.java
@@ -85,7 +85,7 @@ public class ResourcePersistingScanResultHandler implements JcrPropertyScanResul
 
     private ResourcePersistingScanResultHandlerConfiguration configuration;
 
-    private static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy/MM/dd/HH/mm/ss");
+    private final SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd/HH/mm/ss");
 
     private static final String NT_SLING_ORDERED_FOLDER = "sling:OrderedFolder";
 
@@ -97,7 +97,7 @@ public class ResourcePersistingScanResultHandler implements JcrPropertyScanResul
 
     private final Logger logger = LoggerFactory.getLogger(ResourcePersistingScanResultHandler.class);
 
-    public ResourcePersistingScanResultHandler() {
+    public ResourcePersistingScanResultHandler() { //
     }
 
     @Activate
@@ -157,7 +157,7 @@ public class ResourcePersistingScanResultHandler implements JcrPropertyScanResul
     }
 
     private Resource getOrCreateParent(final ResourceResolver resourceResolver) throws PersistenceException
{
-        final String path = String.format("%s/%s", configuration.result_root_path(), FORMAT.format(new
Date()));
+        final String path = String.format("%s/%s", configuration.result_root_path(), format.format(new
Date()));
         return ResourceUtil.getOrCreateResource(resourceResolver, path, NT_SLING_ORDERED_FOLDER,
NT_SLING_ORDERED_FOLDER, true);
     }
 


Mime
View raw message