Changeset 13289 in josm


Ignore:
Timestamp:
2018-01-07T02:34:47+01:00 (4 months ago)
Author:
Don-vip
Message:

fix #15709 - revert r13264 to restore proper lazy initialization of ImageViewerDialog (patch by cmuelle8)

Location:
trunk/src/org/openstreetmap/josm/gui/layer/geoimage
Files:
2 edited

Legend:

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

    r13265 r13289  
    10001000        MapFrame map = MainApplication.getMap();
    10011001        if (map.getToggleDialog(ImageViewerDialog.class) == null) {
     1002            ImageViewerDialog.createInstance();
    10021003            map.addToggleDialog(ImageViewerDialog.getInstance());
    10031004        }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r13265 r13289  
    5959    private boolean collapseButtonClicked;
    6060
     61    static void createInstance() {
     62        if (dialog != null)
     63            throw new IllegalStateException("ImageViewerDialog instance was already created");
     64        dialog = new ImageViewerDialog();
     65    }
     66
    6167    /**
    6268     * Replies the unique instance of this dialog
     
    6571    public static ImageViewerDialog getInstance() {
    6672        if (dialog == null)
    67             dialog = new ImageViewerDialog();
     73            throw new AssertionError("a new instance needs to be created first");
    6874        return dialog;
    6975    }
Note: See TracChangeset for help on using the changeset viewer.