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

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

Location:
trunk/src/org/openstreetmap/josm/data
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java

    r8510 r10001  
    2323    public static LatLon tile2LatLon(long quad) {
    2424        // The world is divided up into X_PARTS,Y_PARTS.
    25         // The question is how far we move for each bit
    26         // being set.  In the case of the top level, we
    27         // move half of the world.
    28         double x_unit = X_PARTS/2;
    29         double y_unit = Y_PARTS/2;
     25        // The question is how far we move for each bit being set.
     26        // In the case of the top level, we move half of the world.
     27        double xUnit = X_PARTS/2;
     28        double yUnit = Y_PARTS/2;
    3029        long shift = (NR_LEVELS*2)-2;
    3130
     
    3635            // remember x is the MSB
    3736            if ((bits & 0x2) != 0) {
    38                 x += x_unit;
     37                x += xUnit;
    3938            }
    4039            if ((bits & 0x1) != 0) {
    41                 y += y_unit;
     40                y += yUnit;
    4241            }
    43             x_unit /= 2;
    44             y_unit /= 2;
     42            xUnit /= 2;
     43            yUnit /= 2;
    4544            shift -= 2;
    4645        }
     
    6160        }
    6261        return tile;
    63     }
    64 
    65     static long coorToTile(LatLon coor) {
    66         return quadTile(coor);
    6762    }
    6863
     
    8984    public static int index(int level, long quad) {
    9085        long mask = 0x00000003;
    91         int total_shift = TILES_PER_LEVEL_SHIFT*(NR_LEVELS-level-1);
    92         return (int) (mask & (quad >> total_shift));
     86        int totalShift = TILES_PER_LEVEL_SHIFT*(NR_LEVELS-level-1);
     87        return (int) (mask & (quad >> totalShift));
    9388    }
    9489
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java

    r9854 r10001  
    240240
    241241    /**
    242      * Makes a WayPoint at the projection of point P onto the track providing P is less than
     242     * Makes a WayPoint at the projection of point p onto the track providing p is less than
    243243     * tolerance away from the track
    244244     *
    245      * @param P : the point to determine the projection for
     245     * @param p : the point to determine the projection for
    246246     * @param tolerance : must be no further than this from the track
    247      * @return the closest point on the track to P, which may be the first or last point if off the
     247     * @return the closest point on the track to p, which may be the first or last point if off the
    248248     * end of a segment, or may be null if nothing close enough
    249249     */
    250     public WayPoint nearestPointOnTrack(EastNorth P, double tolerance) {
     250    public WayPoint nearestPointOnTrack(EastNorth p, double tolerance) {
    251251        /*
    252252         * assume the coordinates of P are xp,yp, and those of a section of track between two
     
    272272         */
    273273
    274         double PNminsq = tolerance * tolerance;
     274        double pnminsq = tolerance * tolerance;
    275275        EastNorth bestEN = null;
    276276        double bestTime = 0.0;
    277         double px = P.east();
    278         double py = P.north();
     277        double px = p.east();
     278        double py = p.north();
    279279        double rx = 0.0, ry = 0.0, sx, sy, x, y;
    280280        if (tracks == null)
     
    282282        for (GpxTrack track : tracks) {
    283283            for (GpxTrackSegment seg : track.getSegments()) {
    284                 WayPoint R = null;
     284                WayPoint r = null;
    285285                for (WayPoint S : seg.getWayPoints()) {
    286                     EastNorth c = S.getEastNorth();
    287                     if (R == null) {
    288                         R = S;
    289                         rx = c.east();
    290                         ry = c.north();
     286                    EastNorth en = S.getEastNorth();
     287                    if (r == null) {
     288                        r = S;
     289                        rx = en.east();
     290                        ry = en.north();
    291291                        x = px - rx;
    292292                        y = py - ry;
    293                         double PRsq = x * x + y * y;
    294                         if (PRsq < PNminsq) {
    295                             PNminsq = PRsq;
    296                             bestEN = c;
    297                             bestTime = R.time;
     293                        double pRsq = x * x + y * y;
     294                        if (pRsq < pnminsq) {
     295                            pnminsq = pRsq;
     296                            bestEN = en;
     297                            bestTime = r.time;
    298298                        }
    299299                    } else {
    300                         sx = c.east();
    301                         sy = c.north();
    302                         double A = sy - ry;
    303                         double B = rx - sx;
    304                         double C = -A * rx - B * ry;
    305                         double RSsq = A * A + B * B;
    306                         if (RSsq == 0) {
     300                        sx = en.east();
     301                        sy = en.north();
     302                        double a = sy - ry;
     303                        double b = rx - sx;
     304                        double c = -a * rx - b * ry;
     305                        double rssq = a * a + b * b;
     306                        if (rssq == 0) {
    307307                            continue;
    308308                        }
    309                         double PNsq = A * px + B * py + C;
    310                         PNsq = PNsq * PNsq / RSsq;
    311                         if (PNsq < PNminsq) {
     309                        double pnsq = a * px + b * py + c;
     310                        pnsq = pnsq * pnsq / rssq;
     311                        if (pnsq < pnminsq) {
    312312                            x = px - rx;
    313313                            y = py - ry;
    314                             double PRsq = x * x + y * y;
     314                            double prsq = x * x + y * y;
    315315                            x = px - sx;
    316316                            y = py - sy;
    317                             double PSsq = x * x + y * y;
    318                             if (PRsq - PNsq <= RSsq && PSsq - PNsq <= RSsq) {
    319                                 double RNoverRS = Math.sqrt((PRsq - PNsq) / RSsq);
    320                                 double nx = rx - RNoverRS * B;
    321                                 double ny = ry + RNoverRS * A;
     317                            double pssq = x * x + y * y;
     318                            if (prsq - pnsq <= rssq && pssq - pnsq <= rssq) {
     319                                double rnoverRS = Math.sqrt((prsq - pnsq) / rssq);
     320                                double nx = rx - rnoverRS * b;
     321                                double ny = ry + rnoverRS * a;
    322322                                bestEN = new EastNorth(nx, ny);
    323                                 bestTime = R.time + RNoverRS * (S.time - R.time);
    324                                 PNminsq = PNsq;
     323                                bestTime = r.time + rnoverRS * (S.time - r.time);
     324                                pnminsq = pnsq;
    325325                            }
    326326                        }
    327                         R = S;
     327                        r = S;
    328328                        rx = sx;
    329329                        ry = sy;
    330330                    }
    331331                }
    332                 if (R != null) {
    333                     EastNorth c = R.getEastNorth();
     332                if (r != null) {
     333                    EastNorth c = r.getEastNorth();
    334334                    /* if there is only one point in the seg, it will do this twice, but no matter */
    335335                    rx = c.east();
     
    337337                    x = px - rx;
    338338                    y = py - ry;
    339                     double PRsq = x * x + y * y;
    340                     if (PRsq < PNminsq) {
    341                         PNminsq = PRsq;
     339                    double prsq = x * x + y * y;
     340                    if (prsq < pnminsq) {
     341                        pnminsq = prsq;
    342342                        bestEN = c;
    343                         bestTime = R.time;
     343                        bestTime = r.time;
    344344                    }
    345345                }
  • trunk/src/org/openstreetmap/josm/data/osm/BBox.java

    r9976 r10001  
    5252    }
    5353
    54     public BBox(double a_x, double a_y, double b_x, double b_y)  {
    55 
    56         if (a_x > b_x) {
    57             xmax = a_x;
    58             xmin = b_x;
     54    public BBox(double ax, double ay, double bx, double by)  {
     55
     56        if (ax > bx) {
     57            xmax = ax;
     58            xmin = bx;
    5959        } else {
    60             xmax = b_x;
    61             xmin = a_x;
    62         }
    63 
    64         if (a_y > b_y) {
    65             ymax = a_y;
    66             ymin = b_y;
     60            xmax = bx;
     61            xmin = ax;
     62        }
     63
     64        if (ay > by) {
     65            ymax = ay;
     66            ymin = by;
    6767        } else {
    68             ymax = b_y;
    69             ymin = a_y;
     68            ymax = by;
     69            ymin = ay;
    7070        }
    7171
  • trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java

    r9854 r10001  
    9898        }
    9999
    100         QBLevel(QBLevel<T> parent, int parent_index, final QuadBuckets<T> buckets) {
     100        QBLevel(QBLevel<T> parent, int parentIndex, final QuadBuckets<T> buckets) {
    101101            this.parent = parent;
    102102            this.level = parent.level + 1;
    103             this.index = parent_index;
     103            this.index = parentIndex;
    104104            this.buckets = buckets;
    105105
     
    111111                mult = 1 << 30;
    112112            }
    113             long this_quadpart = mult * (parent_index << shift);
    114             this.quad = parent.quad | this_quadpart;
     113            long quadpart = mult * (parentIndex << shift);
     114            this.quad = parent.quad | quadpart;
    115115            this.bbox = calculateBBox(); // calculateBBox reference quad
    116116        }
    117117
    118118        private BBox calculateBBox() {
    119             LatLon bottom_left = this.coor();
    120             double lat = bottom_left.lat() + parent.height() / 2;
    121             double lon = bottom_left.lon() + parent.width() / 2;
    122             return new BBox(bottom_left.lon(), bottom_left.lat(), lon, lat);
     119            LatLon bottomLeft = this.coor();
     120            double lat = bottomLeft.lat() + parent.height() / 2;
     121            double lon = bottomLeft.lon() + parent.width() / 2;
     122            return new BBox(bottomLeft.lon(), bottomLeft.lat(), lon, lat);
    123123        }
    124124
     
    181181        }
    182182
    183         boolean matches(final T o, final BBox search_bbox) {
     183        boolean matches(final T o, final BBox searchBbox) {
    184184            if (o instanceof Node) {
    185185                final LatLon latLon = ((Node) o).getCoor();
    186186                // node without coords -> bbox[0,0,0,0]
    187                 return search_bbox.bounds(latLon != null ? latLon : LatLon.ZERO);
    188             }
    189             return o.getBBox().intersects(search_bbox);
    190         }
    191 
    192         private void search_contents(BBox search_bbox, List<T> result) {
     187                return searchBbox.bounds(latLon != null ? latLon : LatLon.ZERO);
     188            }
     189            return o.getBBox().intersects(searchBbox);
     190        }
     191
     192        private void search_contents(BBox searchBbox, List<T> result) {
    193193            /*
    194194             * It is possible that this was created in a split
     
    199199
    200200            for (T o : content) {
    201                 if (matches(o, search_bbox)) {
     201                if (matches(o, searchBbox)) {
    202202                    result.add(o);
    203203                }
     
    299299        }
    300300
    301         private void search(BBox search_bbox, List<T> result) {
    302             if (!this.bbox().intersects(search_bbox))
     301        private void search(BBox searchBbox, List<T> result) {
     302            if (!this.bbox().intersects(searchBbox))
    303303                return;
    304             else if (bbox().bounds(search_bbox)) {
     304            else if (bbox().bounds(searchBbox)) {
    305305                buckets.searchCache = this;
    306306            }
    307307
    308308            if (this.hasContent()) {
    309                 search_contents(search_bbox, result);
     309                search_contents(searchBbox, result);
    310310            }
    311311
     
    313313
    314314            if (nw != null) {
    315                 nw.search(search_bbox, result);
     315                nw.search(searchBbox, result);
    316316            }
    317317            if (ne != null) {
    318                 ne.search(search_bbox, result);
     318                ne.search(searchBbox, result);
    319319            }
    320320            if (se != null) {
    321                 se.search(search_bbox, result);
     321                se.search(searchBbox, result);
    322322            }
    323323            if (sw != null) {
    324                 sw.search(search_bbox, result);
     324                sw.search(searchBbox, result);
    325325            }
    326326        }
     
    330330        }
    331331
    332         int index_of(QBLevel<T> find_this) {
     332        int index_of(QBLevel<T> findThis) {
    333333            QBLevel<T>[] children = getChildren();
    334334            for (int i = 0; i < QuadTiling.TILES_PER_LEVEL; i++) {
    335                 if (children[i] == find_this)
     335                if (children[i] == findThis)
    336336                    return i;
    337337            }
  • trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java

    r9790 r10001  
    9696    @Override
    9797    public LatLon eastNorth2latlon(EastNorth en) {
    98         double[] latlon_rad = proj.invproject((en.east() * toMeter - x0) / ellps.a / k0, (en.north() * toMeter - y0) / ellps.a / k0);
    99         LatLon ll = new LatLon(Math.toDegrees(latlon_rad[0]), LatLon.normalizeLon(Math.toDegrees(latlon_rad[1]) + lon0 + pm));
     98        double[] latlonRad = proj.invproject((en.east() * toMeter - x0) / ellps.a / k0, (en.north() * toMeter - y0) / ellps.a / k0);
     99        LatLon ll = new LatLon(Math.toDegrees(latlonRad[0]), LatLon.normalizeLon(Math.toDegrees(latlonRad[1]) + lon0 + pm));
    100100        return datum.toWGS84(ll);
    101101    }
  • 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
  • trunk/src/org/openstreetmap/josm/data/projection/Ellipsoid.java

    r9565 r10001  
    353353        double lambda = Math.toRadians(coord.lon());
    354354
    355         double Rn = a / Math.sqrt(1 - e2 * Math.pow(Math.sin(phi), 2));
     355        double rn = a / Math.sqrt(1 - e2 * Math.pow(Math.sin(phi), 2));
    356356        double[] xyz = new double[3];
    357         xyz[0] = Rn * Math.cos(phi) * Math.cos(lambda);
    358         xyz[1] = Rn * Math.cos(phi) * Math.sin(lambda);
    359         xyz[2] = Rn * (1 - e2) * Math.sin(phi);
     357        xyz[0] = rn * Math.cos(phi) * Math.cos(lambda);
     358        xyz[1] = rn * Math.cos(phi) * Math.sin(lambda);
     359        xyz[2] = rn * (1 - e2) * Math.sin(phi);
    360360
    361361        return xyz;
  • trunk/src/org/openstreetmap/josm/data/projection/proj/AlbersEqualArea.java

    r9998 r10001  
    167167     */
    168168    public double phi1(final double qs) {
    169         final double tone_es = 1 - e2;
     169        final double toneEs = 1 - e2;
    170170        double phi = Math.asin(0.5 * qs);
    171171        if (e < EPSILON) {
     
    178178            final double com   = 1.0 - con*con;
    179179            final double dphi  = 0.5 * com*com / cospi *
    180                     (qs/tone_es - sinpi / com + 0.5/e * Math.log((1. - con) / (1. + con)));
     180                    (qs/toneEs - sinpi / com + 0.5/e * Math.log((1. - con) / (1. + con)));
    181181            phi += dphi;
    182182            if (Math.abs(dphi) <= ITERATION_TOLERANCE) {
     
    194194     */
    195195    private double qsfn(final double sinphi) {
    196         final double one_es = 1 - e2;
     196        final double oneEs = 1 - e2;
    197197        if (e >= EPSILON) {
    198198            final double con = e * sinphi;
    199             return one_es * (sinphi / (1. - con*con) -
     199            return oneEs * (sinphi / (1. - con*con) -
    200200                    (0.5/e) * Math.log((1.-con) / (1.+con)));
    201201        } else {
  • trunk/src/org/openstreetmap/josm/data/projection/proj/DoubleStereographic.java

    r9974 r10001  
    5858    }
    5959
    60     private void initialize(double lat_0) {
    61         double phi0 = toRadians(lat_0);
     60    private void initialize(double lat0) {
     61        double phi0 = toRadians(lat0);
    6262        double e2 = ellps.e2;
    6363        r = sqrt(1-e2) / (1 - e2*pow(sin(phi0), 2));
    6464        n = sqrt(1 + ellps.eb2 * pow(cos(phi0), 4));
    65         double S1 = (1 + sin(phi0)) / (1 - sin(phi0));
    66         double S2 = (1 - e * sin(phi0)) / (1 + e * sin(phi0));
    67         double w1 = pow(S1 * pow(S2, e), n);
     65        double s1 = (1 + sin(phi0)) / (1 - sin(phi0));
     66        double s2 = (1 - e * sin(phi0)) / (1 + e * sin(phi0));
     67        double w1 = pow(s1 * pow(s2, e), n);
    6868        double sinchi00 = (w1 - 1) / (w1 + 1);
    6969        c = (n + sin(phi0)) * (1 - sinchi00) / ((n - sin(phi0)) * (1 + sinchi00));
     
    7474    @Override
    7575    public double[] project(double phi, double lambda) {
    76         double Lambda = n * lambda;
    77         double Sa = (1 + sin(phi)) / (1 - sin(phi));
    78         double Sb = (1 - e * sin(phi)) / (1 + e * sin(phi));
    79         double w = c * pow(Sa * pow(Sb, e), n);
     76        double nLambda = n * lambda;
     77        double sa = (1 + sin(phi)) / (1 - sin(phi));
     78        double sb = (1 - e * sin(phi)) / (1 + e * sin(phi));
     79        double w = c * pow(sa * pow(sb, e), n);
    8080        double chi = asin((w - 1) / (w + 1));
    81         double B = 1 + sin(chi) * sin(chi0) + cos(chi) * cos(chi0) * cos(Lambda);
    82         double x = 2 * r * cos(chi) * sin(Lambda) / B;
    83         double y = 2 * r * (sin(chi) * cos(chi0) - cos(chi) * sin(chi0) * cos(Lambda)) / B;
     81        double b = 1 + sin(chi) * sin(chi0) + cos(chi) * cos(chi0) * cos(nLambda);
     82        double x = 2 * r * cos(chi) * sin(nLambda) / b;
     83        double y = 2 * r * (sin(chi) * cos(chi0) - cos(chi) * sin(chi0) * cos(nLambda)) / b;
    8484        return new double[] {x, y};
    8585    }
     
    9393        double j = atan(x/(g - y)) - i;
    9494        double chi = chi0 + 2 * atan((y - x * tan(j/2)) / (2 * r));
    95         double Lambda = j + 2*i;
    96         double lambda = Lambda / n;
     95        double lambda = (j + 2*i) / n;
    9796        double psi = 0.5 * log((1 + sin(chi)) / (c*(1 - sin(chi)))) / n;
    9897        double phiprev = -1000;
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java

    r9600 r10001  
    9191     * Initialize for LCC with 2 standard parallels.
    9292     *
    93      * @param lat_0 latitude of false origin (in degrees)
    94      * @param lat_1 latitude of first standard parallel (in degrees)
    95      * @param lat_2 latitude of second standard parallel (in degrees)
     93     * @param lat0 latitude of false origin (in degrees)
     94     * @param lat1 latitude of first standard parallel (in degrees)
     95     * @param lat2 latitude of second standard parallel (in degrees)
    9696     */
    97     private void initialize2SP(double lat_0, double lat_1, double lat_2) {
    98         this.params = new Parameters2SP(lat_0, lat_1, lat_2);
     97    private void initialize2SP(double lat0, double lat1, double lat2) {
     98        this.params = new Parameters2SP(lat0, lat1, lat2);
    9999
    100         final double m1 = m(toRadians(lat_1));
    101         final double m2 = m(toRadians(lat_2));
     100        final double m1 = m(toRadians(lat1));
     101        final double m2 = m(toRadians(lat2));
    102102
    103         final double t1 = t(toRadians(lat_1));
    104         final double t2 = t(toRadians(lat_2));
    105         final double tf = t(toRadians(lat_0));
     103        final double t1 = t(toRadians(lat1));
     104        final double t2 = t(toRadians(lat2));
     105        final double tf = t(toRadians(lat0));
    106106
    107107        n  = (log(m1) - log(m2)) / (log(t1) - log(t2));
     
    113113     * Initialize for LCC with 1 standard parallel.
    114114     *
    115      * @param lat_0 latitude of natural origin (in degrees)
     115     * @param lat0 latitude of natural origin (in degrees)
    116116     */
    117     private void initialize1SP(double lat_0) {
    118         this.params = new Parameters1SP(lat_0);
    119         final double lat_0_rad = toRadians(lat_0);
     117    private void initialize1SP(double lat0) {
     118        this.params = new Parameters1SP(lat0);
     119        final double lat0rad = toRadians(lat0);
    120120
    121         final double m0 = m(lat_0_rad);
    122         final double t0 = t(lat_0_rad);
     121        final double m0 = m(lat0rad);
     122        final double t0 = t(lat0rad);
    123123
    124         n = sin(lat_0_rad);
     124        n = sin(lat0rad);
    125125        f  = m0 / (n * pow(t0, n));
    126126        r0 = f * pow(t0, n);
     
    129129    /**
    130130     * auxiliary function t
    131      * @param lat_rad latitude in radians
     131     * @param latRad latitude in radians
    132132     * @return result
    133133     */
    134     protected double t(double lat_rad) {
    135         return tan(PI/4 - lat_rad / 2.0)
    136             / pow((1.0 - e * sin(lat_rad)) / (1.0 + e * sin(lat_rad)), e/2);
     134    protected double t(double latRad) {
     135        return tan(PI/4 - latRad / 2.0)
     136            / pow((1.0 - e * sin(latRad)) / (1.0 + e * sin(latRad)), e/2);
    137137    }
    138138
    139139    /**
    140140     * auxiliary function m
    141      * @param lat_rad latitude in radians
     141     * @param latRad latitude in radians
    142142     * @return result
    143143     */
    144     protected double m(double lat_rad) {
    145         return cos(lat_rad) / (sqrt(1 - e * e * pow(sin(lat_rad), 2)));
     144    protected double m(double latRad) {
     145        return cos(latRad) / (sqrt(1 - e * e * pow(sin(latRad), 2)));
    146146    }
    147147
  • trunk/src/org/openstreetmap/josm/data/projection/proj/LonLat.java

    r9628 r10001  
    3030
    3131    @Override
    32     public double[] project(double lat_rad, double lon_rad) {
    33         return new double[] {Math.toDegrees(lon_rad) / a, Math.toDegrees(lat_rad) / a};
     32    public double[] project(double latRad, double lonRad) {
     33        return new double[] {Math.toDegrees(lonRad) / a, Math.toDegrees(latRad) / a};
    3434    }
    3535
  • trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java

    r10000 r10001  
    379379            double temp = 1.0 / q;
    380380            double s = 0.5 * (q - temp);
    381             double V = Math.sin(b * x);
    382             double U = (s * singamma0 - V * cosgamma0) / (0.5 * (q + temp));
    383             if (Math.abs(Math.abs(U) - 1.0) < EPSILON) {
     381            double v2 = Math.sin(b * x);
     382            double u2 = (s * singamma0 - v2 * cosgamma0) / (0.5 * (q + temp));
     383            if (Math.abs(Math.abs(u2) - 1.0) < EPSILON) {
    384384                v = 0; // this is actually an error and should be reported to the caller somehow
    385385            } else {
    386                 v = 0.5 * arb * Math.log((1.0 - U) / (1.0 + U));
     386                v = 0.5 * arb * Math.log((1.0 - u2) / (1.0 + u2));
    387387            }
    388388            temp = Math.cos(b * x);
     
    390390                u = ab * x;
    391391            } else {
    392                 u = arb * Math.atan2(s * cosgamma0 + V * singamma0, temp);
     392                u = arb * Math.atan2(s * cosgamma0 + v2 * singamma0, temp);
    393393            }
    394394        } else {
  • trunk/src/org/openstreetmap/josm/data/projection/proj/PolarStereographic.java

    r9998 r10001  
    171171    @Override
    172172    public Bounds getAlgorithmBounds() {
    173         final double CUT = 60;
     173        final double cut = 60;
    174174        if (southPole) {
    175             return new Bounds(-90, -180, CUT, 180, false);
     175            return new Bounds(-90, -180, cut, 180, false);
    176176        } else {
    177             return new Bounds(-CUT, -180, 90, 180, false);
     177            return new Bounds(-cut, -180, 90, 180, false);
    178178        }
    179179    }
  • trunk/src/org/openstreetmap/josm/data/projection/proj/Proj.java

    r9628 r10001  
    5050     * Convert lat/lon to east/north.
    5151     *
    52      * @param lat_rad the latitude in radians
    53      * @param lon_rad the longitude in radians
     52     * @param latRad the latitude in radians
     53     * @param lonRad the longitude in radians
    5454     * @return array of length 2, containing east and north value in meters,
    5555     * divided by the semi major axis of the ellipsoid.
    5656     */
    57     double[] project(double lat_rad, double lon_rad);
     57    double[] project(double latRad, double lonRad);
    5858
    5959    /**
  • trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java

    r9628 r10001  
    5656    }
    5757
    58     private void initialize(double lat_0) {
    59         phi0 = toRadians(lat_0);
     58    private void initialize(double lat0) {
     59        phi0 = toRadians(lat0);
    6060        kR = sqrt(1 - ellps.e2) / (1 - (ellps.e2 * pow(sin(phi0), 2)));
    6161        alpha = sqrt(1 + (ellps.eb2 * pow(cos(phi0), 4)));
     
    7878    @Override
    7979    public double[] project(double phi, double lambda) {
    80         double S = alpha * log(tan(PI / 4 + phi / 2)) - alpha * ellps.e / 2
     80        double s = alpha * log(tan(PI / 4 + phi / 2)) - alpha * ellps.e / 2
    8181            * log((1 + ellps.e * sin(phi)) / (1 - ellps.e * sin(phi))) + k;
    82         double b = 2 * (atan(exp(S)) - PI / 4);
     82        double b = 2 * (atan(exp(s)) - PI / 4);
    8383        double l = alpha * lambda;
    8484
  • trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java

    r9070 r10001  
    119119        int i; // iterates through s
    120120        int j; // iterates through t
    121         char s_i; // ith character of s
    122         char t_j; // jth character of t
     121        char si; // ith character of s
     122        char tj; // jth character of t
    123123        int cost; // cost
    124124
     
    143143        for (i = 1; i <= n; i++) {
    144144
    145             s_i = s.charAt(i - 1);
     145            si = s.charAt(i - 1);
    146146
    147147            // Step 4
    148148            for (j = 1; j <= m; j++) {
    149149
    150                 t_j = t.charAt(j - 1);
     150                tj = t.charAt(j - 1);
    151151
    152152                // Step 5
    153                 if (s_i == t_j) {
     153                if (si == tj) {
    154154                    cost = 0;
    155155                } else {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java

    r8836 r10001  
    389389            nearbyNodeCache = null;
    390390            List<LatLon> bounds = this.getBounds(dist);
    391             List<Node> found_nodes = endnodesHighway.search(new BBox(bounds.get(0), bounds.get(1)));
    392             found_nodes.addAll(endnodes.search(new BBox(bounds.get(0), bounds.get(1))));
    393 
    394             for (Node n : found_nodes) {
     391            List<Node> foundNodes = endnodesHighway.search(new BBox(bounds.get(0), bounds.get(1)));
     392            foundNodes.addAll(endnodes.search(new BBox(bounds.get(0), bounds.get(1))));
     393
     394            for (Node n : foundNodes) {
    395395                if (!nearby(n, dist) || !n.getCoor().isIn(dsArea)) {
    396396                    continue;
Note: See TracChangeset for help on using the changeset viewer.