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

[sling-org-apache-sling-commons-clam] branch master updated (e956f46 -> 6f3f31d)

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

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


    from e956f46  SLING-10667 Update to Sling Bundle Parent 44
     new 9d39716  SLING-10734 Enable code checks with Checkstyle
     new d247d7a  SLING-10735 Enable code checks with PMD
     new 1e3f210  SLING-10736 Enable code checks with SpotBugs
     new 98a5412  [checkstyle] (javadoc) MissingJavadocPackage
     new 5b06d9e  [checkstyle] (javadoc) JavadocPackage
     new c45fdee  [checkstyle] (javadoc) MissingJavadocType
     new ae3e5ce  style
     new 6915eed  [checkstyle] (javadoc) SummaryJavadoc
     new c7a0b0b  [checkstyle] (javadoc) MissingJavadocMethod
     new 1341ae6  [checkstyle] (misc) FinalParameters
     new 89b6a6c  [checkstyle] (modifier) RedundantModifier
     new 9f991f4  [checkstyle] (design) DesignForExtension
     new d4b695e  [checkstyle] (modifier) InterfaceMemberImpliedModifier
     new 6c0217c  [checkstyle] (coding) FinalLocalVariable
     new 5c78593  [checkstyle] (coding) ReturnCount
     new aeeb4f4  [checkstyle] (coding) MagicNumber
     new 5920d5d  fix Javadoc
     new 3823c77  [checkstyle] (coding) OverloadMethodsDeclarationOrder
     new 90addca  [checkstyle] (coding) MultipleStringLiterals
     new a97051c  [checkstyle] (coding) DeclarationOrder
     new a77ca3f  SLING-10734 Enable code checks with Checkstyle
     new a2a40ab  [checkstyle] (modifier) ClassMemberImpliedModifier
     new 3ec8154  [pmd] UnusedPrivateMethod
     new 724389f  [spotbugs] exclude UNENCRYPTED_SOCKET
     new 6f3f31d  SLING-10794 Update to Sling Bundle Parent 45

The 25 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.


Summary of changes:
 checkstyle-suppressions.xml                        | 25 ++++++++
 pmd-exclude.properties                             | 20 ++++++
 pom.xml                                            | 72 +++++++++++++++++++++-
 spotbugs-exclude.xml                               | 25 ++++++++
 .../org/apache/sling/commons/clam/ClamService.java |  7 ++-
 .../org/apache/sling/commons/clam/ScanResult.java  | 54 ++++++++++++++--
 .../sling/commons/clam/internal/ClamdService.java  | 49 +++++++++------
 .../InstreamSizeLimitExceededException.java        |  2 +-
 .../sling/commons/clam/internal/package-info.java  |  7 ++-
 .../apache/sling/commons/clam/package-info.java    |  4 ++
 10 files changed, 235 insertions(+), 30 deletions(-)
 create mode 100644 checkstyle-suppressions.xml
 create mode 100644 pmd-exclude.properties
 create mode 100644 spotbugs-exclude.xml
 copy Jenkinsfile => src/main/java/org/apache/sling/commons/clam/internal/package-info.java (77%)

[sling-org-apache-sling-commons-clam] 15/25: [checkstyle] (coding) ReturnCount

Posted by ol...@apache.org.
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-commons-clam.git

commit 5c785938bad1c88318ef9a8f8656b831a615ad48
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 21:54:28 2021 +0200

    [checkstyle] (coding) ReturnCount
---
 .../org/apache/sling/commons/clam/internal/ClamdService.java   | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index e03d655..ff1d5f1 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -226,15 +226,17 @@ public final class ClamdService implements ClamService, ContentAnalyzer {
     private ScanResult parseClamdReply(final byte[] reply, final long started, final long size) {
         final String message = new String(reply, StandardCharsets.US_ASCII).trim();
         logger.info("reply message from clam daemon: '{}'", message);
+        final ScanResult result;
         if (message.matches(OK_REPLY_PATTERN)) {
-            return new ScanResult(Status.OK, message, started, size);
+            result = new ScanResult(Status.OK, message, started, size);
         } else if (message.matches(FOUND_REPLY_PATTERN)) {
-            return new ScanResult(Status.FOUND, message, started, size);
+            result = new ScanResult(Status.FOUND, message, started, size);
         } else if (message.matches(INSTREAM_SIZE_LIMIT_EXCEEDED_PATTERN)) {
-            return new ScanResult(Status.ERROR, message, started, size);
+            result = new ScanResult(Status.ERROR, message, started, size);
         } else {
-            return new ScanResult(Status.UNKNOWN, message, started, size);
+            result = new ScanResult(Status.UNKNOWN, message, started, size);
         }
+        return result;
     }
 
 }

