Ignore:
Timestamp:
2014-12-20T22:43:20+01:00 (8 years ago)
Author:
Don-vip
Message:

global cleanup of IllegalArgumentExceptions thrown by JOSM

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
4 edited

Legend:

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

    r7592 r7864  
    175175
    176176            if (Double.isNaN(deg) && Double.isNaN(min) && Double.isNaN(sec))
    177                 throw new IllegalArgumentException();
     177                throw new IllegalArgumentException("deg, min and sec are NaN");
    178178
    179179            value = (Double.isNaN(deg) ? 0 : deg + (Double.isNaN(min) ? 0 : (min / 60)) + (Double.isNaN(sec) ? 0 : (sec / 3600)));
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r7828 r7864  
    329329        CheckParameterUtil.ensureValidCoordinates(p4, "p4");
    330330
    331         if (!p1.isValid()) throw new IllegalArgumentException();
     331        if (!p1.isValid()) throw new IllegalArgumentException(p1+" is invalid");
    332332
    333333        // Basically, the formula from wikipedia is used:
  • trunk/src/org/openstreetmap/josm/tools/ImageResource.java

    r7731 r7864  
    8181    public ImageIcon getImageIcon(Dimension dim) {
    8282        if (dim.width < -1 || dim.width == 0 || dim.height < -1 || dim.height == 0)
    83             throw new IllegalArgumentException();
     83            throw new IllegalArgumentException(dim+" is invalid");
    8484        Image img = imgCache.get(dim);
    8585        if (img != null) {
     
    123123    public ImageIcon getImageIconBounded(Dimension maxSize) {
    124124        if (maxSize.width < -1 || maxSize.width == 0 || maxSize.height < -1 || maxSize.height == 0)
    125             throw new IllegalArgumentException();
     125            throw new IllegalArgumentException(maxSize+" is invalid");
    126126        float realWidth;
    127127        float realHeight;
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r7835 r7864  
    189189    public static int mod(int a, int n) {
    190190        if (n <= 0)
    191             throw new IllegalArgumentException();
     191            throw new IllegalArgumentException("n must be <= 0 but is "+n);
    192192        int res = a % n;
    193193        if (res < 0) {
     
    206206     */
    207207    public static String join(String sep, Collection<?> values) {
    208         if (sep == null)
    209             throw new IllegalArgumentException();
     208        CheckParameterUtil.ensureParameterNotNull(sep, "sep");
    210209        if (values == null)
    211210            return null;
Note: See TracChangeset for help on using the changeset viewer.