Ignore:
Timestamp:
2016-03-17T01:50:12+01:00 (10 years ago)
Author:
Don-vip
Message:

sonar - Local variable and method parameter names should comply with a naming convention

File:
1 edited

Legend:

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

    r10000 r10001  
    615615            s = s.substring(m.end());
    616616        }
    617         final String FLOAT = "(\\d+(\\.\\d*)?)";
     617        final String floatPattern = "(\\d+(\\.\\d*)?)";
    618618        boolean dms = false;
    619619        double deg = 0.0, min = 0.0, sec = 0.0;
    620620        // degrees
    621         m = Pattern.compile("^"+FLOAT+"d").matcher(s);
     621        m = Pattern.compile("^"+floatPattern+"d").matcher(s);
    622622        if (m.find()) {
    623623            s = s.substring(m.end());
     
    626626        }
    627627        // minutes
    628         m = Pattern.compile("^"+FLOAT+"'").matcher(s);
     628        m = Pattern.compile("^"+floatPattern+"'").matcher(s);
    629629        if (m.find()) {
    630630            s = s.substring(m.end());
     
    633633        }
    634634        // seconds
    635         m = Pattern.compile("^"+FLOAT+"\"").matcher(s);
     635        m = Pattern.compile("^"+floatPattern+"\"").matcher(s);
    636636        if (m.find()) {
    637637            s = s.substring(m.end());
     
    643643            value = deg + (min/60.0) + (sec/3600.0);
    644644        } else {
    645             m = Pattern.compile("^"+FLOAT).matcher(s);
     645            m = Pattern.compile("^"+floatPattern).matcher(s);
    646646            if (m.find()) {
    647647                s = s.substring(m.end());
     
    780780    }
    781781
    782     private static EastNorth getPointAlong(int i, int N, ProjectionBounds r) {
    783         double dEast = (r.maxEast - r.minEast) / N;
    784         double dNorth = (r.maxNorth - r.minNorth) / N;
    785         if (i < N) {
     782    private static EastNorth getPointAlong(int i, int n, ProjectionBounds r) {
     783        double dEast = (r.maxEast - r.minEast) / n;
     784        double dNorth = (r.maxNorth - r.minNorth) / n;
     785        if (i < n) {
    786786            return new EastNorth(r.minEast + i * dEast, r.minNorth);
    787         } else if (i < 2*N) {
    788             i -= N;
     787        } else if (i < 2*n) {
     788            i -= n;
    789789            return new EastNorth(r.maxEast, r.minNorth + i * dNorth);
    790         } else if (i < 3*N) {
    791             i -= 2*N;
     790        } else if (i < 3*n) {
     791            i -= 2*n;
    792792            return new EastNorth(r.maxEast - i * dEast, r.maxNorth);
    793         } else if (i < 4*N) {
    794             i -= 3*N;
     793        } else if (i < 4*n) {
     794            i -= 3*n;
    795795            return new EastNorth(r.minEast, r.maxNorth - i * dNorth);
    796796        } else {
     
    824824    @Override
    825825    public Bounds getLatLonBoundsBox(ProjectionBounds r) {
    826         final int N = 10;
     826        final int n = 10;
    827827        Bounds result = new Bounds(eastNorth2latlon(r.getMin()));
    828828        result.extend(eastNorth2latlon(r.getMax()));
    829829        LatLon llPrev = null;
    830         for (int i = 0; i < 4*N; i++) {
    831             LatLon llNow = eastNorth2latlon(getPointAlong(i, N, r));
     830        for (int i = 0; i < 4*n; i++) {
     831            LatLon llNow = eastNorth2latlon(getPointAlong(i, n, r));
    832832            result.extend(llNow);
    833833            // check if segment crosses 180th meridian and if so, make sure
Note: See TracChangeset for help on using the changeset viewer.