From 7b1a23ef9b2aa4ec0c367a4b94395ed60798fef8 Mon Sep 17 00:00:00 2001 From: Simon Laurenz Date: Fri, 28 Jan 2022 14:28:40 +0100 Subject: [PATCH] Code smells --- .../RevocationBatchDownloadException.java | 7 +++-- .../RevocationBatchGoneException.java | 5 ++-- .../RevocationBatchParseException.java | 5 ++-- ...GatewayRevocationListDownloadIterator.java | 26 +++++++++++-------- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchDownloadException.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchDownloadException.java index 2fed739..61ea591 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchDownloadException.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchDownloadException.java @@ -2,17 +2,20 @@ import lombok.Getter; +@Getter public class RevocationBatchDownloadException extends RuntimeException { - @Getter - private int status = 500; + + private final int status; public RevocationBatchDownloadException(String message, Throwable inner) { super(message, inner); + this.status = 500; } public RevocationBatchDownloadException(String message) { super(message); + this.status = 500; } public RevocationBatchDownloadException(String message, Throwable inner, int status) { diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchGoneException.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchGoneException.java index 86d7c40..ce7d50b 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchGoneException.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchGoneException.java @@ -2,9 +2,10 @@ import lombok.Getter; +@Getter public class RevocationBatchGoneException extends RuntimeException { - @Getter - private String batchId; + + private final String batchId; public RevocationBatchGoneException(String message, String batchId) { super(message); diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchParseException.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchParseException.java index 74dda7a..5027a26 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchParseException.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/exception/RevocationBatchParseException.java @@ -2,9 +2,10 @@ import lombok.Getter; +@Getter public class RevocationBatchParseException extends RuntimeException { - @Getter - private String batchId; + + private final String batchId; public RevocationBatchParseException(String message, String batchId) { super(message); diff --git a/src/main/java/eu/europa/ec/dgc/gateway/connector/iterator/DgcGatewayRevocationListDownloadIterator.java b/src/main/java/eu/europa/ec/dgc/gateway/connector/iterator/DgcGatewayRevocationListDownloadIterator.java index fab7c18..6ab5a3f 100644 --- a/src/main/java/eu/europa/ec/dgc/gateway/connector/iterator/DgcGatewayRevocationListDownloadIterator.java +++ b/src/main/java/eu/europa/ec/dgc/gateway/connector/iterator/DgcGatewayRevocationListDownloadIterator.java @@ -37,7 +37,6 @@ /** * This class provides an Iterator for downloading the revocation List parts from the gateway. - * */ @ConditionalOnProperty("dgc.gateway.connector.enabled") @@ -58,6 +57,7 @@ public class DgcGatewayRevocationListDownloadIterator implements Iterator