Changeset 2353 in josm for trunk


Ignore:
Timestamp:
2009-10-30T22:27:57+01:00 (15 years ago)
Author:
Gubaer
Message:

applied #3818: patch by hansendc: suppress QuadBuckets warnings

File:
1 edited

Legend:

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

    r2299 r2353  
    245245                this.content = null;
    246246            return ret;
     247        }
     248        @SuppressWarnings("unchecked")
     249        QBLevel[] newChildren()
     250        {
     251            // This is ugly and hackish.  But, it seems to work,
     252            // and using an ArrayList here seems to cost us
     253            // a significant performance penalty -- 50% in my
     254            // testing.  Child access is one of the single
     255            // hottest code paths in this entire class.
     256            return (QBLevel[])Array.newInstance(this.getClass(), QuadTiling.TILES_PER_LEVEL);
    247257        }
    248258        // Get the correct index for the given primitive
     
    304314                abort("overwrote children");
    305315            }
    306             // This is ugly and hackish.  But, it seems to work,
    307             // and using an ArrayList here seems to cost us
    308             // a significant performance penalty -- 50% in my
    309             // testing.  Child access is one of the single
    310             // hottest code paths in this entire class.
    311             children = (QBLevel[])Array.newInstance(this.getClass(), QuadTiling.TILES_PER_LEVEL);
     316            children = newChildren();
    312317            // deferring allocation of children until use
    313318            // seems a bit faster
     
    878883    // If anyone has suggestions for how to fix
    879884    // this properly, I'm listening :)
     885    @SuppressWarnings("unchecked")
    880886    private T convert(Object raw)
    881887    {
    882         //@SuppressWarnings("unchecked")
    883888        return (T)raw;
    884889    }
Note: See TracChangeset for help on using the changeset viewer.