Changeset 14905 in josm for trunk/src/org
- Timestamp:
- 2019-03-19T06:19:07+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r14434 r14905 234 234 @Override 235 235 public long getId() { 236 long id = this.id;237 236 return id >= 0 ? id : 0; 238 237 } … … 470 469 @Override 471 470 public void visitKeys(KeyValueVisitor visitor) { 472 final String[] keys = this.keys;473 471 if (keys != null) { 474 472 for (int i = 0; i < keys.length; i += 2) { … … 640 638 @Override 641 639 public final String get(String key) { 642 String[] keys = this.keys;643 640 if (key == null) 644 641 return null; … … 657 654 */ 658 655 public final String getIgnoreCase(String key) { 659 String[] keys = this.keys;660 656 if (key == null) 661 657 return null; … … 670 666 @Override 671 667 public final int getNumKeys() { 672 String[] keys = this.keys;673 668 return keys == null ? 0 : keys.length / 2; 674 669 } … … 676 671 @Override 677 672 public final Collection<String> keySet() { 678 final String[] keys = this.keys;679 673 if (keys == null) { 680 674 return Collections.emptySet(); … … 845 839 public Map<String, String> getInterestingTags() { 846 840 Map<String, String> result = new HashMap<>(); 847 String[] keys = this.keys;848 841 if (keys != null) { 849 842 for (int i = 0; i < keys.length; i += 2) { -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r14654 r14905 817 817 } 818 818 checkDataset(); 819 final Object referrers = this.referrers;820 819 if (referrers == null) { 821 820 return Stream.empty(); … … 895 894 // Count only referrers that are members of the same dataset (primitive can have some fake references, for example 896 895 // when way is cloned 897 Object referrers = this.referrers;898 896 if (referrers == null) return false; 899 897 checkDataset(); -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r13957 r14905 464 464 DataSet dataSet = getDataSet(); 465 465 if (dataSet != null) { 466 RelationMember[] members = this.members;467 466 for (RelationMember rm: members) { 468 467 if (rm.getMember().getDataSet() != dataSet) … … 494 493 @Override 495 494 public boolean hasIncompleteMembers() { 496 RelationMember[] members = this.members;497 495 for (RelationMember rm: members) { 498 496 if (rm.getMember().isIncomplete()) return true; … … 509 507 public Collection<OsmPrimitive> getIncompleteMembers() { 510 508 Set<OsmPrimitive> ret = new HashSet<>(); 511 RelationMember[] members = this.members;512 509 for (RelationMember rm: members) { 513 510 if (!rm.getMember().isIncomplete()) { -
trunk/src/org/openstreetmap/josm/data/osm/TagMap.java
r11747 r14905 176 176 @Override 177 177 public String get(Object key) { 178 String[] tags = this.tags;179 178 int index = indexOfKey(tags, key); 180 179 return index < 0 ? null : tags[index + 1]; … … 183 182 @Override 184 183 public boolean containsValue(Object value) { 185 String[] tags = this.tags;186 184 for (int i = 1; i < tags.length; i += 2) { 187 185 if (value.equals(tags[i])) { -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r14302 r14905 120 120 if (node == null) return false; 121 121 122 Node[] nodes = this.nodes;123 122 for (Node n : nodes) { 124 123 if (n.equals(node)) … … 140 139 if (node == null) return neigh; 141 140 142 Node[] nodes = this.nodes;143 141 for (int i = 0; i < nodes.length; i++) { 144 142 if (nodes[i].equals(node)) { … … 164 162 if (isIncomplete()) return chunkSet; 165 163 Node lastN = null; 166 Node[] nodes = this.nodes;167 164 for (Node n : nodes) { 168 165 if (lastN == null) { … … 466 463 if (isIncomplete()) return false; 467 464 468 Node[] nodes = this.nodes;469 465 return nodes.length >= 3 && nodes[nodes.length-1] == nodes[0]; 470 466 } … … 492 488 @Override 493 489 public Node lastNode() { 494 Node[] nodes = this.nodes;495 490 if (isIncomplete() || nodes.length == 0) return null; 496 491 return nodes[nodes.length-1]; … … 499 494 @Override 500 495 public Node firstNode() { 501 Node[] nodes = this.nodes;502 496 if (isIncomplete() || nodes.length == 0) return null; 503 497 return nodes[0]; … … 506 500 @Override 507 501 public boolean isFirstLastNode(INode n) { 508 Node[] nodes = this.nodes;509 502 if (isIncomplete() || nodes.length == 0) return false; 510 503 return n == nodes[0] || n == nodes[nodes.length -1]; … … 513 506 @Override 514 507 public boolean isInnerNode(INode n) { 515 Node[] nodes = this.nodes;516 508 if (isIncomplete() || nodes.length <= 2) return false; 517 509 /* circular ways have only inner nodes, so return true for them! */ … … 536 528 DataSet dataSet = getDataSet(); 537 529 if (dataSet != null) { 538 Node[] nodes = this.nodes;539 530 for (Node n: nodes) { 540 531 if (n.getDataSet() != dataSet) … … 598 589 */ 599 590 public boolean hasIncompleteNodes() { 600 Node[] nodes = this.nodes;601 591 for (Node node : nodes) { 602 592 if (node.isIncomplete()) … … 612 602 */ 613 603 public boolean hasOnlyLocatableNodes() { 614 Node[] nodes = this.nodes;615 604 for (Node node : nodes) { 616 605 if (!node.isLatLonKnown())
Note:
See TracChangeset
for help on using the changeset viewer.