From 59bf0df58e099b04a81eadc6c77156c7ed4e451b Mon Sep 17 00:00:00 2001 From: yannick Date: Tue, 25 Jun 2024 09:25:09 +0200 Subject: [PATCH] make zeroValuesSubmission and reportRawCountValues not final --- .../aws/cloudwatch/CloudWatchReporterService.java | 4 ++-- .../aws/cloudwatch/configuration/entities/Config.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hivemq/extensions/aws/cloudwatch/CloudWatchReporterService.java b/src/main/java/com/hivemq/extensions/aws/cloudwatch/CloudWatchReporterService.java index a546e1f..01ee323 100755 --- a/src/main/java/com/hivemq/extensions/aws/cloudwatch/CloudWatchReporterService.java +++ b/src/main/java/com/hivemq/extensions/aws/cloudwatch/CloudWatchReporterService.java @@ -86,10 +86,10 @@ void startCloudWatchReporter( final CloudWatchReporter.Builder builder = CloudWatchReporter.forRegistry(metricRegistry, cloudWatchAsyncClient, METRIC_NAMESPACE); - if (configuration.getConfig().getZeroValuesSubmission()) { + if (cloudWatchConfig.getZeroValuesSubmission()) { builder.withZeroValuesSubmission(); } - if (configuration.getConfig().getReportRawCountValue()) { + if (cloudWatchConfig.getReportRawCountValue()) { builder.withReportRawCountValue(); } cloudWatchReporter = builder diff --git a/src/main/java/com/hivemq/extensions/aws/cloudwatch/configuration/entities/Config.java b/src/main/java/com/hivemq/extensions/aws/cloudwatch/configuration/entities/Config.java index 49bfbc9..000cca3 100755 --- a/src/main/java/com/hivemq/extensions/aws/cloudwatch/configuration/entities/Config.java +++ b/src/main/java/com/hivemq/extensions/aws/cloudwatch/configuration/entities/Config.java @@ -31,7 +31,7 @@ /** * @author Anja Helmbrecht-Schaar */ -@SuppressWarnings("FieldCanBeLocal") +@SuppressWarnings({"FieldCanBeLocal", "FieldMayBeFinal"}) @XmlRootElement(name = "cloudwatch-extension-configuration") @XmlType(propOrder = {}) @XmlAccessorType(XmlAccessType.NONE) @@ -48,13 +48,13 @@ public class Config { @XmlElementWrapper(name = "metrics") @XmlElement(name = "metric") - private final @NotNull List metrics = new ArrayList<>(); + private @NotNull List metrics = new ArrayList<>(); @XmlElement(name = "zero-values-submission", defaultValue = "false") - private final boolean zeroValuesSubmission = false; + private boolean zeroValuesSubmission = false; @XmlElement(name = "report-raw-count-value", defaultValue = "false") - private final boolean reportRawCountValue = false; + private boolean reportRawCountValue = false; @XmlElement(name = "cloudwatch-endpoint-override") private final @Nullable String cloudWatchEndpointOverride = null;