Changeset 11374 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2016-12-09T23:31:13+01:00 (7 years ago)
Author:
Don-vip
Message:

sonar - squid:S00112 - Generic exceptions should never be thrown: define JosmRuntimeException

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
32 edited

Legend:

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

    r11352 r11374  
    100100import org.openstreetmap.josm.tools.I18n;
    101101import org.openstreetmap.josm.tools.ImageProvider;
     102import org.openstreetmap.josm.tools.JosmRuntimeException;
    102103import org.openstreetmap.josm.tools.Logging;
    103104import org.openstreetmap.josm.tools.OpenBrowser;
     
    560561            service.shutdown();
    561562        } catch (InterruptedException | ExecutionException ex) {
    562             throw new RuntimeException(ex);
     563            throw new JosmRuntimeException(ex);
    563564        }
    564565
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r11315 r11374  
    4545import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    4646import org.openstreetmap.josm.tools.Geometry;
     47import org.openstreetmap.josm.tools.JosmRuntimeException;
    4748import org.openstreetmap.josm.tools.Pair;
    4849import org.openstreetmap.josm.tools.Shortcut;
     
    11251126                WayInPolygon nextWay = traverser.walk();
    11261127                if (nextWay == null)
    1127                     throw new RuntimeException("Join areas internal error.");
     1128                    throw new JosmRuntimeException("Join areas internal error.");
    11281129                if (path.get(0) == nextWay) {
    11291130                    // path is closed -> stop here
     
    11801181                while ((nextWay = traverser.walk()) != startWay) {
    11811182                    if (nextWay == null)
    1182                         throw new RuntimeException("Join areas internal error.");
     1183                        throw new JosmRuntimeException("Join areas internal error.");
    11831184                    simpleRingWays.add(nextWay);
    11841185                }
     
    12541255        //should not happen
    12551256        if (joinedWay == null || !joinedWay.isClosed())
    1256             throw new RuntimeException("Join areas internal error.");
     1257            throw new JosmRuntimeException("Join areas internal error.");
    12571258
    12581259        return joinedWay;
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r11116 r11374  
    3131import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
    3232import org.openstreetmap.josm.gui.Notification;
     33import org.openstreetmap.josm.tools.JosmRuntimeException;
    3334import org.openstreetmap.josm.tools.Shortcut;
    3435
     
    294295                    w.calcDirections(Direction.RIGHT.changeBy(directionOffset));
    295296                    if (angleToDirectionChange(refHeading - w.heading, TOLERANCE2) != 0)
    296                         throw new RuntimeException();
     297                        throw new JosmRuntimeException("orthogonalize error");
    297298                    totSum = EN.sum(totSum, w.segSum);
    298299                }
     
    403404                }
    404405            }
    405             if (!s.isEmpty()) throw new RuntimeException();
     406            if (!s.isEmpty()) throw new JosmRuntimeException("orthogonalize error");
    406407        }
    407408
  • trunk/src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java

    r8846 r11374  
    1212
    1313import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError;
     14import org.openstreetmap.josm.tools.JosmRuntimeException;
    1415
    1516public class PushbackTokenizer {
     
    7475            c = search.read();
    7576        } catch (IOException e) {
    76             throw new RuntimeException(e.getMessage(), e);
     77            throw new JosmRuntimeException(e.getMessage(), e);
    7778        }
    7879    }
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r10711 r11374  
    5555import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
    5656import org.openstreetmap.josm.tools.GBC;
     57import org.openstreetmap.josm.tools.JosmRuntimeException;
    5758import org.openstreetmap.josm.tools.Shortcut;
    5859import org.openstreetmap.josm.tools.Utils;
     
    229230                            tf.getDocument().insertString(tf.getCaretPosition(), ' ' + insertText, null);
    230231                        } catch (BadLocationException ex) {
    231                             throw new RuntimeException(ex.getMessage(), ex);
     232                            throw new JosmRuntimeException(ex.getMessage(), ex);
    232233                        }
    233234                    }
  • trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java

    r11240 r11374  
    1919import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    2020import org.openstreetmap.josm.tools.CheckParameterUtil;
     21import org.openstreetmap.josm.tools.JosmRuntimeException;
    2122
    2223/**
     
    170171            OsmPrimitive osm = getAffectedDataSet().getPrimitiveById(d);
    171172            if (osm == null)
    172                 throw new RuntimeException();
     173                throw new JosmRuntimeException("No primitive found for " + d);
    173174            prims.add(osm);
    174175        }
     
    188189        AddPrimitivesCommand that = (AddPrimitivesCommand) obj;
    189190        return Objects.equals(data, that.data) &&
    190                 Objects.equals(toSelect, that.toSelect) &&
    191                 Objects.equals(createdPrimitives, that.createdPrimitives) &&
    192                 Objects.equals(createdPrimitivesToSelect, that.createdPrimitivesToSelect);
     191               Objects.equals(toSelect, that.toSelect) &&
     192               Objects.equals(createdPrimitives, that.createdPrimitives) &&
     193               Objects.equals(createdPrimitivesToSelect, that.createdPrimitivesToSelect);
    193194    }
    194195}
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r11288 r11374  
    7373import org.openstreetmap.josm.tools.ColorHelper;
    7474import org.openstreetmap.josm.tools.I18n;
     75import org.openstreetmap.josm.tools.JosmRuntimeException;
    7576import org.openstreetmap.josm.tools.ListenerList;
    7677import org.openstreetmap.josm.tools.MultiMap;
     
    13271328                }
    13281329            } catch (IllegalAccessException ex) {
    1329                 throw new RuntimeException(ex);
     1330                throw new JosmRuntimeException(ex);
    13301331            }
    13311332        }
     
    13871388                value = multiMapFromJson(key_value.getValue());
    13881389            } else
    1389                 throw new RuntimeException("unsupported preference primitive type");
     1390                throw new JosmRuntimeException("unsupported preference primitive type");
    13901391
    13911392            try {
     
    13941395                throw new AssertionError(ex);
    13951396            } catch (IllegalAccessException ex) {
    1396                 throw new RuntimeException(ex);
     1397                throw new JosmRuntimeException(ex);
    13971398            }
    13981399        }
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r11269 r11374  
    4646import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    4747import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
     48import org.openstreetmap.josm.tools.JosmRuntimeException;
    4849import org.openstreetmap.josm.tools.SubclassFilteredCollection;
    4950import org.openstreetmap.josm.tools.Utils;
     
    516517            }
    517518            if (!success)
    518                 throw new RuntimeException("failed to add primitive: "+primitive);
     519                throw new JosmRuntimeException("failed to add primitive: "+primitive);
    519520            firePrimitivesAdded(Collections.singletonList(primitive), false);
    520521        } finally {
     
    547548            }
    548549            if (!success)
    549                 throw new RuntimeException("failed to remove primitive: "+primitive);
     550                throw new JosmRuntimeException("failed to remove primitive: "+primitive);
    550551            synchronized (selectionLock) {
    551552                selectedPrimitives.remove(primitive);
     
    10631064    private void reindexNode(Node node, LatLon newCoor, EastNorth eastNorth) {
    10641065        if (!nodes.remove(node))
    1065             throw new RuntimeException("Reindexing node failed to remove");
     1066            throw new JosmRuntimeException("Reindexing node failed to remove");
    10661067        node.setCoorInternal(newCoor, eastNorth);
    10671068        if (!nodes.add(node))
    1068             throw new RuntimeException("Reindexing node failed to add");
     1069            throw new JosmRuntimeException("Reindexing node failed to add");
    10691070        for (OsmPrimitive primitive: node.getReferrers()) {
    10701071            if (primitive instanceof Way) {
     
    10791080        BBox before = way.getBBox();
    10801081        if (!ways.remove(way))
    1081             throw new RuntimeException("Reindexing way failed to remove");
     1082            throw new JosmRuntimeException("Reindexing way failed to remove");
    10821083        way.updatePosition();
    10831084        if (!ways.add(way))
    1084             throw new RuntimeException("Reindexing way failed to add");
     1085            throw new JosmRuntimeException("Reindexing way failed to add");
    10851086        if (!way.getBBox().equals(before)) {
    10861087            for (OsmPrimitive primitive: way.getReferrers()) {
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r10308 r11374  
    1818import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    1919import org.openstreetmap.josm.tools.CheckParameterUtil;
     20import org.openstreetmap.josm.tools.JosmRuntimeException;
    2021
    2122/**
     
    143144        Way myWay = (Way) getMergeTarget(other);
    144145        if (myWay == null)
    145             throw new RuntimeException(tr("Missing merge target for way with id {0}", other.getUniqueId()));
     146            throw new JosmRuntimeException(tr("Missing merge target for way with id {0}", other.getUniqueId()));
    146147    }
    147148
     
    178179                OsmPrimitive source = sourceDataSet.getPrimitiveById(target.getPrimitiveId());
    179180                if (source == null)
    180                     throw new RuntimeException(
     181                    throw new JosmRuntimeException(
    181182                            tr("Object of type {0} with id {1} was marked to be deleted, but it''s missing in the source dataset",
    182183                            target.getType(), target.getUniqueId()));
  • trunk/src/org/openstreetmap/josm/data/projection/Projections.java

    r11042 r11374  
    4444import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference;
    4545import org.openstreetmap.josm.io.CachedFile;
     46import org.openstreetmap.josm.tools.JosmRuntimeException;
    4647import org.openstreetmap.josm.tools.Utils;
    4748
     
    147148            pds = loadProjectionDefinitions("resource://data/projection/custom-epsg");
    148149        } catch (IOException ex) {
    149             throw new RuntimeException(ex);
     150            throw new JosmRuntimeException(ex);
    150151        }
    151152        inits = new LinkedHashMap<>();
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFileWrapper.java

    r10212 r11374  
    66
    77import org.openstreetmap.josm.io.CachedFile;
     8import org.openstreetmap.josm.tools.JosmRuntimeException;
    89
    910/**
     
    5758                instance.loadGridShiftFile(is, false);
    5859            } catch (IOException e) {
    59                 throw new RuntimeException(e);
     60                throw new JosmRuntimeException(e);
    6061            }
    6162        }
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ClassProjFactory.java

    r10208 r11374  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.projection.proj;
     3
     4import org.openstreetmap.josm.tools.JosmRuntimeException;
    35
    46/**
     
    2325            proj = projClass.getConstructor().newInstance();
    2426        } catch (ReflectiveOperationException e) {
    25             throw new RuntimeException(e);
     27            throw new JosmRuntimeException(e);
    2628        }
    2729        return proj;
  • trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java

    r10308 r11374  
    2020import org.openstreetmap.josm.data.projection.Ellipsoid;
    2121import org.openstreetmap.josm.data.projection.ProjectionConfigurationException;
     22import org.openstreetmap.josm.tools.JosmRuntimeException;
    2223
    2324// CHECKSTYLE.OFF: LineLength
     
    108109        while (abs(phi - prevPhi) > EPSILON) {
    109110            if (++iteration > 30)
    110                 throw new RuntimeException("Two many iterations");
     111                throw new JosmRuntimeException("Two many iterations");
    111112            prevPhi = phi;
    112113            double s = 1 / alpha * (log(tan(PI / 4 + b / 2)) - k) + ellps.e
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r11365 r11374  
    10301030                    l.rename((String) value);
    10311031                    break;
    1032                 default: throw new RuntimeException();
     1032                default:
     1033                    throw new IllegalArgumentException("Wrong column: " + col);
    10331034                }
    10341035                fireTableCellUpdated(row, col);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r11298 r11374  
    5555import org.openstreetmap.josm.tools.ImageProvider;
    5656import org.openstreetmap.josm.tools.InputMapUtils;
     57import org.openstreetmap.josm.tools.JosmRuntimeException;
    5758import org.openstreetmap.josm.tools.Shortcut;
    5859import org.xml.sax.SAXException;
     
    634635            } catch (InterruptedException | InvocationTargetException e) {
    635636                // FIXME: signature of realRun should have a generic checked exception we could throw here
    636                 throw new RuntimeException(e);
     637                throw new JosmRuntimeException(e);
    637638            } finally {
    638639                monitor.finishTask();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java

    r10965 r11374  
    3030import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.ToTagConvertable;
    3131import org.openstreetmap.josm.tools.CheckParameterUtil;
     32import org.openstreetmap.josm.tools.JosmRuntimeException;
    3233import org.openstreetmap.josm.tools.Utils;
    3334
     
    819820                return not ^ (Boolean) method.invoke(null, e);
    820821            } catch (IllegalAccessException | InvocationTargetException ex) {
    821                 throw new RuntimeException(ex);
     822                throw new JosmRuntimeException(ex);
    822823            }
    823824        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r11360 r11374  
    4040import org.openstreetmap.josm.tools.ColorHelper;
    4141import org.openstreetmap.josm.tools.Geometry;
     42import org.openstreetmap.josm.tools.JosmRuntimeException;
    4243import org.openstreetmap.josm.tools.RightAndLefthandTraffic;
    4344import org.openstreetmap.josm.tools.SubclassFilteredCollection;
     
    9798            parameterFunctions.add(Math.class.getMethod("tanh", double.class));
    9899        } catch (NoSuchMethodException | SecurityException ex) {
    99             throw new RuntimeException(ex);
     100            throw new JosmRuntimeException(ex);
    100101        }
    101102    }
     
    12401241                result = m.invoke(null, convertedArgs);
    12411242            } catch (IllegalAccessException | IllegalArgumentException ex) {
    1242                 throw new RuntimeException(ex);
     1243                throw new JosmRuntimeException(ex);
    12431244            } catch (InvocationTargetException ex) {
    12441245                Main.error(ex);
     
    13061307                result = m.invoke(null, convertedArgs);
    13071308            } catch (IllegalAccessException | IllegalArgumentException ex) {
    1308                 throw new RuntimeException(ex);
     1309                throw new JosmRuntimeException(ex);
    13091310            } catch (InvocationTargetException ex) {
    13101311                Main.error(ex);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj

    r10837 r11374  
    4040import org.openstreetmap.josm.gui.mappaint.mapcss.Subpart;
    4141import org.openstreetmap.josm.tools.ColorHelper;
     42import org.openstreetmap.josm.tools.JosmRuntimeException;
    4243import org.openstreetmap.josm.tools.Pair;
    4344import org.openstreetmap.josm.tools.Utils;
     
    6667     */
    6768    public static enum LexicalState {
    68         PREPROCESSOR(0), /* the preprocessor */
    69         DEFAULT(2);      /* the main parser */
    70        
     69        /** the preprocessor */
     70        PREPROCESSOR(0),
     71        /** the main parser */
     72        DEFAULT(2);
     73
    7174        int idx; // the integer, which javacc assigns to this state
    72        
     75
    7376        LexicalState(int idx) {
    7477            if (!this.name().equals(MapCSSParserTokenManager.lexStateNames[idx])) {
    75                 throw new RuntimeException();
     78                throw new JosmRuntimeException("Wrong name for index " + idx);
    7679            }
    7780            this.idx = idx;
    7881        }
    79     };
     82    }
    8083   
    8184    /**
     
    9598            scs = new SimpleCharStream(in, encoding, 1, 1);
    9699        } catch (java.io.UnsupportedEncodingException e) {
    97             throw new RuntimeException(e);
     100            throw new JosmRuntimeException(e);
    98101        }
    99102        return new MapCSSParserTokenManager(scs, initState.idx);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r10837 r11374  
    6060import org.openstreetmap.josm.io.CachedFile;
    6161import org.openstreetmap.josm.tools.CheckParameterUtil;
     62import org.openstreetmap.josm.tools.JosmRuntimeException;
    6263import org.openstreetmap.josm.tools.LanguageInfo;
    6364import org.openstreetmap.josm.tools.Utils;
     
    108109                SUPPORTED_KEYS.add((String) f.get(null));
    109110                if (!f.getName().toLowerCase(Locale.ENGLISH).replace('_', '-').equals(f.get(null))) {
    110                     throw new RuntimeException(f.getName());
     111                    throw new JosmRuntimeException(f.getName());
    111112                }
    112113            } catch (IllegalArgumentException | IllegalAccessException ex) {
    113                 throw new RuntimeException(ex);
     114                throw new JosmRuntimeException(ex);
    114115            }
    115116        }
     
    468469                        break;
    469470                    default:
    470                         final RuntimeException e = new RuntimeException(MessageFormat.format("Unknown MapCSS base selector {0}", base));
     471                        final RuntimeException e = new JosmRuntimeException(MessageFormat.format("Unknown MapCSS base selector {0}", base));
    471472                        Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
    472473                        Main.error(e);
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r11017 r11374  
    3737import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
    3838import org.openstreetmap.josm.tools.GBC;
     39import org.openstreetmap.josm.tools.JosmRuntimeException;
    3940
    4041/**
     
    479480        // should have been set to Mercator at JOSM start.
    480481        if (pc == null)
    481             throw new RuntimeException("Couldn't find the current projection in the list of available projections!");
     482            throw new JosmRuntimeException("Couldn't find the current projection in the list of available projections!");
    482483
    483484        projectionCombo.addActionListener(e -> {
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagCellRenderer.java

    r10378 r11374  
    1212import javax.swing.border.EmptyBorder;
    1313import javax.swing.table.TableCellRenderer;
     14
     15import org.openstreetmap.josm.tools.JosmRuntimeException;
    1416
    1517/**
     
    102104        case 1: renderTagValue((TagModel) value); break;
    103105
    104         default: throw new RuntimeException("unexpected index in switch statement");
     106        default: throw new JosmRuntimeException("unexpected index in switch statement");
    105107        }
    106108        if (hasFocus && isSelected) {
  • trunk/src/org/openstreetmap/josm/io/GpxWriter.java

    r9231 r11374  
    2727import org.openstreetmap.josm.data.gpx.IWithAttributes;
    2828import org.openstreetmap.josm.data.gpx.WayPoint;
     29import org.openstreetmap.josm.tools.JosmRuntimeException;
    2930
    3031/**
     
    291292            break;
    292293        default:
    293             throw new RuntimeException(tr("Unknown mode {0}.", mode));
     294            throw new JosmRuntimeException(tr("Unknown mode {0}.", mode));
    294295        }
    295296        if (pnt != null) {
  • trunk/src/org/openstreetmap/josm/io/NmeaReader.java

    r10906 r11374  
    2020import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
    2121import org.openstreetmap.josm.data.gpx.WayPoint;
     22import org.openstreetmap.josm.tools.JosmRuntimeException;
    2223import org.openstreetmap.josm.tools.date.DateUtils;
    2324
     
    116117        }
    117118        if (d == null)
    118             throw new RuntimeException("Date is malformed"); // malformed
     119            throw new JosmRuntimeException("Date is malformed");
    119120        return d;
    120121    }
  • trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java

    r10627 r11374  
    2222import org.openstreetmap.josm.io.CachedFile;
    2323import org.openstreetmap.josm.tools.HttpClient;
     24import org.openstreetmap.josm.tools.JosmRuntimeException;
    2425import org.openstreetmap.josm.tools.LanguageInfo;
    2526import org.openstreetmap.josm.tools.MultiMap;
     
    273274            switch (states.pop()) {
    274275            case INIT:
    275                 throw new RuntimeException("parsing error: more closing than opening elements");
     276                throw new JosmRuntimeException("parsing error: more closing than opening elements");
    276277            case ENTRY:
    277278                if ("entry".equals(qName)) {
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r11043 r11374  
    4343import org.openstreetmap.josm.io.Compression;
    4444import org.openstreetmap.josm.io.IllegalDataException;
     45import org.openstreetmap.josm.tools.JosmRuntimeException;
    4546import org.openstreetmap.josm.tools.MultiMap;
    4647import org.openstreetmap.josm.tools.Utils;
     
    99100            importer = importerClass.getConstructor().newInstance();
    100101        } catch (ReflectiveOperationException e) {
    101             throw new RuntimeException(e);
     102            throw new JosmRuntimeException(e);
    102103        }
    103104        return importer;
     
    574575                });
    575576            } catch (InvocationTargetException | InterruptedException ex) {
    576                 throw new RuntimeException(ex);
     577                throw new JosmRuntimeException(ex);
    577578            }
    578579        }
  • trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java

    r10404 r11374  
    4040import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer;
    4141import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
     42import org.openstreetmap.josm.tools.JosmRuntimeException;
    4243import org.openstreetmap.josm.tools.MultiMap;
    4344import org.openstreetmap.josm.tools.Utils;
     
    9798            return exporterClass.getConstructor(layerClass).newInstance(layer);
    9899        } catch (ReflectiveOperationException e) {
    99             throw new RuntimeException(e);
     100            throw new JosmRuntimeException(e);
    100101        }
    101102    }
     
    174175         */
    175176        public OutputStream getOutputStreamZip(String zipPath) throws IOException {
    176             if (!isZip()) throw new RuntimeException();
     177            if (!isZip()) throw new JosmRuntimeException("not zip");
    177178            ZipEntry entry = new ZipEntry(zipPath);
    178179            zipOut.putNextEntry(entry);
     
    277278            trans.transform(source, result);
    278279        } catch (TransformerException e) {
    279             throw new RuntimeException(e);
     280            throw new JosmRuntimeException(e);
    280281        }
    281282    }
  • trunk/src/org/openstreetmap/josm/tools/FontsManager.java

    r9639 r11374  
    4141                ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, i));
    4242            } catch (IOException | FontFormatException ex) {
    43                 throw new RuntimeException(ex);
     43                throw new JosmRuntimeException(ex);
    4444            }
    4545        }
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r11021 r11374  
    637637            if (!optional) {
    638638                String ext = name.indexOf('.') != -1 ? "" : ".???";
    639                 throw new RuntimeException(
     639                throw new JosmRuntimeException(
    640640                        tr("Fatal: failed to locate image ''{0}''. This is a serious configuration problem. JOSM will stop working.",
    641641                                name + ext));
  • trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java

    r11264 r11374  
    158158            w.footer();
    159159        } catch (IOException ex) {
    160             throw new RuntimeException(ex);
     160            throw new JosmRuntimeException(ex);
    161161        }
    162162    }
  • trunk/src/org/openstreetmap/josm/tools/Territories.java

    r11362 r11374  
    104104            }
    105105        } catch (IOException | IllegalDataException ex) {
    106             throw new RuntimeException(ex);
     106            throw new JosmRuntimeException(ex);
    107107        }
    108108    }
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r11330 r11374  
    556556            md = MessageDigest.getInstance("MD5");
    557557        } catch (NoSuchAlgorithmException e) {
    558             throw new RuntimeException(e);
     558            throw new JosmRuntimeException(e);
    559559        }
    560560        byte[] byteData = data.getBytes(StandardCharsets.UTF_8);
     
    621621                }
    622622            }
    623             if (parentless == null) throw new RuntimeException();
     623            if (parentless == null) throw new JosmRuntimeException("parentless");
    624624            sorted.add(parentless);
    625625            deps.remove(parentless);
     
    628628            }
    629629        }
    630         if (sorted.size() != size) throw new RuntimeException();
     630        if (sorted.size() != size) throw new JosmRuntimeException("Wrong size");
    631631        return sorted;
    632632    }
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r10627 r11374  
    258258            return this;
    259259        } catch (ParserConfigurationException e) {
    260             // This should never happen ;-)
    261             throw new RuntimeException(e);
     260            throw new JosmRuntimeException(e);
    262261        }
    263262    }
Note: See TracChangeset for help on using the changeset viewer.