Fix sonar findings on 21 style (#3020)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user