Changeset 2420 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-11-09T09:08:05+01:00 (14 years ago)
Author:
jttt
Message:

Fix warnings in QuadBuckets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java

    r2388 r2420  
    22import java.lang.reflect.Array;
    33import java.util.ArrayList;
     4import java.util.Arrays;
    45import java.util.Collection;
    56import java.util.Collections;
     
    2021    static void abort(String s)
    2122    {
    22         out(s);
    23         Object o = null;
    24         o.hashCode();
     23        throw new AssertionError(s);
    2524    }
    2625    static void out(String s)
     
    8281                    (xmax >  180.0) ||
    8382                    (ymin <  -90.0) ||
    84                     (ymax >   90.0)) {
    85                 out("bad BBox: " + this);
    86                 Object o = null;
    87                 o.hashCode();
    88             }
     83                    (ymax >   90.0))
     84                throw new IllegalArgumentException("bad BBox: " + this);
    8985        }
    9086        @Override
     
    253249            return ret;
    254250        }
    255         @SuppressWarnings("unchecked")
    256251        QBLevel[] newChildren()
    257252        {
     
    272267            }
    273268            if (o instanceof Node) {
    274                 Node n = (Node)o;
    275269                LatLon coor = ((Node)o).getCoor();
    276270                if (coor == null)
     
    365359        void add_to_leaf(T o)
    366360        {
    367             QBLevel ret = this;
    368361            add_content(o);
    369362            if (content.size() > MAX_OBJECTS_PER_LEVEL) {
     
    545538            if (content == null) {
    546539                if (debug) {
    547                     out("["+level+"] leaf size: null content, children? " + children);
     540                    out("["+level+"] leaf size: null content, children? " + Arrays.toString(children));
    548541                }
    549542                return 0;
     
    580573        QBLevel find_exact(T n)
    581574        {
    582             QBLevel ret = null;
    583575            if (content != null && content.contains(n))
    584576                return this;
     
    855847        throw new UnsupportedOperationException();
    856848    }
    857     public boolean retainAll(Collection objects)
     849    public boolean retainAll(Collection<?> objects)
    858850    {
    859851        for (T o : this) {
     
    874866        return false;
    875867    }
    876     public boolean removeAll(Collection objects)
     868    public boolean removeAll(Collection<?> objects)
    877869    {
    878870        for (Object o : objects) {
     
    884876        return true;
    885877    }
    886     public boolean addAll(Collection objects)
     878    public boolean addAll(Collection<? extends T> objects)
    887879    {
    888880        for (Object o : objects) {
     
    894886        return true;
    895887    }
    896     public boolean containsAll(Collection objects)
    897     {
    898         boolean ret = true;
     888    public boolean containsAll(Collection<?> objects)
     889    {
    899890        for (Object o : objects) {
    900891            if (!canStore(o))
     
    987978        return this.toArrayList().toArray();
    988979    }
    989     public <T> T[] toArray(T[] template)
     980    public <A> A[] toArray(A[] template)
    990981    {
    991982        return this.toArrayList().toArray(template);
     
    10821073            //    an element
    10831074            content_index--;
    1084             T object = peek();
     1075            peek(); //TODO Is the call to peek() necessary?
    10851076            current_node.content.remove(content_index);
    10861077        }
     
    11961187            tmp = tmp.parent;
    11971188        }
    1198         if (ret == null || ret.size() == 0)
    1199             return Collections.emptyList();
    12001189        if (debug) {
    12011190            out("search of QuadBuckets for " + search_bbox + " ret len: " + ret.size());
Note: See TracChangeset for help on using the changeset viewer.