---
core-dave/src/org/openstreetmap/josm/data/osm/QuadBuckets.java | 19 ++++++----
1 file changed, 12 insertions(+), 7 deletions(-)
diff -puN src/org/openstreetmap/josm/data/osm/QuadBuckets.java~suppress-warnings src/org/openstreetmap/josm/data/osm/QuadBuckets.java
|
a
|
b
|
public class QuadBuckets<T extends OsmPr
|
| 268 | 268 | this.content = null; |
| 269 | 269 | return ret; |
| 270 | 270 | } |
| | 271 | @SuppressWarnings("unchecked") |
| | 272 | QBLevel[] newChildren() |
| | 273 | { |
| | 274 | // This is ugly and hackish. But, it seems to work, |
| | 275 | // and using an ArrayList here seems to cost us |
| | 276 | // a significant performance penalty -- 50% in my |
| | 277 | // testing. Child access is one of the single |
| | 278 | // hottest code paths in this entire class. |
| | 279 | return (QBLevel[])Array.newInstance(this.getClass(), QuadTiling.TILES_PER_LEVEL); |
| | 280 | } |
| 271 | 281 | // Get the correct index for the given primitive |
| 272 | 282 | // at the given level. If the primitive can not |
| 273 | 283 | // fit into a single quad at this level, return -1 |
| … |
… |
public class QuadBuckets<T extends OsmPr
|
| 326 | 336 | if (children != null) { |
| 327 | 337 | abort("overwrote children"); |
| 328 | 338 | } |
| 329 | | // This is ugly and hackish. But, it seems to work, |
| 330 | | // and using an ArrayList here seems to cost us |
| 331 | | // a significant performance penalty -- 50% in my |
| 332 | | // testing. Child access is one of the single |
| 333 | | // hottest code paths in this entire class. |
| 334 | | children = (QBLevel[])Array.newInstance(this.getClass(), QuadTiling.TILES_PER_LEVEL); |
| | 339 | children = newChildren(); |
| 335 | 340 | // deferring allocation of children until use |
| 336 | 341 | // seems a bit faster |
| 337 | 342 | //for (int i = 0; i < TILES_PER_LEVEL; i++) |
| … |
… |
public class QuadBuckets<T extends OsmPr
|
| 878 | 883 | } |
| 879 | 884 | // If anyone has suggestions for how to fix |
| 880 | 885 | // this properly, I'm listening :) |
| | 886 | @SuppressWarnings("unchecked") |
| 881 | 887 | private T convert(Object raw) |
| 882 | 888 | { |
| 883 | | //@SuppressWarnings("unchecked") |
| 884 | 889 | return (T)raw; |
| 885 | 890 | } |
| 886 | 891 | public boolean remove(Object o) |