Enable PMD rule LooseCoupling and fix violations
This commit is contained in:
parent
c75a8cb703
commit
30be64cbbe
26 changed files with 64 additions and 50 deletions
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
package btools.mapcreator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import btools.util.CheapRuler;
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ public class DPFilter {
|
|||
/*
|
||||
* for each node (except first+last), eventually set the DP_SURVIVOR_BIT
|
||||
*/
|
||||
public static void doDPFilter(ArrayList<OsmNodeP> nodes) {
|
||||
public static void doDPFilter(List<OsmNodeP> nodes) {
|
||||
int first = 0;
|
||||
int last = nodes.size() - 1;
|
||||
while (first < last && (nodes.get(first + 1).bits & OsmNodeP.DP_SURVIVOR_BIT) != 0) {
|
||||
|
|
@ -30,7 +30,7 @@ public class DPFilter {
|
|||
}
|
||||
|
||||
|
||||
public static void doDPFilter(ArrayList<OsmNodeP> nodes, int first, int last) {
|
||||
public static void doDPFilter(List<OsmNodeP> nodes, int first, int last) {
|
||||
double maxSqDist = -1.;
|
||||
int index = -1;
|
||||
OsmNodeP p1 = nodes.get(first);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import java.io.FileInputStream;
|
|||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import btools.util.DiffCoderDataOutputStream;
|
||||
|
||||
|
|
@ -21,7 +22,7 @@ public abstract class MapCreatorBase implements WayListener, NodeListener, Relat
|
|||
private DiffCoderDataOutputStream[] tileOutStreams;
|
||||
protected File outTileDir;
|
||||
|
||||
protected HashMap<String, String> tags;
|
||||
protected Map<String, String> tags;
|
||||
|
||||
public void putTag(String key, String value) {
|
||||
if (tags == null) tags = new HashMap<String, String>();
|
||||
|
|
@ -32,11 +33,11 @@ public abstract class MapCreatorBase implements WayListener, NodeListener, Relat
|
|||
return tags == null ? null : tags.get(key);
|
||||
}
|
||||
|
||||
public HashMap<String, String> getTagsOrNull() {
|
||||
public Map<String, String> getTagsOrNull() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(HashMap<String, String> tags) {
|
||||
public void setTags(Map<String, String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import java.io.BufferedOutputStream;
|
|||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
import btools.expressions.BExpressionContextNode;
|
||||
|
|
@ -142,7 +142,7 @@ public class OsmCutter extends MapCreatorBase {
|
|||
}
|
||||
|
||||
|
||||
private void generatePseudoTags(HashMap<String, String> map) {
|
||||
private void generatePseudoTags(Map<String, String> map) {
|
||||
// add pseudo.tags for concrete:lanes and concrete:plates
|
||||
|
||||
String concrete = null;
|
||||
|
|
@ -204,7 +204,7 @@ public class OsmCutter extends MapCreatorBase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void nextRelation(RelationData r) throws Exception {
|
||||
public void nextRelation(RelationData r) throws IOException {
|
||||
relsParsed++;
|
||||
checkStats();
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.io.File;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import btools.expressions.BExpressionContextWay;
|
||||
import btools.util.CheapRuler;
|
||||
|
|
@ -188,7 +188,7 @@ public class OsmTrafficMap {
|
|||
return map.get(n);
|
||||
}
|
||||
|
||||
public byte[] addTrafficClass(ArrayList<OsmNodeP> linkNodes, byte[] description) throws IOException {
|
||||
public byte[] addTrafficClass(List<OsmNodeP> linkNodes, byte[] description) throws IOException {
|
||||
double distance = 0.;
|
||||
double sum = 0.;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.io.File;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import btools.util.CompactLongSet;
|
||||
import btools.util.DiffCoderDataOutputStream;
|
||||
|
|
@ -26,7 +27,7 @@ public class PosUnifier extends MapCreatorBase {
|
|||
private File nodeTilesOut;
|
||||
private CompactLongSet[] positionSets;
|
||||
|
||||
private HashMap<String, SrtmRaster> srtmmap;
|
||||
private Map<String, SrtmRaster> srtmmap;
|
||||
private int lastSrtmLonIdx;
|
||||
private int lastSrtmLatIdx;
|
||||
private SrtmRaster lastSrtmRaster;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import java.io.DataOutputStream;
|
|||
import java.io.EOFException;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import btools.expressions.BExpressionContextWay;
|
||||
import btools.expressions.BExpressionMetaData;
|
||||
|
|
@ -19,7 +20,7 @@ import btools.util.FrozenLongSet;
|
|||
* @author ab
|
||||
*/
|
||||
public class RelationMerger extends MapCreatorBase {
|
||||
private HashMap<String, CompactLongSet> routesets;
|
||||
private Map<String, CompactLongSet> routesets;
|
||||
private CompactLongSet routesetall;
|
||||
private BExpressionContextWay expctxReport;
|
||||
private BExpressionContextWay expctxCheck;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import java.io.DataOutputStream;
|
|||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import btools.util.CheapAngleMeter;
|
||||
|
|
@ -35,8 +37,8 @@ public class RestrictionData extends MapCreatorBase {
|
|||
|
||||
public boolean badWayMatch;
|
||||
|
||||
private static HashMap<String, String> names = new HashMap<>();
|
||||
private static TreeSet<Long> badTRs = new TreeSet<>();
|
||||
private static Map<String, String> names = new HashMap<>();
|
||||
private static Set<Long> badTRs = new TreeSet<>();
|
||||
|
||||
public RestrictionData() {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue