From f2437579c87e251a63c38195ad318e0964300edb Mon Sep 17 00:00:00 2001 From: Ori Bruk Date: Wed, 13 Nov 2024 17:03:00 +0300 Subject: [PATCH] [#27] Add more modules to CheckStyle Signed-off-by: Ori Bruk --- checkstyle.xml | 10 ++++++++++ .../info/frostfs/sdk/annotations/NotNull.java | 2 +- .../frostfs/sdk/services/ApeManagerClient.java | 2 +- .../frostfs/sdk/services/ContextAccessor.java | 1 - .../sdk/services/impl/SessionToolsImpl.java | 1 - .../sdk/services/impl/interceptor/Labels.java | 15 ++++++++++++--- .../info/frostfs/sdk/tools/RequestSigner.java | 1 - .../java/info/frostfs/sdk/utils/Validator.java | 3 +++ .../java/info/frostfs/sdk/utils/WaitUtil.java | 2 ++ .../info/frostfs/sdk/constants/FilterConst.java | 3 +++ 10 files changed, 32 insertions(+), 8 deletions(-) diff --git a/checkstyle.xml b/checkstyle.xml index 78ea3ce..6afa5a7 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -10,6 +10,7 @@ + @@ -20,6 +21,15 @@ + + + + + + + + + diff --git a/client/src/main/java/info/frostfs/sdk/annotations/NotNull.java b/client/src/main/java/info/frostfs/sdk/annotations/NotNull.java index 2780c70..a23bdc4 100644 --- a/client/src/main/java/info/frostfs/sdk/annotations/NotNull.java +++ b/client/src/main/java/info/frostfs/sdk/annotations/NotNull.java @@ -8,4 +8,4 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface NotNull { -} \ No newline at end of file +} diff --git a/client/src/main/java/info/frostfs/sdk/services/ApeManagerClient.java b/client/src/main/java/info/frostfs/sdk/services/ApeManagerClient.java index 37e4033..5c5263c 100644 --- a/client/src/main/java/info/frostfs/sdk/services/ApeManagerClient.java +++ b/client/src/main/java/info/frostfs/sdk/services/ApeManagerClient.java @@ -11,4 +11,4 @@ public interface ApeManagerClient { void removeChain(Chain chain, ChainTarget chainTarget); List listChains(ChainTarget chainTarget); -} \ No newline at end of file +} diff --git a/client/src/main/java/info/frostfs/sdk/services/ContextAccessor.java b/client/src/main/java/info/frostfs/sdk/services/ContextAccessor.java index 3658609..8663d53 100644 --- a/client/src/main/java/info/frostfs/sdk/services/ContextAccessor.java +++ b/client/src/main/java/info/frostfs/sdk/services/ContextAccessor.java @@ -10,5 +10,4 @@ public class ContextAccessor { public ContextAccessor(ClientEnvironment context) { this.context = context; } - } diff --git a/client/src/main/java/info/frostfs/sdk/services/impl/SessionToolsImpl.java b/client/src/main/java/info/frostfs/sdk/services/impl/SessionToolsImpl.java index e0d3a06..1ee5cbd 100644 --- a/client/src/main/java/info/frostfs/sdk/services/impl/SessionToolsImpl.java +++ b/client/src/main/java/info/frostfs/sdk/services/impl/SessionToolsImpl.java @@ -23,5 +23,4 @@ public class SessionToolsImpl extends ContextAccessor implements SessionTools { return SessionMapper.deserializeSessionToken(sessionToken.getToken()); } - } diff --git a/client/src/main/java/info/frostfs/sdk/services/impl/interceptor/Labels.java b/client/src/main/java/info/frostfs/sdk/services/impl/interceptor/Labels.java index d026854..ba44eaf 100644 --- a/client/src/main/java/info/frostfs/sdk/services/impl/interceptor/Labels.java +++ b/client/src/main/java/info/frostfs/sdk/services/impl/interceptor/Labels.java @@ -9,14 +9,21 @@ import java.util.Collections; import java.util.List; public class Labels { - /** Merges two string lists into an array, maintaining order of first list then second list. */ + private Labels() { + } + + /** + * Merges two string lists into an array, maintaining order of first list then second list. + */ static String[] asArray(List firstList, List secondList) { List list = new ArrayList<>(firstList); list.addAll(secondList); return list.toArray(new String[0]); } - /** Converts a list of strings to a list of grpc metadata keys. */ + /** + * Converts a list of strings to a list of grpc metadata keys. + */ static List> metadataKeys(List headerNames) { List> keys = new ArrayList<>(); for (String name : headerNames) { @@ -41,7 +48,9 @@ public class Labels { return Collections.unmodifiableList(labels); } - /** Adds standard labels, as well as custom ones, in order, to a given collector. */ + /** + * Adds standard labels, as well as custom ones, in order, to a given collector. + */ static T addLabels(SimpleCollector collector, List labels, GrpcMethod method) { List allLabels = new ArrayList<>(); allLabels.add(method.type()); diff --git a/client/src/main/java/info/frostfs/sdk/tools/RequestSigner.java b/client/src/main/java/info/frostfs/sdk/tools/RequestSigner.java index b2ba3d4..a01e4c7 100644 --- a/client/src/main/java/info/frostfs/sdk/tools/RequestSigner.java +++ b/client/src/main/java/info/frostfs/sdk/tools/RequestSigner.java @@ -119,5 +119,4 @@ public class RequestSigner { MessageHelper.setField(verifyBuilder, ORIGIN_SIGNATURE_FIELD_NAME, signMessagePart(key, verifyOrigin)); MessageHelper.setField(request, VERIFY_HEADER_FIELD_NAME, verifyBuilder.build()); } - } diff --git a/client/src/main/java/info/frostfs/sdk/utils/Validator.java b/client/src/main/java/info/frostfs/sdk/utils/Validator.java index 212debd..316f4c8 100644 --- a/client/src/main/java/info/frostfs/sdk/utils/Validator.java +++ b/client/src/main/java/info/frostfs/sdk/utils/Validator.java @@ -15,6 +15,9 @@ import static info.frostfs.sdk.constants.ErrorConst.FIELDS_DELIMITER_COMMA; import static java.util.Objects.isNull; public class Validator { + private Validator() { + } + public static void validate(T object) { StringBuilder errorMessage = new StringBuilder(); process(object, errorMessage); diff --git a/client/src/main/java/info/frostfs/sdk/utils/WaitUtil.java b/client/src/main/java/info/frostfs/sdk/utils/WaitUtil.java index 27e785d..2016c43 100644 --- a/client/src/main/java/info/frostfs/sdk/utils/WaitUtil.java +++ b/client/src/main/java/info/frostfs/sdk/utils/WaitUtil.java @@ -1,6 +1,8 @@ package info.frostfs.sdk.utils; public class WaitUtil { + private WaitUtil() { + } public static void sleep(long ms) { try { diff --git a/models/src/main/java/info/frostfs/sdk/constants/FilterConst.java b/models/src/main/java/info/frostfs/sdk/constants/FilterConst.java index 5340057..5b28055 100644 --- a/models/src/main/java/info/frostfs/sdk/constants/FilterConst.java +++ b/models/src/main/java/info/frostfs/sdk/constants/FilterConst.java @@ -46,4 +46,7 @@ public class FilterConst { // FILTER_HEADER_PHY is a filter key to check if an object physically stored on a node. public static final String FILTER_HEADER_PHY = HEADER_PREFIX + "PHY"; + + private FilterConst() { + } }