Fix newly detected violations from PMD 7

This commit is contained in:
Manuel Fuhr 2024-04-03 14:41:06 +02:00
parent 2f7ce42480
commit dd896347a2
28 changed files with 65 additions and 57 deletions

View file

@ -168,7 +168,7 @@ public class OsmNogoPolygon extends OsmNodeNamed {
Point p1 = points.get(0);
for (int i = 1; i <= i_last; i++) {
final Point p2 = points.get(i);
if (OsmNogoPolygon.isOnLine(px, py, p1.x, p1.y, p2.x, p2.y)) {
if (isOnLine(px, py, p1.x, p1.y, p2.x, p2.y)) {
return true;
}
p1 = p2;
@ -234,7 +234,7 @@ public class OsmNogoPolygon extends OsmNodeNamed {
final long p1x = p1.x;
final long p1y = p1.y;
if (OsmNogoPolygon.isOnLine(px, py, p0x, p0y, p1x, p1y)) {
if (isOnLine(px, py, p0x, p0y, p1x, p1y)) {
return true;
}

View file

@ -166,7 +166,7 @@ public final class OsmTrack {
}
public List<String> aggregateMessages() {
ArrayList<String> res = new ArrayList<>();
List<String> res = new ArrayList<>();
MessageData current = null;
for (OsmPathElement n : nodes) {
if (n.message != null && n.message.wayKeyValues != null) {
@ -188,7 +188,7 @@ public final class OsmTrack {
}
public List<String> aggregateSpeedProfile() {
ArrayList<String> res = new ArrayList<>();
List<String> res = new ArrayList<>();
int vmax = -1;
int vmaxe = -1;
int vmin = -1;

View file

@ -187,7 +187,7 @@ public class RoutingEngine extends Thread {
OsmTrack[] refTracks = new OsmTrack[nsections]; // used ways for alternatives
OsmTrack[] lastTracks = new OsmTrack[nsections];
OsmTrack track = null;
ArrayList<String> messageList = new ArrayList<>();
List<String> messageList = new ArrayList<>();
for (int i = 0; ; i++) {
track = findTrack(refTracks, lastTracks);
track.message = "track-length = " + track.distance + " filtered ascend = " + track.ascend
@ -690,9 +690,9 @@ public class RoutingEngine extends Thread {
return false;
}
}
ArrayList<OsmPathElement> removeBackList = new ArrayList<>();
ArrayList<OsmPathElement> removeForeList = new ArrayList<>();
ArrayList<Integer> removeVoiceHintList = new ArrayList<>();
List<OsmPathElement> removeBackList = new ArrayList<>();
List<OsmPathElement> removeForeList = new ArrayList<>();
List<Integer> removeVoiceHintList = new ArrayList<>();
OsmPathElement last = null;
OsmPathElement lastJunction = null;
CompactLongMap<OsmTrack.OsmPathElementHolder> lastJunctions = new CompactLongMap<>();
@ -1246,7 +1246,7 @@ public class RoutingEngine extends Thread {
addToOpenset(startPath1);
addToOpenset(startPath2);
}
ArrayList<OsmPath> openBorderList = new ArrayList<>(4096);
List<OsmPath> openBorderList = new ArrayList<>(4096);
boolean memoryPanicMode = false;
boolean needNonPanicProcessing = false;

View file

@ -101,7 +101,7 @@ public class RoutingParamCollector {
* @throws UnsupportedEncodingException
*/
public Map<String, String> getUrlParams(String url) throws UnsupportedEncodingException {
HashMap<String, String> params = new HashMap<>();
Map<String, String> params = new HashMap<>();
String decoded = URLDecoder.decode(url, "UTF-8");
StringTokenizer tk = new StringTokenizer(decoded, "?&");
while (tk.hasMoreTokens()) {