From b5a7f2e98283d1677dbe44b91fc75c7f2002f274 Mon Sep 17 00:00:00 2001 From: Jean-Kevin KPADEY Date: Thu, 9 Jul 2026 10:28:34 +0200 Subject: [PATCH 1/2] Revert "fix(entities): remove Objects.requireNonNull from AbstractTrend constructor" This reverts commit 71fd80e0bc2fd006a59fdc90f539485b959f9bed. --- .../main/java/io/github/mivek/model/trend/AbstractTrend.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metarParser-entities/src/main/java/io/github/mivek/model/trend/AbstractTrend.java b/metarParser-entities/src/main/java/io/github/mivek/model/trend/AbstractTrend.java index 01320a6f..8502d4df 100644 --- a/metarParser-entities/src/main/java/io/github/mivek/model/trend/AbstractTrend.java +++ b/metarParser-entities/src/main/java/io/github/mivek/model/trend/AbstractTrend.java @@ -3,6 +3,7 @@ import io.github.mivek.enums.WeatherChangeType; import io.github.mivek.model.AbstractWeatherContainer; import java.util.Locale; +import java.util.Objects; import org.apache.commons.lang3.builder.ToStringBuilder; /** @@ -21,7 +22,7 @@ public abstract class AbstractTrend extends AbstractWeatherContainer { */ protected AbstractTrend(final WeatherChangeType type) { super(); - this.type = type; + this.type = Objects.requireNonNull(type); } /** From 0060256efa3ca2420e21d04db1dabf6e8c615c11 Mon Sep 17 00:00:00 2001 From: Jean-Kevin KPADEY Date: Thu, 9 Jul 2026 10:37:17 +0200 Subject: [PATCH 2/2] build(spotbugs): suppress CT_CONSTRUCTOR_THROW for three abstract classes Suppress CT_CONSTRUCTOR_THROW for AbstractWeatherContainerParser, AbstractWeatherCodeParser, and AbstractTrend. All three are abstract (non-final) classes, but the finalizer-attack vector is not exploitable: no finalize() methods exist in the codebase, all concrete subclasses are final, no security-sensitive state is involved, and Java 21 deprecates finalization. Revert 71fd80e restored Objects.requireNonNull in AbstractTrend as good defensive practice; the suppression allows it without CI failure. --- spotbugs.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spotbugs.xml b/spotbugs.xml index 3f4367a9..4e719382 100644 --- a/spotbugs.xml +++ b/spotbugs.xml @@ -16,4 +16,16 @@ + + + + + + + + + + + +