Fix sonar findings on 21 style (#3020)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2026-04-15 16:57:10 +03:00
committed by GitHub
parent 643e96b7b1
commit 82ee1cc4e6
12 changed files with 284 additions and 273 deletions

View File

@@ -678,7 +678,7 @@ public class JpaControllerManagement extends JpaActionManagement implements Cont
log.debug("{} events in flushUpdateQueue.", size);
final Set<TargetPoll> events = new HashSet<>(queue.size());
final Set<TargetPoll> events = HashSet.newHashSet(queue.size());
final int drained = queue.drainTo(events);
if (drained <= 0) {

View File

@@ -68,12 +68,12 @@ public class StatisticsUtils {
final Meter.Id id = m.getId();
if (id.getName().startsWith(Statistics.METER_PREFIX)) {
final double value;
if (m instanceof Counter counter) {
value = counter.count();
} else if (m instanceof FunctionCounter functionCounter) {
value = functionCounter.count();
} else {
return;
switch (m) {
case Counter counter -> value = counter.count();
case FunctionCounter functionCounter -> value = functionCounter.count();
default -> {
return;
}
}
final StringBuilder key = new StringBuilder(id.getName());