return n;
}
}
protected Way parseWay() throws XMLStreamException {
WayData wd = new WayData();
readCommon(wd);
Way w = new Way(wd.getId(), wd.getVersion());
w.setVisible(wd.isVisible());
w.load(wd);
externalIdMap.put(wd.getPrimitiveId(), w);
Collection<Long> nodeIds = new ArrayList<>();
while (true) {
int event = parser.next();
if (event == XMLStreamConstants.START_ELEMENT) {
switch (parser.getLocalName()) {
case "nd":
nodeIds.add(parseWayNode(w));
break;
case "tag":
parseTag(w);
break;
default:
parseUnknown();
}
} else if (event == XMLStreamConstants.END_ELEMENT) {
break;
}
}
if (w.isDeleted() && !nodeIds.isEmpty()) {
Main.info(tr("Deleted way {0} contains nodes", w.getUniqueId()));
nodeIds = new ArrayList<>();
}
ways.put(wd.getUniqueId(), nodeIds);
return w;
}