Changeset 8629 in josm for trunk/src/org


Ignore:
Timestamp:
2015-07-29T19:17:49+02:00 (5 years ago)
Author:
wiktorn
Message:

Fix NPE in CacheEntry and TMS settings

  • fix NPE in CacheEntry (Closes: #11728)
  • properly handle maximum concurrent downloads for TMS in settings
Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/cache/CacheEntry.java

    r8628 r8629  
    2626     */
    2727    public byte[] getContent() {
     28        if (content == null) {
     29            return new byte[]{};
     30        }
    2831        return Arrays.copyOf(content, content.length);
    2932    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/TMSSettingsPanel.java

    r8598 r8629  
    1313
    1414import org.openstreetmap.josm.data.imagery.TMSCachedTileLoader;
    15 import org.openstreetmap.josm.data.imagery.TMSCachedTileLoaderJob;
    1615import org.openstreetmap.josm.gui.layer.TMSLayer;
    1716import org.openstreetmap.josm.tools.GBC;
     
    4443                TMSLayer.PROP_MAX_ZOOM_LVL.get().intValue(), TMSLayer.MIN_ZOOM, TMSLayer.MAX_ZOOM, 1));
    4544        maxConcurrentDownloads = new JSpinner(new SpinnerNumberModel(
    46                 TMSCachedTileLoaderJob.THREAD_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1));
     45                TMSCachedTileLoader.THREAD_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1));
    4746        maxDownloadsPerHost = new JSpinner(new SpinnerNumberModel(
    4847                TMSCachedTileLoader.HOST_LIMIT.get().intValue(), 0, Integer.MAX_VALUE, 1));
     
    8887        this.maxZoomLvl.setValue(TMSLayer.getMaxZoomLvl(null));
    8988        this.minZoomLvl.setValue(TMSLayer.getMinZoomLvl(null));
    90         this.maxConcurrentDownloads.setValue(TMSCachedTileLoaderJob.THREAD_LIMIT.get());
     89        this.maxConcurrentDownloads.setValue(TMSCachedTileLoader.THREAD_LIMIT.get());
    9190        this.maxDownloadsPerHost.setValue(TMSCachedTileLoader.HOST_LIMIT.get());
    9291    }
Note: See TracChangeset for help on using the changeset viewer.