Changeset 8151 in josm


Ignore:
Timestamp:
2015-03-23T23:13:28+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #11259 - catch InvalidDnDOperationException

File:
1 edited

Legend:

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

    r8126 r8151  
    1515import java.awt.dnd.DropTargetEvent;
    1616import java.awt.dnd.DropTargetListener;
     17import java.awt.dnd.InvalidDnDOperationException;
    1718import java.awt.event.HierarchyEvent;
    1819import java.awt.event.HierarchyListener;
     
    224225                }   // end else: not a file list
    225226            }   // end try
    226             catch ( IOException io)
    227             {   Main.warn("FileDrop: IOException - abort:" );
    228             Main.error(io);
    229             evt.rejectDrop();
    230             }   // end catch IOException
    231             catch (UnsupportedFlavorException ufe)
    232             {   Main.warn("FileDrop: UnsupportedFlavorException - abort:" );
    233             Main.error(ufe);
    234             evt.rejectDrop();
    235             }   // end catch: UnsupportedFlavorException
    236             finally
    237             {
     227            catch (IOException | UnsupportedFlavorException e) {
     228                Main.warn("FileDrop: "+e.getClass().getSimpleName()+" - abort:" );
     229                Main.error(e);
     230                try {
     231                    evt.rejectDrop();
     232                } catch (InvalidDnDOperationException ex) {
     233                    // Catch InvalidDnDOperationException to fix #11259
     234                    Main.error(ex);
     235                }
     236            } finally {
    238237                // If it's a Swing component, reset its border
    239238                if( c instanceof JComponent )
Note: See TracChangeset for help on using the changeset viewer.