[sling-org-apache-sling-commons-clam] 13/25: [checkstyle] (modifier) InterfaceMemberImpliedModifier

Posted by ol...@apache.org.
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-commons-clam.git

commit d4b695ef64d31967182010a2d36c271ccf51fada
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 21:47:15 2021 +0200

    [checkstyle] (modifier) InterfaceMemberImpliedModifier
---
 src/main/java/org/apache/sling/commons/clam/ClamService.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/ClamService.java b/src/main/java/org/apache/sling/commons/clam/ClamService.java
index 11eeb3b..d223d2a 100644
--- a/src/main/java/org/apache/sling/commons/clam/ClamService.java
+++ b/src/main/java/org/apache/sling/commons/clam/ClamService.java
@@ -37,6 +37,6 @@ public interface ClamService {
      * @return The scan result from Clam
      * @throws IOException if scanning data or parsing reply fails
      */
-    @NotNull ScanResult scan(@NotNull final InputStream data) throws IOException;
+    public abstract @NotNull ScanResult scan(@NotNull final InputStream data) throws IOException;
 
 }

[sling-org-apache-sling-commons-clam] 12/25: [checkstyle] (design) DesignForExtension

Posted by ol...@apache.org.
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-commons-clam.git

commit 9f991f46225fc870acf9100e031611008e52f7a7
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 21:43:39 2021 +0200

    [checkstyle] (design) DesignForExtension
---
 src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index 1bc152e..477ab73 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory;
 @Designate(
     ocd = ClamdServiceConfiguration.class
 )
