Ignore:
Timestamp:
2014-04-26T15:28:16+02:00 (10 years ago)
Author:
Don-vip
Message:

see #8465 - use multi-catch where applicable

Location:
trunk/src/org/openstreetmap/josm/data
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r6990 r7004  
    11671167        try {
    11681168            structPrototype = klass.newInstance();
    1169         } catch (InstantiationException ex) {
    1170             throw new RuntimeException(ex);
    1171         } catch (IllegalAccessException ex) {
     1169        } catch (InstantiationException | IllegalAccessException ex) {
    11721170            throw new RuntimeException(ex);
    11731171        }
     
    11871185                    }
    11881186                }
    1189             } catch (IllegalArgumentException ex) {
    1190                 throw new RuntimeException(ex);
    1191             } catch (IllegalAccessException ex) {
     1187            } catch (IllegalArgumentException | IllegalAccessException ex) {
    11921188                throw new RuntimeException(ex);
    11931189            }
     
    12001196        try {
    12011197            struct = klass.newInstance();
    1202         } catch (InstantiationException ex) {
    1203             throw new RuntimeException(ex);
    1204         } catch (IllegalAccessException ex) {
     1198        } catch (InstantiationException | IllegalAccessException ex) {
    12051199            throw new RuntimeException(ex);
    12061200        }
  • trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java

    r6995 r7004  
    175175        try {
    176176            fromXML(in);
    177         } catch (RuntimeException e) {
    178             Main.error(e);
    179         } catch (XMLStreamException e) {
     177        } catch (RuntimeException | XMLStreamException e) {
    180178            Main.error(e);
    181179        }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java

    r6883 r7004  
    268268            Constructor<?> c = activeRenderer.getConstructor(new Class<?>[]{Graphics2D.class, NavigatableComponent.class, boolean.class});
    269269            return AbstractMapRenderer.class.cast(c.newInstance(g, viewport, isInactiveMode));
    270         } catch(NoSuchMethodException e){
    271             throw new MapRendererFactoryException(e);
    272         } catch (IllegalArgumentException e) {
    273             throw new MapRendererFactoryException(e);
    274         } catch (InstantiationException e) {
    275             throw new MapRendererFactoryException(e);
    276         } catch (IllegalAccessException e) {
     270        } catch(NoSuchMethodException | IllegalArgumentException | InstantiationException | IllegalAccessException e){
    277271            throw new MapRendererFactoryException(e);
    278272        } catch (InvocationTargetException e) {
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ClassProjFactory.java

    r5227 r7004  
    1818        try {
    1919            proj = projClass.newInstance();
    20         } catch (InstantiationException e) {
    21             throw new RuntimeException(e);
    22         } catch (IllegalAccessException e) {
     20        } catch (InstantiationException | IllegalAccessException e) {
    2321            throw new RuntimeException(e);
    2422        }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java

    r6986 r7004  
    209209                errors.add(new OpeningHoursTestError(tr("opening_hours value can be prettified"), Severity.OTHER, prettifiedValue));
    210210            }
    211         } catch (ScriptException ex) {
    212             Main.error(ex);
    213         } catch (NoSuchMethodException ex) {
     211        } catch (ScriptException | NoSuchMethodException ex) {
    214212            Main.error(ex);
    215213        }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r6823 r7004  
    714714                } catch (IllegalStateException e) {
    715715                    return tr("Illegal expression ''{0}''", exp);
    716                 }
    717                 catch (PatternSyntaxException e) {
     716                } catch (PatternSyntaxException e) {
    718717                    return tr("Illegal regular expression ''{0}''", exp);
    719718                }
Note: See TracChangeset for help on using the changeset viewer.