Ticket #3587: josm-null-pointer-quad-0.patch
| File josm-null-pointer-quad-0.patch, 2.3 KB (added by , 16 years ago) |
|---|
-
src/org/openstreetmap/josm/data/osm/QuadBuckets.java
667 667 public void unsupported() 668 668 { 669 669 out("unsupported operation"); 670 Object o = null;671 o.hashCode();672 670 throw new UnsupportedOperationException(); 673 671 } 674 672 public boolean retainAll(Collection nodes) 675 673 { 676 unsupported(); 677 return false; 674 for (Node n : this) { 675 if (nodes.contains(n)) 676 continue; 677 if (!this.remove(n)) 678 return false; 679 } 680 return true; 678 681 } 679 682 public boolean removeAll(Collection nodes) 680 683 { 681 unsupported(); 682 return false; 684 for (Object o : nodes) { 685 if (!(o instanceof Node)) 686 return false; 687 Node n = (Node)o; 688 if (!this.remove(n)) 689 return false; 690 } 691 return true; 683 692 } 684 693 public boolean addAll(Collection nodes) 685 694 { 686 unsupported(); 687 return false; 695 for (Object o : nodes) { 696 if (!(o instanceof Node)) 697 return false; 698 Node n = (Node)o; 699 if (!this.add(n)) 700 return false; 701 } 702 return true; 688 703 } 689 704 public boolean containsAll(Collection nodes) 690 705 { 691 unsupported(); 692 return false; 706 boolean ret = true; 707 for (Object o : nodes) { 708 if (!(o instanceof Node)) 709 return false; 710 Node n = (Node)o; 711 if (!this.contains(n)) 712 return false; 713 } 714 return true; 693 715 } 694 716 private void check_type(Object o) 695 717 { … … 711 733 } 712 734 public boolean contains(Object o) 713 735 { 714 check_type(o); 736 if (!(o instanceof Node)) 737 return false; 715 738 QBLevel bucket = root.find_exact((Node)o); 716 739 if (bucket == null) 717 740 return false; … … 808 831 public void remove() 809 832 { 810 833 Node object = peek(); 834 if (object == null) 835 return; 811 836 current_leaf.content.remove(object); 812 837 } 813 838 }
