Enable PMD rule UseDiamondOperator and fix violations

This commit is contained in:
Manuel Fuhr 2023-05-09 22:06:55 +02:00
parent 2e1722150c
commit 7a6d3bd9d9
45 changed files with 105 additions and 105 deletions

View file

@ -95,7 +95,7 @@ public final class NodesCache {
fileRows = new OsmFile[180][];
}
} else {
fileCache = new HashMap<String, PhysicalFile>(4);
fileCache = new HashMap<>(4);
fileRows = new OsmFile[180][];
dataBuffers = new DataBuffers();
secondarySegmentsDir = StorageConfigHelper.getSecondarySegmentDir(segmentDir);

View file

@ -50,7 +50,7 @@ public class OsmNodePairSet {
private void addPair(long n1, long n2) {
if (map == null) {
map = new CompactLongMap<OsmNodePair>();
map = new CompactLongMap<>();
}
npairs++;

View file

@ -13,7 +13,7 @@ import java.util.Map;
import btools.util.ByteArrayUnifier;
public final class OsmNodesMap {
private Map<OsmNode, OsmNode> hmap = new HashMap<OsmNode, OsmNode>(4096);
private Map<OsmNode, OsmNode> hmap = new HashMap<>(4096);
private ByteArrayUnifier abUnifier = new ByteArrayUnifier(16384, false);
@ -176,7 +176,7 @@ public final class OsmNodesMap {
}
public void collectOutreachers() {
nodes2check = new ArrayList<OsmNode>(nodesCreated);
nodes2check = new ArrayList<>(nodesCreated);
nodesCreated = 0;
for (OsmNode n : hmap.values()) {
addActiveNode(nodes2check, n);

View file

@ -51,7 +51,7 @@ public final class WaypointMatcherImpl implements WaypointMatcher {
}
// sort result list
comparator = new Comparator<MatchedWaypoint>() {
comparator = new Comparator<>() {
@Override
public int compare(MatchedWaypoint mw1, MatchedWaypoint mw2) {
int cmpDist = Double.compare(mw1.radius, mw2.radius);