You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ro...@apache.org on 2020/06/08 13:16:22 UTC

[james-project] 28/30: JAMES-3179 Fix ClamAV thread safety issue

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

rouazana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 4c0a8a44d0ab8db6b1ec9b4572f4eeef5a33f659
Author: Gautier DI FOLCO <gd...@linagora.com>
AuthorDate: Thu May 14 11:50:37 2020 +0200

    JAMES-3179 Fix ClamAV thread safety issue
---
 .../org/apache/james/transport/mailets/ClamAVScan.java    | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/mailet/standard/src/main/java/org/apache/james/transport/mailets/ClamAVScan.java b/mailet/standard/src/main/java/org/apache/james/transport/mailets/ClamAVScan.java
index 9ad2565..7410e30 100644
--- a/mailet/standard/src/main/java/org/apache/james/transport/mailets/ClamAVScan.java
+++ b/mailet/standard/src/main/java/org/apache/james/transport/mailets/ClamAVScan.java
@@ -272,7 +272,7 @@ public class ClamAVScan extends GenericMailet {
      */
     protected void initDebug() {
         String debugParam = getInitParameter("debug");
-        setDebug((debugParam == null) ? false : Boolean.parseBoolean(debugParam));
+        this.debug = (debugParam != null) && Boolean.parseBoolean(debugParam);
     }
 
     /**
@@ -285,15 +285,6 @@ public class ClamAVScan extends GenericMailet {
     }
 
     /**
-     * Setter for property debug.
-     *
-     * @param debug New value of property debug.
-     */
-    public void setDebug(boolean debug) {
-        this.debug = debug;
-    }
-
-    /**
      * Initializer for property host.
      *
      * @throws UnknownHostException if unable to resolve the host name, or if invalid
@@ -311,7 +302,6 @@ public class ClamAVScan extends GenericMailet {
      * @return Value of property host.
      */
     public String getHost() {
-
         return this.host;
     }
 
@@ -324,8 +314,7 @@ public class ClamAVScan extends GenericMailet {
      * @param host New value of property host.
      * @throws UnknownHostException if unable to resolve the host name, or if invalid
      */
-    public void setHost(String host) throws UnknownHostException {
-
+    private void setHost(String host) throws UnknownHostException {
         this.host = host;
 
         setAddresses(InetAddress.getAllByName(host));


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org