Changeset 12218 in josm


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

code cleanup - catch ReflectiveOperationException when possible

Location:
trunk/src/org/openstreetmap/josm
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java

    r12189 r12218  
    305305            Constructor<?> c = activeRenderer.getConstructor(new Class<?>[]{Graphics2D.class, NavigatableComponent.class, boolean.class});
    306306            return AbstractMapRenderer.class.cast(c.newInstance(g, viewport, isInactiveMode));
    307         } catch (NoSuchMethodException | IllegalArgumentException | InstantiationException | IllegalAccessException e) {
    308             throw new MapRendererFactoryException(e);
    309307        } catch (InvocationTargetException e) {
    310308            Main.debug(e);
    311309            throw new MapRendererFactoryException(e.getCause());
     310        } catch (ReflectiveOperationException | IllegalArgumentException e) {
     311            throw new MapRendererFactoryException(e);
    312312        }
    313313    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java

    r12031 r12218  
    22package org.openstreetmap.josm.gui.mappaint.mapcss;
    33
    4 import java.lang.reflect.InvocationTargetException;
    54import java.lang.reflect.Method;
    65import java.text.MessageFormat;
     
    824823            try {
    825824                return not ^ (Boolean) method.invoke(null, e);
    826             } catch (IllegalAccessException | InvocationTargetException ex) {
     825            } catch (ReflectiveOperationException ex) {
    827826                throw new JosmRuntimeException(ex);
    828827            }
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmImageView.java

    r10223 r12218  
    6767                setPropertiesFromAttributes();
    6868            }
    69         } catch (IllegalArgumentException | IllegalAccessException |
    70                 InvocationTargetException | NoSuchMethodException | SecurityException e) {
     69        } catch (IllegalArgumentException | ReflectiveOperationException | SecurityException e) {
    7170           Main.error(e);
    7271       }
  • 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        }
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java

    r12217 r12218  
    295295              .append(getReleaseId()).append(" (")
    296296              .append(getCurrentBuild()).append(')');
    297         } catch (IllegalAccessException | InvocationTargetException e) {
     297        } catch (ReflectiveOperationException e) {
    298298            Main.error(e);
    299299        }
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r11374 r12218  
    88import java.io.Reader;
    99import java.lang.reflect.Field;
    10 import java.lang.reflect.InvocationTargetException;
    1110import java.lang.reflect.Method;
    1211import java.lang.reflect.Modifier;
     
    157156                    }
    158157                }
    159             } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
     158            } catch (ReflectiveOperationException | IllegalArgumentException e) {
    160159                Main.error(e); // SAXException does not dump inner exceptions.
    161160                throwException(e);
Note: See TracChangeset for help on using the changeset viewer.