Ignore:
Timestamp:
2016-05-17T02:02:30+02:00 (3 years ago)
Author:
Don-vip
Message:

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

Location:
trunk/src/org/openstreetmap/josm/data/projection/proj
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/proj/AbstractProj.java

    r9992 r10235  
    138138        for (i = MAXIMUM_ITERATIONS; true;) { // rarely goes over 5 iterations
    139139            if (--i < 0) {
    140                 throw new RuntimeException("Too many iterations");
     140                throw new IllegalStateException("Too many iterations");
    141141            }
    142142            s = Math.sin(phi);
     
    162162            }
    163163        }
    164         throw new RuntimeException("no convergence");
     164        throw new IllegalStateException("no convergence for ts="+ts);
    165165    }
    166166
  • trunk/src/org/openstreetmap/josm/data/projection/proj/AlbersEqualArea.java

    r10001 r10235  
    126126                rho = 0.0;
    127127            } else {
    128                 throw new RuntimeException();
     128                throw new AssertionError();
    129129            }
    130130        }
     
    184184            }
    185185        }
    186         throw new RuntimeException("no convergence for q="+qs);
     186        throw new IllegalStateException("no convergence for qs="+qs);
    187187    }
    188188
  • trunk/src/org/openstreetmap/josm/data/projection/proj/DoubleStereographic.java

    r10001 r10235  
    100100        while (abs(phi - phiprev) > EPSILON) {
    101101            if (++iteration > 10)
    102                 throw new RuntimeException("Too many iterations");
     102                throw new IllegalStateException("Too many iterations");
    103103            phiprev = phi;
    104104            double psii = log(tan(phi/2 + PI/4) * pow((1 - e * sin(phi)) / (1 + e * sin(phi)), e/2));
  • trunk/src/org/openstreetmap/josm/data/projection/proj/PolarStereographic.java

    r10001 r10235  
    163163            phi0 = phi;
    164164            if (--i < 0) {
    165                 throw new RuntimeException("no convergence");
     165                throw new IllegalStateException("no convergence for x="+x+", y="+y);
    166166            }
    167167        }
Note: See TracChangeset for help on using the changeset viewer.