-public class ClamdService implements ClamService, ContentAnalyzer {
+public final class ClamdService implements ClamService, ContentAnalyzer {
 
     private ClamdServiceConfiguration configuration;
 

[sling-org-apache-sling-commons-clam] 19/25: [checkstyle] (coding) MultipleStringLiterals

Posted by ol...@apache.org.
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-commons-clam.git

commit 90addca20803a994b1c32c61477e3632aa692f8b
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 22:10:30 2021 +0200

    [checkstyle] (coding) MultipleStringLiterals
---
 checkstyle-suppressions.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml
index ab86136..844253a 100644
--- a/checkstyle-suppressions.xml
+++ b/checkstyle-suppressions.xml
@@ -21,4 +21,5 @@
 <suppressions>
   <suppress checks="MissingJavadocMethod" files=".*\/internal\/.*\.java"/>
   <suppress checks="OverloadMethodsDeclarationOrder" files=".*\/ClamdService\.java"/>
+  <suppress checks="MultipleStringLiterals" files=".*\/ClamdService\.java"/>
 </suppressions>

[sling-org-apache-sling-commons-clam] 14/25: [checkstyle] (coding) FinalLocalVariable

Posted by ol...@apache.org.
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-commons-clam.git

commit 6c0217ce2004fb0361ad4053efa4bbc0a11a2d64
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 21:50:26 2021 +0200

    [checkstyle] (coding) FinalLocalVariable
---
 src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index 477ab73..e03d655 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -190,7 +190,7 @@ public final class ClamdService implements ClamService, ContentAnalyzer {
             out.flush();
 
             // send data in chunks
-            byte[] data = new byte[configuration.chunk_length()];
+            final byte[] data = new byte[configuration.chunk_length()];
             long total = 0;
             int read = inputStream.read(data);
             while (read >= 0) {

[sling-org-apache-sling-commons-clam] 24/25: [spotbugs] exclude UNENCRYPTED_SOCKET

Posted by ol...@apache.org.
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-commons-clam.git

commit 724389ff58670d3fbfa0687626584103b8b4c83a
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Sep 9 15:49:10 2021 +0200

    [spotbugs] exclude UNENCRYPTED_SOCKET
---
 spotbugs-exclude.xml | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml
new file mode 100644
index 0000000..6e17a67
--- /dev/null
+++ b/spotbugs-exclude.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<FindBugsFilter>
+  <Match>
+    <Bug pattern="UNENCRYPTED_SOCKET"/>
+    <Class name="org.apache.sling.commons.clam.internal.ClamdService"/>
+  </Match>
+</FindBugsFilter>

[sling-org-apache-sling-commons-clam] 11/25: [checkstyle] (modifier) RedundantModifier

Posted by ol...@apache.org.
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-commons-clam.git

commit 89b6a6cc1d9d986837d77e658b55366dfd07e4d9
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 21:40:19 2021 +0200

    [checkstyle] (modifier) RedundantModifier
---
 .../org/apache/sling/commons/clam/internal/ClamdService.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index ecef5fc..1bc152e 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -133,9 +133,9 @@ public class ClamdService implements ClamService, ContentAnalyzer {
 
     private byte[] doPing() throws IOException {
         logger.info("pinging clam daemon at {}:{}", configuration.clamd_host(), configuration.clamd_port());
-        try (final Socket socket = new Socket(configuration.clamd_host(), configuration.clamd_port());
-             final OutputStream out = new BufferedOutputStream(socket.getOutputStream());
-             final InputStream in = socket.getInputStream()) {
+        try (Socket socket = new Socket(configuration.clamd_host(), configuration.clamd_port());
+             OutputStream out = new BufferedOutputStream(socket.getOutputStream());
+             InputStream in = socket.getInputStream()) {
 
             socket.setSoTimeout(configuration.connection_timeout());
 
@@ -179,9 +179,9 @@ public class ClamdService implements ClamService, ContentAnalyzer {
     private ScanResult doInstream(final InputStream inputStream) throws IOException, InstreamSizeLimitExceededException {
         logger.info("connecting to clam daemon at {}:{} for scanning", configuration.clamd_host(), configuration.clamd_port());
         final long started = System.currentTimeMillis();
-        try (final Socket socket = new Socket(configuration.clamd_host(), configuration.clamd_port());
-             final OutputStream out = new BufferedOutputStream(socket.getOutputStream());
-             final InputStream in = socket.getInputStream()) {
+        try (Socket socket = new Socket(configuration.clamd_host(), configuration.clamd_port());
+             OutputStream out = new BufferedOutputStream(socket.getOutputStream());
+             InputStream in = socket.getInputStream()) {
 
             socket.setSoTimeout(configuration.connection_timeout());
 

[sling-org-apache-sling-commons-clam] 17/25: fix Javadoc

Posted by ol...@apache.org.
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-commons-clam.git

commit 5920d5d168097bac71be8b012e6f3a6c2cbbf30b
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 22:07:35 2021 +0200

    fix Javadoc
---
 .../java/org/apache/sling/commons/clam/internal/ClamdService.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index 3a42143..3db1449 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -170,8 +170,8 @@ public final class ClamdService implements ClamService, ContentAnalyzer {
      * It is mandatory to prefix this command with n or z.
      * Scan a stream of data. The stream is sent to clamd in chunks, after INSTREAM, on the same socket on which the
      * command was sent.  This avoids the overhead of establishing new TCP connections and problems with NAT.
-     * The format  of the chunk is: '<length><data>' where <length> is the size of the following data in bytes
-     * expressed as a 4 byte unsigned integer in network byte order and <data> is the actual chunk.
+     * The format  of the chunk is: '&lt;length&gt;&lt;data&gt;' where &lt;length&gt; is the size of the following data in bytes
+     * expressed as a 4 byte unsigned integer in network byte order and &lt;data&gt; is the actual chunk.
      * Streaming is terminated by sending a zero-length chunk.
      * Note: do not exceed StreamMaxLength as defined in clamd.conf, otherwise clamd will reply with INSTREAM size
      * limit exceeded and close the connection.

[sling-org-apache-sling-commons-clam] 03/25: SLING-10736 Enable code checks with SpotBugs

Posted by ol...@apache.org.
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-commons-clam.git

commit 1e3f210ed4f16b6fe4159f187f269416696b6edb
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Aug 16 15:05:34 2021 +0200

    SLING-10736 Enable code checks with SpotBugs
---
 pom.xml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pom.xml b/pom.xml
index ff16fa1..d135dea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -126,6 +126,29 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>com.github.spotbugs</groupId>
+        <artifactId>spotbugs-maven-plugin</artifactId>
+        <version>4.3.0</version>
+        <configuration>
+          <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
+          <plugins>
+            <plugin>
+              <groupId>com.h3xstream.findsecbugs</groupId>
+              <artifactId>findsecbugs-plugin</artifactId>
+              <version>1.11.0</version>
+            </plugin>
+          </plugins>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 

[sling-org-apache-sling-commons-clam] 08/25: [checkstyle] (javadoc) SummaryJavadoc

Posted by ol...@apache.org.
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-commons-clam.git

commit 6915eed56ba6299a11992acca2c86a264e0b3842
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 17:14:43 2021 +0200

    [checkstyle] (javadoc) SummaryJavadoc
---
 src/main/java/org/apache/sling/commons/clam/ClamService.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/main/java/org/apache/sling/commons/clam/ClamService.java b/src/main/java/org/apache/sling/commons/clam/ClamService.java
index eae268f..11eeb3b 100644
--- a/src/main/java/org/apache/sling/commons/clam/ClamService.java
+++ b/src/main/java/org/apache/sling/commons/clam/ClamService.java
@@ -31,6 +31,8 @@ import org.osgi.annotation.versioning.ProviderType;
 public interface ClamService {
 
     /**
+     * Scans the given data for malware and returns the scan result.
+     *
      * @param data The data to scan for malware
      * @return The scan result from Clam
      * @throws IOException if scanning data or parsing reply fails

[sling-org-apache-sling-commons-clam] 01/25: SLING-10734 Enable code checks with Checkstyle

Posted by ol...@apache.org.
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-commons-clam.git

commit 9d39716e8d5c54f5cdaa612ce98bb0b372d36a89
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Aug 16 15:02:33 2021 +0200

    SLING-10734 Enable code checks with Checkstyle
---
 pom.xml | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/pom.xml b/pom.xml
index 4d79f3d..5114b00 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,6 +82,34 @@
           </systemPropertyVariables>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>3.1.2</version>
+        <dependencies>
+          <dependency>
+            <groupId>com.puppycrawl.tools</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>8.45.1</version>
+          </dependency>
+          <dependency>
+            <groupId>de.bildschirmarbeiter</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>2</version>
+          </dependency>
+        </dependencies>
+        <configuration>
+          <configLocation>checks.xml</configLocation>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 

[sling-org-apache-sling-commons-clam] 21/25: SLING-10734 Enable code checks with Checkstyle

Posted by ol...@apache.org.
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-commons-clam.git

commit a77ca3ff51e7ab76b21204f83edb1a2f0d853860
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 23:02:21 2021 +0200

    SLING-10734 Enable code checks with Checkstyle
    
    * Use de.bildschirmarbeiter:checkstyle:3
    * Update Checkstyle to 9.0
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5343bb1..8ee8df1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -90,12 +90,12 @@
           <dependency>
             <groupId>com.puppycrawl.tools</groupId>
             <artifactId>checkstyle</artifactId>
-            <version>8.45.1</version>
+            <version>9.0</version>
           </dependency>
           <dependency>
             <groupId>de.bildschirmarbeiter</groupId>
             <artifactId>checkstyle</artifactId>
-            <version>2</version>
+            <version>3</version>
           </dependency>
         </dependencies>
         <configuration>

[sling-org-apache-sling-commons-clam] 02/25: SLING-10735 Enable code checks with PMD

Posted by ol...@apache.org.
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-commons-clam.git

commit d247d7acd5229dd3a76b5a643ded17bf00545e0a
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Aug 16 15:04:27 2021 +0200

    SLING-10735 Enable code checks with PMD
---
 pom.xml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/pom.xml b/pom.xml
index 5114b00..ff16fa1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,6 +110,22 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <version>3.14.0</version>
+        <configuration>
+          <targetJdk>${sling.java.version}</targetJdk>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>process-classes</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 

[sling-org-apache-sling-commons-clam] 07/25: style

Posted by ol...@apache.org.
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-commons-clam.git

commit ae3e5ce7e5afc20e7aa0260e0d93017e39a9a343
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Aug 18 10:57:52 2021 +0200

    style
---
 src/main/java/org/apache/sling/commons/clam/ScanResult.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/ScanResult.java b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
index 4e57080..1483717 100644
--- a/src/main/java/org/apache/sling/commons/clam/ScanResult.java
+++ b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
@@ -48,13 +48,11 @@ public class ScanResult {
         return timestamp;
     }
 
-    @NotNull
-    public Status getStatus() {
+    public @NotNull Status getStatus() {
         return status;
     }
 
-    @NotNull
-    public String getMessage() {
+    public @NotNull String getMessage() {
         return message;
     }
 

[sling-org-apache-sling-commons-clam] 23/25: [pmd] UnusedPrivateMethod

Posted by ol...@apache.org.
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-commons-clam.git

commit 3ec815487f28374405d70f5ebe10e4c10979d11b
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Sep 9 15:18:16 2021 +0200

    [pmd] UnusedPrivateMethod
---
 src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index eaeaa42..40176b1 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -83,18 +83,21 @@ public final class ClamdService implements ClamService, ContentAnalyzer {
     }
 
     @Activate
+    @SuppressWarnings("unused")
     private void activate(final ClamdServiceConfiguration configuration) {
         logger.debug("activating");
         configure(configuration);
     }
 
     @Modified
+    @SuppressWarnings("unused")
     private void modified(final ClamdServiceConfiguration configuration) {
         logger.debug("modifying");
         configure(configuration);
     }
 
     @Deactivate
+    @SuppressWarnings("unused")
     private void deactivate() {
         logger.debug("deactivating");
     }

[sling-org-apache-sling-commons-clam] 09/25: [checkstyle] (javadoc) MissingJavadocMethod

Posted by ol...@apache.org.
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-commons-clam.git

commit c7a0b0bfdc66b055da713879e71c88fbb76c00ff
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 21:14:17 2021 +0200

    [checkstyle] (javadoc) MissingJavadocMethod
---
 checkstyle-suppressions.xml                        | 23 +++++++++++++
 pom.xml                                            |  2 ++
 .../org/apache/sling/commons/clam/ScanResult.java  | 38 ++++++++++++++++++++++
 3 files changed, 63 insertions(+)

diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml
new file mode 100644
index 0000000..12cdfea
--- /dev/null
+++ b/checkstyle-suppressions.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "https://checkstyle.org/dtds/suppressions_1_2.dtd">
+<suppressions>
+  <suppress checks="MissingJavadocMethod" files=".*\/internal\/.*\.java"/>
+</suppressions>
diff --git a/pom.xml b/pom.xml
index d135dea..5343bb1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -100,6 +100,8 @@
         </dependencies>
         <configuration>
           <configLocation>checks.xml</configLocation>
+          <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
+          <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
         </configuration>
         <executions>
           <execution>
diff --git a/src/main/java/org/apache/sling/commons/clam/ScanResult.java b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
index 1483717..55ee901 100644
--- a/src/main/java/org/apache/sling/commons/clam/ScanResult.java
+++ b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
@@ -37,6 +37,14 @@ public class ScanResult {
 
     private final long size;
 
+    /**
+     * Creates a new <code>ScanResult</code> with the given initial parameters.
+     *
+     * @param status  The parsed status from Clam
+     * @param message The message from Clam
+     * @param started The start time of the scan
+     * @param size    The number of bytes sent to Clam for scanning
+     */
     public ScanResult(@NotNull final Status status, @NotNull final String message, long started, long size) {
         this.status = status;
         this.message = message;
@@ -44,26 +52,56 @@ public class ScanResult {
         this.size = size;
     }
 
+    /**
+     * Returns the timestamp of the scan result.
+     *
+     * @return The time in milliseconds the scan result was created
+     */
     public long getTimestamp() {
         return timestamp;
     }
 
+    /**
+     * Returns the parsed status from Clam.
+     *
+     * @return The parsed status from Clam
+     */
     public @NotNull Status getStatus() {
         return status;
     }
 
+    /**
+     * Returns the message from Clam.
+     *
+     * @return The message from Clam
+     */
     public @NotNull String getMessage() {
         return message;
     }
 
+    /**
+     * Returns the start time of the scan.
+     *
+     * @return The time in milliseconds the scan was started
+     */
     public long getStarted() {
         return started;
     }
 
+    /**
+     * Returns the size of data sent to Clam for scanning.
+     *
+     * @return The number of bytes sent to Clam
+     */
     public long getSize() {
         return size;
     }
 
+    /**
+     * Returns <code>true</code> when scanning was successful and no malware was found by Clam in sent data.
+     *
+     * @return <code>true</code> if status is <code>OK</code>, otherwise <code>false</code>
+     */
     public boolean isOk() {
         return Status.OK.equals(status);
     }

[sling-org-apache-sling-commons-clam] 06/25: [checkstyle] (javadoc) MissingJavadocType

Posted by ol...@apache.org.
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-commons-clam.git

commit c45fdee18f49eb729c059a8cb9adb580d01133f3
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Aug 17 22:39:17 2021 +0200

    [checkstyle] (javadoc) MissingJavadocType
---
 src/main/java/org/apache/sling/commons/clam/ClamService.java        | 3 +++
 src/main/java/org/apache/sling/commons/clam/ScanResult.java         | 6 ++++++
 .../java/org/apache/sling/commons/clam/internal/ClamdService.java   | 3 +++
 3 files changed, 12 insertions(+)

diff --git a/src/main/java/org/apache/sling/commons/clam/ClamService.java b/src/main/java/org/apache/sling/commons/clam/ClamService.java
index 99f9680..eae268f 100644
--- a/src/main/java/org/apache/sling/commons/clam/ClamService.java
+++ b/src/main/java/org/apache/sling/commons/clam/ClamService.java
@@ -24,6 +24,9 @@ import java.io.InputStream;
 import org.jetbrains.annotations.NotNull;
 import org.osgi.annotation.versioning.ProviderType;
 
+/**
+ * Service to scan data for malware with ClamAV.
+ */
 @ProviderType
 public interface ClamService {
 
diff --git a/src/main/java/org/apache/sling/commons/clam/ScanResult.java b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
index 27c9cad..4e57080 100644
--- a/src/main/java/org/apache/sling/commons/clam/ScanResult.java
+++ b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
@@ -21,6 +21,9 @@ package org.apache.sling.commons.clam;
 import org.jetbrains.annotations.NotNull;
 import org.osgi.annotation.versioning.ProviderType;
 
+/**
+ * Scan result contains the message from Clam, the parsed status and additional metadata.
+ */
 @ProviderType
 public class ScanResult {
 
@@ -67,6 +70,9 @@ public class ScanResult {
         return Status.OK.equals(status);
     }
 
+    /**
+     * Status based on reply message from Clam (<code>OK</code>, <code>FOUND</code>, <code>ERROR</code>) or <code>UNKNOWN</code> if parsing reply message failed.
+     */
     public enum Status {
         OK,
         FOUND,
diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index 9753126..e03293f 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -46,6 +46,9 @@ import org.osgi.service.metatype.annotations.Designate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+/**
+ * Service for scanning data with Clam daemon.<br>Connections are established via TCP/IP.
+ */
 @Component(
     property = {
         Constants.SERVICE_DESCRIPTION + "=Sling Commons Clamd Service",

[sling-org-apache-sling-commons-clam] 25/25: SLING-10794 Update to Sling Bundle Parent 45

Posted by ol...@apache.org.
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-commons-clam.git

commit 6f3f31de6c36a4211efa686520c7b41b6b43e616
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Sep 9 17:22:27 2021 +0200

    SLING-10794 Update to Sling Bundle Parent 45
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 007bf1c..f11743e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.sling</groupId>
     <artifactId>sling-bundle-parent</artifactId>
-    <version>44</version>
+    <version>45</version>
     <relativePath />
   </parent>
 

[sling-org-apache-sling-commons-clam] 10/25: [checkstyle] (misc) FinalParameters

Posted by ol...@apache.org.
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-commons-clam.git

commit 1341ae6b3d1999d75d35745f871b8872f85832d0
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 21:36:47 2021 +0200

    [checkstyle] (misc) FinalParameters
---
 src/main/java/org/apache/sling/commons/clam/ScanResult.java           | 2 +-
 .../java/org/apache/sling/commons/clam/internal/ClamdService.java     | 4 ++--
 .../commons/clam/internal/InstreamSizeLimitExceededException.java     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/ScanResult.java b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
index 55ee901..dd8c9dc 100644
--- a/src/main/java/org/apache/sling/commons/clam/ScanResult.java
+++ b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
@@ -45,7 +45,7 @@ public class ScanResult {
      * @param started The start time of the scan
      * @param size    The number of bytes sent to Clam for scanning
      */
-    public ScanResult(@NotNull final Status status, @NotNull final String message, long started, long size) {
+    public ScanResult(@NotNull final Status status, @NotNull final String message, final long started, final long size) {
         this.status = status;
         this.message = message;
         this.started = started;
diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index e03293f..ecef5fc 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -112,7 +112,7 @@ public class ClamdService implements ClamService, ContentAnalyzer {
     }
 
     @Override
-    public @NotNull CompletableFuture<Void> analyze(@NotNull InputStream input, @Nullable Map<String, Object> parameters, @NotNull Map<String, Object> report) {
+    public @NotNull CompletableFuture<Void> analyze(@NotNull final InputStream input, @Nullable final Map<String, Object> parameters, @NotNull final Map<String, Object> report) {
         return CompletableFuture.runAsync(() -> {
             try {
                 scan(input, report);
@@ -122,7 +122,7 @@ public class ClamdService implements ClamService, ContentAnalyzer {
         });
     }
 
-    private void scan(@NotNull final InputStream inputStream, @NotNull Map<String, Object> report) throws IOException {
+    private void scan(@NotNull final InputStream inputStream, @NotNull final Map<String, Object> report) throws IOException {
         final ScanResult scanResult = scan(inputStream);
         report.put("sling.commons.clam.scanresult.timestamp", scanResult.getTimestamp());
         report.put("sling.commons.clam.scanresult.status", scanResult.getStatus());
diff --git a/src/main/java/org/apache/sling/commons/clam/internal/InstreamSizeLimitExceededException.java b/src/main/java/org/apache/sling/commons/clam/internal/InstreamSizeLimitExceededException.java
index afdf95f..e2f43cc 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/InstreamSizeLimitExceededException.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/InstreamSizeLimitExceededException.java
@@ -26,7 +26,7 @@ class InstreamSizeLimitExceededException extends Exception {
 
     private final long size;
 
-    InstreamSizeLimitExceededException(final byte[] reply, long started, long size) {
+    InstreamSizeLimitExceededException(final byte[] reply, final long started, final long size) {
         super(new String(reply, StandardCharsets.US_ASCII).trim());
         this.started = started;
         this.size = size;

[sling-org-apache-sling-commons-clam] 18/25: [checkstyle] (coding) OverloadMethodsDeclarationOrder

Posted by ol...@apache.org.
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-commons-clam.git

commit 3823c77c6a6fd87eb2bfca4ba0cc0a40d97f444c
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 22:09:19 2021 +0200

    [checkstyle] (coding) OverloadMethodsDeclarationOrder
---
 checkstyle-suppressions.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml
index 12cdfea..ab86136 100644
--- a/checkstyle-suppressions.xml
+++ b/checkstyle-suppressions.xml
@@ -20,4 +20,5 @@
 <!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "https://checkstyle.org/dtds/suppressions_1_2.dtd">
 <suppressions>
   <suppress checks="MissingJavadocMethod" files=".*\/internal\/.*\.java"/>
+  <suppress checks="OverloadMethodsDeclarationOrder" files=".*\/ClamdService\.java"/>
 </suppressions>

[sling-org-apache-sling-commons-clam] 20/25: [checkstyle] (coding) DeclarationOrder

Posted by ol...@apache.org.
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-commons-clam.git

commit a97051c8733ef7452e5d75cabe59d31316e1dadc
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 22:14:03 2021 +0200

    [checkstyle] (coding) DeclarationOrder
---
 .../java/org/apache/sling/commons/clam/internal/ClamdService.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index 3db1449..eaeaa42 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -60,8 +60,6 @@ import org.slf4j.LoggerFactory;
 )
 public final class ClamdService implements ClamService, ContentAnalyzer {
 
-    private ClamdServiceConfiguration configuration;
-
     private static final byte[] PING_COMMAND = "nPING\n".getBytes(StandardCharsets.US_ASCII);
 
     private static final byte[] PONG_REPLY = "PONG\n".getBytes(StandardCharsets.US_ASCII);
@@ -77,6 +75,8 @@ public final class ClamdService implements ClamService, ContentAnalyzer {
     // length is the size of the following data in bytes expressed as a 4 byte unsigned integer in network byte order
     private static final int CHUNK_LENGTH_DATUM_SIZE = 4;
 
+    private ClamdServiceConfiguration configuration;
+
     private final Logger logger = LoggerFactory.getLogger(ClamdService.class);
 
     public ClamdService() { //

[sling-org-apache-sling-commons-clam] 16/25: [checkstyle] (coding) MagicNumber

Posted by ol...@apache.org.
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-commons-clam.git

commit aeeb4f4b8eb535f19573ca109a20f98bd43b38bd
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Wed Sep 8 22:04:47 2021 +0200

    [checkstyle] (coding) MagicNumber
---
 .../java/org/apache/sling/commons/clam/internal/ClamdService.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
index ff1d5f1..3a42143 100644
--- a/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
+++ b/src/main/java/org/apache/sling/commons/clam/internal/ClamdService.java
@@ -74,6 +74,9 @@ public final class ClamdService implements ClamService, ContentAnalyzer {
 
     private static final String INSTREAM_SIZE_LIMIT_EXCEEDED_PATTERN = "INSTREAM size limit exceeded. ERROR";
 
+    // length is the size of the following data in bytes expressed as a 4 byte unsigned integer in network byte order
+    private static final int CHUNK_LENGTH_DATUM_SIZE = 4;
+
     private final Logger logger = LoggerFactory.getLogger(ClamdService.class);
 
     public ClamdService() { //
@@ -196,7 +199,7 @@ public final class ClamdService implements ClamService, ContentAnalyzer {
             while (read >= 0) {
                 logger.trace("current chunk length: {}", read);
                 total = total + read;
-                final byte[] length = ByteBuffer.allocate(4).putInt(read).array();
+                final byte[] length = ByteBuffer.allocate(CHUNK_LENGTH_DATUM_SIZE).putInt(read).array();
 
                 out.write(length);
                 out.write(data, 0, read);

[sling-org-apache-sling-commons-clam] 04/25: [checkstyle] (javadoc) MissingJavadocPackage

Posted by ol...@apache.org.
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-commons-clam.git

commit 98a54123963b0e821cd23403c0b49ca38187689b
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Aug 17 22:26:05 2021 +0200

    [checkstyle] (javadoc) MissingJavadocPackage
---
 src/main/java/org/apache/sling/commons/clam/package-info.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/org/apache/sling/commons/clam/package-info.java b/src/main/java/org/apache/sling/commons/clam/package-info.java
index 848b02a..d8d7e2f 100644
--- a/src/main/java/org/apache/sling/commons/clam/package-info.java
+++ b/src/main/java/org/apache/sling/commons/clam/package-info.java
@@ -16,6 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
+/**
+ * Provides the Apache Sling Commons Clam API.
+ */
 @Version("2.0.0")
 package org.apache.sling.commons.clam;
 

[sling-org-apache-sling-commons-clam] 05/25: [checkstyle] (javadoc) JavadocPackage

Posted by ol...@apache.org.
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-commons-clam.git

commit 5b06d9e98ee13b2018c700a3bc4a59bc55a9a397
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Aug 17 22:31:20 2021 +0200

    [checkstyle] (javadoc) JavadocPackage
---
 .../sling/commons/clam/internal/package-info.java  | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/main/java/org/apache/sling/commons/clam/internal/package-info.java b/src/main/java/org/apache/sling/commons/clam/internal/package-info.java
new file mode 100644
index 0000000..07b753f
--- /dev/null
+++ b/src/main/java/org/apache/sling/commons/clam/internal/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Provides an implementation of Commons Clam API (<code>ClamService</code>) and Commons Content Analyzing API (<code>ContentAnalyzer</code>) using Clam daemon for malware detection.
+ */
+package org.apache.sling.commons.clam.internal;

[sling-org-apache-sling-commons-clam] 22/25: [checkstyle] (modifier) ClassMemberImpliedModifier

Posted by ol...@apache.org.
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-commons-clam.git

commit a2a40ab4a6fe17048f7d8a3c54a3972fa6cf2a0d
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Sep 9 15:10:33 2021 +0200

    [checkstyle] (modifier) ClassMemberImpliedModifier
---
 pmd-exclude.properties                               | 20 ++++++++++++++++++++
 pom.xml                                              |  1 +
 .../org/apache/sling/commons/clam/ScanResult.java    |  2 +-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/pmd-exclude.properties b/pmd-exclude.properties
new file mode 100644
index 0000000..99d778e
--- /dev/null
+++ b/pmd-exclude.properties
@@ -0,0 +1,20 @@
+################################################################################
+#
+#    Licensed to the Apache Software Foundation (ASF) under one or more
+#    contributor license agreements.  See the NOTICE file distributed with
+#    this work for additional information regarding copyright ownership.
+#    The ASF licenses this file to You under the Apache License, Version 2.0
+#    (the "License"); you may not use this file except in compliance with
+#    the License.  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+################################################################################
+org.apache.sling.commons.clam.ClamService=UnnecessaryModifier
+org.apache.sling.commons.clam.ScanResult$Status=UnnecessaryModifier
diff --git a/pom.xml b/pom.xml
index 8ee8df1..007bf1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -118,6 +118,7 @@
         <version>3.14.0</version>
         <configuration>
           <targetJdk>${sling.java.version}</targetJdk>
+          <excludeFromFailureFile>pmd-exclude.properties</excludeFromFailureFile>
         </configuration>
         <executions>
           <execution>
diff --git a/src/main/java/org/apache/sling/commons/clam/ScanResult.java b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
index dd8c9dc..0ad9feb 100644
--- a/src/main/java/org/apache/sling/commons/clam/ScanResult.java
+++ b/src/main/java/org/apache/sling/commons/clam/ScanResult.java
@@ -109,7 +109,7 @@ public class ScanResult {
     /**
      * Status based on reply message from Clam (<code>OK</code>, <code>FOUND</code>, <code>ERROR</code>) or <code>UNKNOWN</code> if parsing reply message failed.
      */
-    public enum Status {
+    public static enum Status {
         OK,
         FOUND,
         ERROR,