Merge branch 'master' into engine-mode
This commit is contained in:
commit
fcab1a31fd
61 changed files with 389 additions and 507 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) {
|
||||
|
|
|
|||
|
|
@ -211,8 +211,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 {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public class BRouterWorker {
|
|||
String straight = params.getString("straight");
|
||||
String[] sa = straight.split(",");
|
||||
for (int i = 0; i < sa.length; i++) {
|
||||
int v = Integer.valueOf(sa[i]);
|
||||
int v = Integer.parseInt(sa[i]);
|
||||
if (waypoints.size() > v) waypoints.get(v).direct = true;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
|
|
@ -132,7 +132,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();
|
||||
|
|
@ -224,7 +224,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");
|
||||
|
|
@ -334,7 +334,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";
|
||||
|
|
@ -363,7 +363,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;
|
||||
|
|
@ -408,7 +408,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