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:55 UTC
[sling-org-apache-sling-commons-clam] 15/25: [checkstyle] (coding)
ReturnCount
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;
}
}