fix: Reduce High severity issues reported by SonarCloud #2865 (#3103)

* fix: add UnsupportedOperationException in KingsHand and GameLoopTest

* refactor: update DatabaseService to use constant for BINARY_DATA and remove obsolete test files

* refactor: update timePasses method in KingsHand

* refactor CandyGame.java

* refactor: simplify boundary checks in CandyGame

* feat: add getters for type and points in Candy class and initialize logger in CandyGame

* remove class and logger initialization in CandyGame

* Modify CandyGame.java

* fix Checkstyle violations

* Remove generic wildcard type in ThreatAwareSystem
This commit is contained in:
Salma
2024-12-07 20:31:59 +02:00
committed by GitHub
parent b375919db5
commit 297e429e5a
9 changed files with 29 additions and 21 deletions
@@ -30,7 +30,7 @@ import java.util.List;
/**
* Represents system that is aware of threats that are present in it.
*/
public interface ThreatAwareSystem {
public interface ThreatAwareSystem<T extends Threat> {
/**
* Returns the system id.
@@ -43,13 +43,13 @@ public interface ThreatAwareSystem {
* Returns list of threats for this system.
* @return list of threats for this system.
*/
List<? extends Threat> threats();
List<T> threats();
/**
* Returns the instance of {@link Filterer} helper interface that allows to covariantly
* specify lower bound for predicate that we want to filter by.
* @return an instance of {@link Filterer} helper interface.
*/
Filterer<? extends ThreatAwareSystem, ? extends Threat> filtered();
Filterer<ThreatAwareSystem<T>, T> filtered();
}