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/data/projection
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.