Changeset 8652 in josm for trunk


Ignore:
Timestamp:
2015-08-09T13:17:35+02:00 (9 years ago)
Author:
Don-vip
Message:

fix #11767 - Use Arrays.copyOf in OsmPrimitive#put(String, String) (patch by michael2402)

Location:
trunk/src/org/openstreetmap/josm/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java

    r8649 r8652  
    9595        tileXMax = new int[getMaxZoom() + 1];
    9696        tileYMax = new int[getMaxZoom() + 1];
    97         for(int zoom = getMinZoom(); zoom <= getMaxZoom(); zoom++) {
     97        for (int zoom = getMinZoom(); zoom <= getMaxZoom(); zoom++) {
    9898            TileXY maxTileIndex = latLonToTileXY(bottomRight.toCoordinate(), zoom);
    9999            tileXMax[zoom] = maxTileIndex.getXIndex();
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r8582 r8652  
    548548                }
    549549            }
    550             String[] newKeys = new String[keys.length + 2];
    551             for (int i = 0; i < keys.length; i += 2) {
    552                 newKeys[i] = keys[i];
    553                 newKeys[i+1] = keys[i+1];
    554             }
     550            String[] newKeys = Arrays.copyOf(keys, keys.length + 2);
    555551            newKeys[keys.length] = key;
    556552            newKeys[keys.length + 1] = value;
Note: See TracChangeset for help on using the changeset viewer.