ReadFileTest: get rid of StringBuilder

This commit is contained in:
Simon Legner 2021-01-03 20:37:12 +01:00
parent 26d0a8328d
commit de663a3de3
1 changed files with 10 additions and 7 deletions

View File

@ -498,19 +498,22 @@ public class ReadFileTest {
protected void parseWays(List<Way> ways) { protected void parseWays(List<Way> ways) {
for (Way w : ways) { for (Way w : ways) {
writer.println("Way ID " + w.getId()); writer.println("Way ID " + w.getId());
StringBuilder sb = new StringBuilder(); writer.print(" Nodes: ");
sb.append(" Nodes: ");
long lastRef = 0; long lastRef = 0;
for (Long ref : w.getRefsList()) { for (Long ref : w.getRefsList()) {
lastRef += ref; lastRef += ref;
sb.append(lastRef).append(" "); writer.print(lastRef);
writer.print(" ");
} }
sb.append("\n Key=value pairs: "); writer.println();
writer.print(" Key=value pairs: ");
for (int i = 0; i < w.getKeysCount(); i++) { for (int i = 0; i < w.getKeysCount(); i++) {
sb.append(getStringById(w.getKeys(i))).append("=") writer.print(getStringById(w.getKeys(i)));
.append(getStringById(w.getVals(i))).append(" "); writer.print("=");
writer.print(getStringById(w.getVals(i)));
writer.print(" ");
} }
writer.println(sb.toString()); writer.println();
} }
} }