Changeset 8862 in josm for trunk/src/org


Ignore:
Timestamp:
2015-10-12T00:20:21+02:00 (4 years ago)
Author:
wiktorn
Message:

Revert move of tileSource initialization to constructor.

Fixes regression test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r8861 r8862  
    160160        this.setVisible(true);
    161161        MapView.addZoomChangeListener(this);
    162         this.tileSource = getTileSource(info);
    163         if (this.tileSource == null) {
    164             throw new IllegalArgumentException(tr("Failed to create tile source"));
    165         }
    166162    }
    167163
     
    506502    @Override
    507503    public void hookUpMapView() {
     504        // this needs to be here and not in constructor to allow empty TileSource class construction
     505        // using SessionWriter
     506        this.tileSource = getTileSource(info);
     507        if (this.tileSource == null) {
     508            throw new IllegalArgumentException(tr("Failed to create tile source"));
     509        }
     510
    508511        super.hookUpMapView();
    509512        projectionChanged(null, Main.getProjection()); // check if projection is supported
Note: See TracChangeset for help on using the changeset viewer.