Ignore:
Timestamp:
2017-05-20T17:22:34+02:00 (4 years ago)
Author:
Don-vip
Message:

code cleanup - catch ReflectiveOperationException when possible

Location:
trunk/src/org/openstreetmap/josm/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r11893 r12218  
    99import java.io.InputStream;
    1010import java.lang.reflect.Constructor;
    11 import java.lang.reflect.InvocationTargetException;
    1211import java.net.URL;
    1312import java.text.MessageFormat;
     
    325324            Object plugin = c.newInstance(this);
    326325            return new PluginProxy(plugin, this);
    327         } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
     326        } catch (ReflectiveOperationException e) {
    328327            throw new PluginException(name, e);
    329328        }
  • trunk/src/org/openstreetmap/josm/plugins/PluginProxy.java

    r10627 r12218  
    22package org.openstreetmap.josm.plugins;
    33
    4 import java.lang.reflect.InvocationTargetException;
    54import java.util.List;
    65
     
    4746            Main.trace(e);
    4847            Main.debug("Plugin "+plugin+" does not define mapFrameInitialized");
    49         } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException e) {
     48        } catch (ReflectiveOperationException | IllegalArgumentException e) {
    5049            handlePluginException(e);
    5150        }
     
    6059            Main.debug("Plugin "+plugin+" does not define getPreferenceSetting");
    6160            return null;
    62         } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException e) {
     61        } catch (ReflectiveOperationException | IllegalArgumentException e) {
    6362            handlePluginException(e);
    6463        }
     
    7372            Main.trace(e);
    7473            Main.debug("Plugin "+plugin+" does not define addDownloadSelection");
    75         } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException e) {
     74        } catch (ReflectiveOperationException | IllegalArgumentException e) {
    7675            handlePluginException(e);
    7776        }
Note: See TracChangeset for help on using the changeset viewer.