Changeset 10490 in josm for trunk/src/org


Ignore:
Timestamp:
2016-06-25T11:58:24+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #13003 - IllegalArgumentException: Attempted to remove listener that was not in list (patch by michael2402) - gsoc-core

Location:
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java

    r10453 r10490  
    5454import org.openstreetmap.josm.tools.ImageProvider;
    5555import org.openstreetmap.josm.tools.Utils;
    56 import org.openstreetmap.josm.tools.bugreport.BugReport;
    5756import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
    5857
     
    10099                new ComponentAdapter() {
    101100                    @Override
     101                    public void componentShown(ComponentEvent e) {
     102                        Main.getLayerManager().addAndFireActiveLayerChangeListener(actSelectInCurrentLayerAction);
     103                        Main.getLayerManager().addAndFireActiveLayerChangeListener(actZoomInCurrentLayerAction);
     104                    }
     105
     106                    @Override
    102107                    public void componentHidden(ComponentEvent e) {
    103                         // make sure the listener is unregistered when the panel becomes
    104                         // invisible
    105                         try {
    106                             Main.getLayerManager().removeActiveLayerChangeListener(actSelectInCurrentLayerAction);
    107                             Main.getLayerManager().removeActiveLayerChangeListener(actZoomInCurrentLayerAction);
    108                         } catch (IllegalArgumentException t) {
    109                             throw BugReport.intercept(t).put("hint", "This Component can only be hidden once.");
    110                         }
     108                        // make sure the listener is unregistered when the panel becomes invisible
     109                        Main.getLayerManager().removeActiveLayerChangeListener(actSelectInCurrentLayerAction);
     110                        Main.getLayerManager().removeActiveLayerChangeListener(actZoomInCurrentLayerAction);
    111111                    }
    112112                }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java

    r10453 r10490  
    9696                new ComponentAdapter() {
    9797                    @Override
     98                    public void componentShown(ComponentEvent e) {
     99                        Main.getLayerManager().addAndFireActiveLayerChangeListener(actSelectInCurrentLayer);
     100                        Main.getLayerManager().addAndFireActiveLayerChangeListener(actZoomInCurrentLayerAction);
     101                    }
     102
     103                    @Override
    98104                    public void componentHidden(ComponentEvent e) {
    99                         // make sure the listener is unregistered when the panel becomes
    100                         // invisible
     105                        // make sure the listener is unregistered when the panel becomes invisible
    101106                        Main.getLayerManager().removeActiveLayerChangeListener(actSelectInCurrentLayer);
    102107                        Main.getLayerManager().removeActiveLayerChangeListener(actZoomInCurrentLayerAction);
Note: See TracChangeset for help on using the changeset viewer.