Enable PMD rule UseDiamondOperator and fix violations
This commit is contained in:
parent
2e1722150c
commit
7a6d3bd9d9
45 changed files with 105 additions and 105 deletions
|
|
@ -488,11 +488,11 @@ public class BInstallerActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
private void downloadDiffVersionTiles() {
|
||||
downloadAll(new ArrayList<Integer>(), DownloadWorker.VALUE_SEGMENT_DIFFS);
|
||||
downloadAll(new ArrayList<>(), DownloadWorker.VALUE_SEGMENT_DIFFS);
|
||||
}
|
||||
|
||||
private void dropDiffVersionTiles() {
|
||||
downloadAll(new ArrayList<Integer>(), DownloadWorker.VALUE_SEGMENT_DROPDIFFS);
|
||||
downloadAll(new ArrayList<>(), DownloadWorker.VALUE_SEGMENT_DROPDIFFS);
|
||||
}
|
||||
|
||||
private boolean isDownloadRunning(Class<?> serviceClass) {
|
||||
|
|
|
|||
|
|
@ -199,8 +199,8 @@ public class BRouterService extends Service {
|
|||
private void readNogos(BRouterWorker worker, String baseDir) throws Exception {
|
||||
// add nogos from waypoint database
|
||||
CoordinateReader cor = CoordinateReader.obtainValidReader(baseDir, true);
|
||||
worker.nogoList = new ArrayList<OsmNodeNamed>(cor.nogopoints);
|
||||
worker.nogoPolygonsList = new ArrayList<OsmNodeNamed>();
|
||||
worker.nogoList = new ArrayList<>(cor.nogopoints);
|
||||
worker.nogoPolygonsList = new ArrayList<>();
|
||||
}
|
||||
|
||||
private boolean fileEqual(byte[] fileBytes, File file) throws Exception {
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public class BRouterWorker {
|
|||
}
|
||||
|
||||
if (params.containsKey("extraParams")) { // add user params
|
||||
if (rc.keyValues == null) rc.keyValues = new HashMap<String, String>();
|
||||
if (rc.keyValues == null) rc.keyValues = new HashMap<>();
|
||||
StringTokenizer tk = new StringTokenizer(extraParams, "?&");
|
||||
while (tk.hasMoreTokens()) {
|
||||
String t = tk.nextToken();
|
||||
|
|
@ -212,7 +212,7 @@ public class BRouterWorker {
|
|||
}
|
||||
|
||||
private List<OsmNodeNamed> readPositions(Bundle params) {
|
||||
List<OsmNodeNamed> wplist = new ArrayList<OsmNodeNamed>();
|
||||
List<OsmNodeNamed> wplist = new ArrayList<>();
|
||||
|
||||
double[] lats = params.getDoubleArray("lats");
|
||||
double[] lons = params.getDoubleArray("lons");
|
||||
|
|
@ -235,7 +235,7 @@ public class BRouterWorker {
|
|||
}
|
||||
|
||||
private List<OsmNodeNamed> readLonlats(Bundle params) {
|
||||
List<OsmNodeNamed> wplist = new ArrayList<OsmNodeNamed>();
|
||||
List<OsmNodeNamed> wplist = new ArrayList<>();
|
||||
|
||||
String lonLats = params.getString("lonlats");
|
||||
if (lonLats == null) throw new IllegalArgumentException("lonlats parameter not set");
|
||||
|
|
@ -315,7 +315,7 @@ public class BRouterWorker {
|
|||
|
||||
String[] lonLatRadList = nogos.split("\\|");
|
||||
|
||||
List<OsmNodeNamed> nogoList = new ArrayList<OsmNodeNamed>();
|
||||
List<OsmNodeNamed> nogoList = new ArrayList<>();
|
||||
for (int i = 0; i < lonLatRadList.length; i++) {
|
||||
String[] lonLatRad = lonLatRadList[i].split(",");
|
||||
String nogoWeight = "NaN";
|
||||
|
|
@ -344,7 +344,7 @@ public class BRouterWorker {
|
|||
}
|
||||
|
||||
private List<OsmNodeNamed> readNogoPolygons(Bundle params) {
|
||||
List<OsmNodeNamed> result = new ArrayList<OsmNodeNamed>();
|
||||
List<OsmNodeNamed> result = new ArrayList<>();
|
||||
parseNogoPolygons(params.getString("polylines"), result, false);
|
||||
parseNogoPolygons(params.getString("polygons"), result, true);
|
||||
return result.size() > 0 ? result : null;
|
||||
|
|
@ -389,7 +389,7 @@ public class BRouterWorker {
|
|||
|
||||
String[] lonLatNameList = pois.split("\\|");
|
||||
|
||||
List<OsmNodeNamed> poisList = new ArrayList<OsmNodeNamed>();
|
||||
List<OsmNodeNamed> poisList = new ArrayList<>();
|
||||
for (int i = 0; i < lonLatNameList.length; i++) {
|
||||
String[] lonLatName = lonLatNameList[i].split(",");
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class ConfigMigration {
|
|||
}
|
||||
br.close();
|
||||
|
||||
List<String> lines = new ArrayList<String>();
|
||||
List<String> lines = new ArrayList<>();
|
||||
br = new BufferedReader(new FileReader(dstFile));
|
||||
for (; ; ) {
|
||||
String line = br.readLine();
|
||||
|
|
@ -76,7 +76,7 @@ public class ConfigMigration {
|
|||
BufferedReader br = null;
|
||||
BufferedWriter bw = null;
|
||||
File configFile = new File(segmentDir, "storageconfig.txt");
|
||||
List<String> lines = new ArrayList<String>();
|
||||
List<String> lines = new ArrayList<>();
|
||||
try {
|
||||
br = new BufferedReader(new FileReader(configFile));
|
||||
for (; ; ) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public class ServiceModeConfig {
|
|||
profile = tk.nextToken();
|
||||
if (tk.hasMoreTokens()) params = tk.nextToken();
|
||||
else params = "noparams";
|
||||
nogoVetos = new TreeSet<String>();
|
||||
nogoVetos = new TreeSet<>();
|
||||
while (tk.hasMoreTokens()) {
|
||||
nogoVetos.add(tk.nextToken());
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ public class ServiceModeConfig {
|
|||
this.mode = mode;
|
||||
this.profile = profile;
|
||||
this.params = params;
|
||||
nogoVetos = new TreeSet<String>();
|
||||
nogoVetos = new TreeSet<>();
|
||||
}
|
||||
|
||||
public String toLine() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue