Fix newly detected violations from PMD 7
This commit is contained in:
parent
2f7ce42480
commit
dd896347a2
28 changed files with 65 additions and 57 deletions
|
|
@ -184,10 +184,10 @@ public class CreateElevationRasterImage {
|
|||
if (DEBUG) System.out.println(line);
|
||||
String[] sa = line.split(",");
|
||||
if (!line.startsWith("#") && sa.length == 4) {
|
||||
short e = Short.valueOf(sa[0].trim());
|
||||
short r = Short.valueOf(sa[1].trim());
|
||||
short g = Short.valueOf(sa[2].trim());
|
||||
short b = Short.valueOf(sa[3].trim());
|
||||
short e = Short.parseShort(sa[0].trim());
|
||||
short r = Short.parseShort(sa[1].trim());
|
||||
short g = Short.parseShort(sa[2].trim());
|
||||
short b = Short.parseShort(sa[3].trim());
|
||||
colorMap.put(e, new Color(r, g, b));
|
||||
}
|
||||
// read next line
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ public class ElevationRasterTileConverter {
|
|||
} else {
|
||||
System.out.println("usage: java <srtm-filename> <hgt-data-dir> <srtm-output-dir> [arc seconds (1 or 3,default=3)] [hgt-fallback-data-dir]");
|
||||
System.out.println("or java all <hgt-data-dir> <srtm-output-dir> [arc seconds (1 or 3, default=3)] [hgt-fallback-data-dir]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ package btools.mapcreator;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import btools.codec.MicroCache;
|
||||
import btools.codec.MicroCache2;
|
||||
|
|
@ -105,7 +107,7 @@ public class OsmNodeP extends OsmLinkP {
|
|||
}
|
||||
|
||||
public void checkDuplicateTargets() {
|
||||
HashMap<OsmNodeP, OsmLinkP> targets = new HashMap<>();
|
||||
Map<OsmNodeP, OsmLinkP> targets = new HashMap<>();
|
||||
|
||||
for (OsmLinkP link0 = getFirstLink(); link0 != null; link0 = link0.getNext(this)) {
|
||||
OsmLinkP link = link0;
|
||||
|
|
@ -165,14 +167,14 @@ public class OsmNodeP extends OsmLinkP {
|
|||
mc.writeVarBytes(getNodeDecsription());
|
||||
|
||||
// buffer internal reverse links
|
||||
ArrayList<OsmNodeP> internalReverse = new ArrayList<>();
|
||||
List<OsmNodeP> internalReverse = new ArrayList<>();
|
||||
|
||||
for (OsmLinkP link0 = getFirstLink(); link0 != null; link0 = link0.getNext(this)) {
|
||||
OsmLinkP link = link0;
|
||||
OsmNodeP origin = this;
|
||||
OsmNodeP target = null;
|
||||
|
||||
ArrayList<OsmNodeP> linkNodes = new ArrayList<>();
|
||||
List<OsmNodeP> linkNodes = new ArrayList<>();
|
||||
linkNodes.add(this);
|
||||
|
||||
// first pass just to see if that link is consistent
|
||||
|
|
@ -226,7 +228,7 @@ public class OsmNodeP extends OsmLinkP {
|
|||
origin = this;
|
||||
for (int i = 1; i < linkNodes.size() - 1; i++) {
|
||||
OsmNodeP tranferNode = linkNodes.get(i);
|
||||
if ((tranferNode.bits & OsmNodeP.DP_SURVIVOR_BIT) != 0) {
|
||||
if ((tranferNode.bits & DP_SURVIVOR_BIT) != 0) {
|
||||
mc.writeVarLengthSigned(tranferNode.ilon - origin.ilon);
|
||||
mc.writeVarLengthSigned(tranferNode.ilat - origin.ilat);
|
||||
mc.writeVarLengthSigned(tranferNode.getSElev() - origin.getSElev());
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import java.io.DataInputStream;
|
|||
import java.io.EOFException;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* WayCutter does 2 step in map-processing:
|
||||
|
|
@ -25,7 +26,7 @@ public class RelationStatistics extends MapCreatorBase {
|
|||
}
|
||||
|
||||
public void process(File relationFileIn) throws Exception {
|
||||
HashMap<String, long[]> relstats = new HashMap<>();
|
||||
Map<String, long[]> relstats = new HashMap<>();
|
||||
|
||||
DataInputStream dis = createInStream(relationFileIn);
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.io.File;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.RandomAccessFile;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import btools.codec.DataBuffers;
|
||||
|
|
@ -481,7 +482,7 @@ public class WayLinker extends MapCreatorBase implements Runnable {
|
|||
MicroCache mc = new MicroCache2(size, abBuf2, lonIdxDiv, latIdxDiv, divisor);
|
||||
|
||||
// sort via treemap
|
||||
TreeMap<Integer, OsmNodeP> sortedList = new TreeMap<>();
|
||||
Map<Integer, OsmNodeP> sortedList = new TreeMap<>();
|
||||
for (OsmNodeP n : subList) {
|
||||
long longId = n.getIdFromPos();
|
||||
int shrinkid = mc.shrinkId(longId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue