Changeset 10001 in josm


Ignore:
Timestamp:
2016-03-17T01:50:12+01:00 (8 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
Files:
59 edited

Legend:

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

    r9989 r10001  
    13451345                panel.add(ho, gbc);
    13461346                panel.add(link, gbc);
    1347                 final String EXIT = tr("Exit JOSM");
    1348                 final String CONTINUE = tr("Continue, try anyway");
     1347                final String exitStr = tr("Exit JOSM");
     1348                final String continueStr = tr("Continue, try anyway");
    13491349                int ret = JOptionPane.showOptionDialog(null, panel, tr("Error"), JOptionPane.YES_NO_OPTION,
    1350                         JOptionPane.ERROR_MESSAGE, null, new String[] {EXIT, CONTINUE}, EXIT);
     1350                        JOptionPane.ERROR_MESSAGE, null, new String[] {exitStr, continueStr}, exitStr);
    13511351                if (ret == 0) {
    13521352                    System.exit(0);
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r9623 r10001  
    267267        /**
    268268         * Returns oriented angle (N1N2, N1N3) in range [0; 2*Math.PI[
    269          * @param N1 first node
    270          * @param N2 second node
    271          * @param N3 third node
     269         * @param n1 first node
     270         * @param n2 second node
     271         * @param n3 third node
    272272         * @return oriented angle (N1N2, N1N3) in range [0; 2*Math.PI[
    273273         */
    274         private static double getAngle(Node N1, Node N2, Node N3) {
    275             EastNorth en1 = N1.getEastNorth();
    276             EastNorth en2 = N2.getEastNorth();
    277             EastNorth en3 = N3.getEastNorth();
     274        private static double getAngle(Node n1, Node n2, Node n3) {
     275            EastNorth en1 = n1.getEastNorth();
     276            EastNorth en2 = n2.getEastNorth();
     277            EastNorth en3 = n3.getEastNorth();
    278278            double angle = Math.atan2(en3.getY() - en1.getY(), en3.getX() - en1.getX()) -
    279279                    Math.atan2(en2.getY() - en1.getY(), en2.getX() - en1.getX());
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r9999 r10001  
    328328
    329329        // orthogonalize
    330         final Direction[] HORIZONTAL = {Direction.RIGHT, Direction.LEFT};
    331         final Direction[] VERTICAL = {Direction.UP, Direction.DOWN};
    332         final Direction[][] ORIENTATIONS = {HORIZONTAL, VERTICAL};
    333         for (Direction[] orientation : ORIENTATIONS) {
     330        final Direction[] horizontal = {Direction.RIGHT, Direction.LEFT};
     331        final Direction[] vertical = {Direction.UP, Direction.DOWN};
     332        final Direction[][] orientations = {horizontal, vertical};
     333        for (Direction[] orientation : orientations) {
    334334            final Set<Node> s = new HashSet<>(allNodes);
    335             int s_size = s.size();
    336             for (int dummy = 0; dummy < s_size; ++dummy) {
     335            int size = s.size();
     336            for (int dummy = 0; dummy < size; ++dummy) {
    337337                if (s.isEmpty()) {
    338338                    break;
    339339                }
    340                 final Node dummy_n = s.iterator().next();     // pick arbitrary element of s
    341 
    342                 final Set<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummy_n
    343                 cs.add(dummy_n);                      // walking only on horizontal / vertical segments
     340                final Node dummyN = s.iterator().next();     // pick arbitrary element of s
     341
     342                final Set<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummyN
     343                cs.add(dummyN);                      // walking only on horizontal / vertical segments
    344344
    345345                boolean somethingHappened = true;
     
    364364                }
    365365
    366                 final Map<Node, Double> nC = (orientation == HORIZONTAL) ? nY : nX;
     366                final Map<Node, Double> nC = (orientation == horizontal) ? nY : nX;
    367367
    368368                double average = 0;
     
    385385                // both heading nodes collapsing to one point, we simply skip this segment string and
    386386                // don't touch the node coordinates.
    387                 if (orientation == VERTICAL && headingNodes.size() == 2 && cs.containsAll(headingNodes)) {
     387                if (orientation == vertical && headingNodes.size() == 2 && cs.containsAll(headingNodes)) {
    388388                    continue;
    389389                }
     
    404404            final double dy = tmp.north() - n.getEastNorth().north();
    405405            if (headingNodes.contains(n)) { // The heading nodes should not have changed
    406                 final double EPSILON = 1E-6;
    407                 if (Math.abs(dx) > Math.abs(EPSILON * tmp.east()) ||
    408                         Math.abs(dy) > Math.abs(EPSILON * tmp.east()))
     406                final double epsilon = 1E-6;
     407                if (Math.abs(dx) > Math.abs(epsilon * tmp.east()) ||
     408                        Math.abs(dy) > Math.abs(epsilon * tmp.east()))
    409409                    throw new AssertionError();
    410410            } else {
     
    572572    private static int angleToDirectionChange(double a, double deltaMax) throws RejectedAngleException {
    573573        a = standard_angle_mPI_to_PI(a);
    574         double d0    = Math.abs(a);
    575         double d90   = Math.abs(a - Math.PI / 2);
    576         double d_m90 = Math.abs(a + Math.PI / 2);
     574        double d0   = Math.abs(a);
     575        double d90  = Math.abs(a - Math.PI / 2);
     576        double dm90 = Math.abs(a + Math.PI / 2);
    577577        int dirChange;
    578578        if (d0 < deltaMax) {
     
    580580        } else if (d90 < deltaMax) {
    581581            dirChange =  1;
    582         } else if (d_m90 < deltaMax) {
     582        } else if (dm90 < deltaMax) {
    583583            dirChange = -1;
    584584        } else {
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r9999 r10001  
    605605            }
    606606
    607             int i_c = 0, i_r = 0;
     607            int ic = 0;
     608            int ir = 0;
    608609            List<RelationMember> relationMembers = r.getMembers();
    609610            for (RelationMember rm: relationMembers) {
     
    666667                        Boolean backwards = null;
    667668                        int k = 1;
    668                         while (i_r - k >= 0 || i_r + k < relationMembers.size()) {
    669                             if ((i_r - k >= 0) && relationMembers.get(i_r - k).isWay()) {
    670                                 Way w = relationMembers.get(i_r - k).getWay();
     669                        while (ir - k >= 0 || ir + k < relationMembers.size()) {
     670                            if ((ir - k >= 0) && relationMembers.get(ir - k).isWay()) {
     671                                Way w = relationMembers.get(ir - k).getWay();
    671672                                if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) {
    672673                                    backwards = Boolean.FALSE;
     
    676677                                break;
    677678                            }
    678                             if ((i_r + k < relationMembers.size()) && relationMembers.get(i_r + k).isWay()) {
    679                                 Way w = relationMembers.get(i_r + k).getWay();
     679                            if ((ir + k < relationMembers.size()) && relationMembers.get(ir + k).isWay()) {
     680                                Way w = relationMembers.get(ir + k).getWay();
    680681                                if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) {
    681682                                    backwards = Boolean.TRUE;
     
    688689                        }
    689690
    690                         int j = i_c;
     691                        int j = ic;
    691692                        final List<Way> waysToAddBefore = newWays.subList(0, indexOfWayToKeep);
    692693                        for (Way wayToAdd : waysToAddBefore) {
     
    694695                            j++;
    695696                            if (Boolean.TRUE.equals(backwards)) {
    696                                 c.addMember(i_c + 1, em);
     697                                c.addMember(ic + 1, em);
    697698                            } else {
    698699                                c.addMember(j - 1, em);
     
    704705                            j++;
    705706                            if (Boolean.TRUE.equals(backwards)) {
    706                                 c.addMember(i_c, em);
     707                                c.addMember(ic, em);
    707708                            } else {
    708709                                c.addMember(j, em);
    709710                            }
    710711                        }
    711                         i_c = j;
     712                        ic = j;
    712713                    }
    713714                }
    714                 i_c++;
    715                 i_r++;
     715                ic++;
     716                ir++;
    716717            }
    717718
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeCompressedTask.java

    r9665 r10001  
    3030    /**
    3131     * Loads a given URL
    32      * @param new_layer {@code true} if the data should be saved to a new layer
     32     * @param newLayer {@code true} if the data should be saved to a new layer
    3333     * @param url The URL as String
    3434     * @param progressMonitor progress monitor for user interaction
    3535     */
    3636    @Override
    37     public Future<?> loadUrl(boolean new_layer, final String url, ProgressMonitor progressMonitor) {
    38         downloadTask = new DownloadTask(new_layer, new OsmServerLocationReader(url), progressMonitor) {
     37    public Future<?> loadUrl(boolean newLayer, final String url, ProgressMonitor progressMonitor) {
     38        downloadTask = new DownloadTask(newLayer, new OsmServerLocationReader(url), progressMonitor) {
    3939            @Override
    4040            protected DataSet parseDataSet() throws OsmTransferException {
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java

    r9989 r10001  
    6868
    6969    @Override
    70     public Future<?> loadUrl(boolean new_layer, String url, ProgressMonitor progressMonitor) {
     70    public Future<?> loadUrl(boolean newLayer, String url, ProgressMonitor progressMonitor) {
    7171        final Matcher matcher = Pattern.compile(OSM_WEBSITE_PATTERN).matcher(url);
    7272        if (matcher.matches()) {
    7373            url = OsmApi.getOsmApi().getBaseUrl() + "changeset/" + Long.parseLong(matcher.group(2)) + "/download";
    7474        }
    75         downloadTask = new DownloadTask(new_layer, new OsmServerLocationReader(url), progressMonitor);
     75        downloadTask = new DownloadTask(newLayer, new OsmServerLocationReader(url), progressMonitor);
    7676        // Extract .osc filename from URL to set the new layer name
    7777        extractOsmFilename("https?://.*/(.*\\.osc)", url);
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmCompressedTask.java

    r8285 r10001  
    3939    /**
    4040     * Loads a given URL
    41      * @param new_layer {@code true} if the data should be saved to a new layer
     41     * @param newLayer {@code true} if the data should be saved to a new layer
    4242     * @param url The URL as String
    4343     * @param progressMonitor progress monitor for user interaction
    4444     */
    4545    @Override
    46     public Future<?> loadUrl(boolean new_layer, final String url, ProgressMonitor progressMonitor) {
    47         downloadTask = new DownloadTask(new_layer, new OsmServerLocationReader(url), progressMonitor) {
     46    public Future<?> loadUrl(boolean newLayer, final String url, ProgressMonitor progressMonitor) {
     47        downloadTask = new DownloadTask(newLayer, new OsmServerLocationReader(url), progressMonitor) {
    4848            @Override
    4949            protected DataSet parseDataSet() throws OsmTransferException {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r9968 r10001  
    999999            Iterator<Pair<Node, Node>> i = segs.iterator();
    10001000            Pair<Node, Node> seg = i.next();
    1001             EastNorth A = seg.a.getEastNorth();
    1002             EastNorth B = seg.b.getEastNorth();
     1001            EastNorth pA = seg.a.getEastNorth();
     1002            EastNorth pB = seg.b.getEastNorth();
    10031003            seg = i.next();
    1004             EastNorth C = seg.a.getEastNorth();
    1005             EastNorth D = seg.b.getEastNorth();
    1006 
    1007             double u = det(B.east() - A.east(), B.north() - A.north(), C.east() - D.east(), C.north() - D.north());
     1004            EastNorth pC = seg.a.getEastNorth();
     1005            EastNorth pD = seg.b.getEastNorth();
     1006
     1007            double u = det(pB.east() - pA.east(), pB.north() - pA.north(), pC.east() - pD.east(), pC.north() - pD.north());
    10081008
    10091009            // Check for parallel segments and do nothing if they are
     
    10171017            // if the segment is scaled to lenght 1
    10181018
    1019             double q = det(B.north() - C.north(), B.east() - C.east(), D.north() - C.north(), D.east() - C.east()) / u;
     1019            double q = det(pB.north() - pC.north(), pB.east() - pC.east(), pD.north() - pC.north(), pD.east() - pC.east()) / u;
    10201020            EastNorth intersection = new EastNorth(
    1021                     B.east() + q * (A.east() - B.east()),
    1022                     B.north() + q * (A.north() - B.north()));
     1021                    pB.east() + q * (pA.east() - pB.east()),
     1022                    pB.north() + q * (pA.north() - pB.north()));
    10231023
    10241024
     
    10311031            }
    10321032        default:
    1033             EastNorth P = n.getEastNorth();
     1033            EastNorth p = n.getEastNorth();
    10341034            seg = segs.iterator().next();
    1035             A = seg.a.getEastNorth();
    1036             B = seg.b.getEastNorth();
    1037             double a = P.distanceSq(B);
    1038             double b = P.distanceSq(A);
    1039             double c = A.distanceSq(B);
     1035            pA = seg.a.getEastNorth();
     1036            pB = seg.b.getEastNorth();
     1037            double a = p.distanceSq(pB);
     1038            double b = p.distanceSq(pA);
     1039            double c = pA.distanceSq(pB);
    10401040            q = (a - b + c) / (2*c);
    1041             n.setEastNorth(new EastNorth(B.east() + q * (A.east() - B.east()), B.north() + q * (A.north() - B.north())));
     1041            n.setEastNorth(new EastNorth(pB.east() + q * (pA.east() - pB.east()), pB.north() + q * (pA.north() - pB.north())));
    10421042        }
    10431043    }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r9989 r10001  
    573573        if (ws != null) {
    574574            Node n = new Node(Main.map.mapView.getLatLon(e.getX(), e.getY()));
    575             EastNorth A = ws.getFirstNode().getEastNorth();
    576             EastNorth B = ws.getSecondNode().getEastNorth();
    577             n.setEastNorth(Geometry.closestPointToSegment(A, B, n.getEastNorth()));
     575            EastNorth a = ws.getFirstNode().getEastNorth();
     576            EastNorth b = ws.getSecondNode().getEastNorth();
     577            n.setEastNorth(Geometry.closestPointToSegment(a, b, n.getEastNorth()));
    578578            Way wnew = new Way(ws.way);
    579579            wnew.addNode(ws.lowerIndex+1, n);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java

    r8513 r10001  
    143143        EastNorth prevB = pts[1].add(normals[0].scale(d));
    144144        for (int i = 1; i < nodeCount - 1; i++) {
    145             EastNorth A = pts[i].add(normals[i].scale(d));
    146             EastNorth B = pts[i + 1].add(normals[i].scale(d));
    147             if (Geometry.segmentsParallel(A, B, prevA, prevB)) {
    148                 ppts[i] = A;
     145            EastNorth a = pts[i].add(normals[i].scale(d));
     146            EastNorth b = pts[i + 1].add(normals[i].scale(d));
     147            if (Geometry.segmentsParallel(a, b, prevA, prevB)) {
     148                ppts[i] = a;
    149149            } else {
    150                 ppts[i] = Geometry.getLineLineIntersection(A, B, prevA, prevB);
    151             }
    152             prevA = A;
    153             prevB = B;
     150                ppts[i] = Geometry.getLineLineIntersection(a, b, prevA, prevB);
     151            }
     152            prevA = a;
     153            prevB = b;
    154154        }
    155155        if (isClosedPath()) {
    156             EastNorth A = pts[0].add(normals[0].scale(d));
    157             EastNorth B = pts[1].add(normals[0].scale(d));
    158             if (Geometry.segmentsParallel(A, B, prevA, prevB)) {
    159                 ppts[0] = A;
     156            EastNorth a = pts[0].add(normals[0].scale(d));
     157            EastNorth b = pts[1].add(normals[0].scale(d));
     158            if (Geometry.segmentsParallel(a, b, prevA, prevB)) {
     159                ppts[0] = a;
    160160            } else {
    161                 ppts[0] = Geometry.getLineLineIntersection(A, B, prevA, prevB);
     161                ppts[0] = Geometry.getLineLineIntersection(a, b, prevA, prevB);
    162162            }
    163163            ppts[nodeCount - 1] = ppts[0];
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r9989 r10001  
    260260        JRadioButton add = new JRadioButton(tr("add to selection"), initialValues.mode == SearchMode.add);
    261261        JRadioButton remove = new JRadioButton(tr("remove from selection"), initialValues.mode == SearchMode.remove);
    262         JRadioButton in_selection = new JRadioButton(tr("find in selection"), initialValues.mode == SearchMode.in_selection);
     262        JRadioButton inSelection = new JRadioButton(tr("find in selection"), initialValues.mode == SearchMode.in_selection);
    263263        ButtonGroup bg = new ButtonGroup();
    264264        bg.add(replace);
    265265        bg.add(add);
    266266        bg.add(remove);
    267         bg.add(in_selection);
     267        bg.add(inSelection);
    268268
    269269        final JCheckBox caseSensitive = new JCheckBox(tr("case sensitive"), initialValues.caseSensitive);
     
    286286        left.add(add, GBC.eol());
    287287        left.add(remove, GBC.eol());
    288         left.add(in_selection, GBC.eop());
     288        left.add(inSelection, GBC.eop());
    289289        left.add(caseSensitive, GBC.eol());
    290290        if (Main.pref.getBoolean("expert", false)) {
  • 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;
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r10000 r10001  
    418418            name = tr("relation");
    419419        }
    420         String admin_level = relation.get("admin_level");
    421         if (admin_level != null) {
    422             name += '['+admin_level+']';
     420        String adminLevel = relation.get("admin_level");
     421        if (adminLevel != null) {
     422            name += '['+adminLevel+']';
    423423        }
    424424
  • trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java

    r9983 r10001  
    320320
    321321        for (int i = 0; i < bTexts.length; i++) {
    322             final int final_i = i;
     322            final int finalI = i;
    323323            Action action = new AbstractAction(bTexts[i]) {
    324324                @Override
    325325                public void actionPerformed(ActionEvent evt) {
    326                     buttonAction(final_i, evt);
     326                    buttonAction(finalI, evt);
    327327                }
    328328            };
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r9976 r10001  
    553553        LatLon ll2 = getLatLon(width / 2 + 50, height / 2);
    554554        if (ll1.isValid() && ll2.isValid() && b.contains(ll1) && b.contains(ll2)) {
    555             double d_m = ll1.greatCircleDistance(ll2);
    556             double d_en = 100 * scale;
    557             double scaleMin = 0.01 * d_en / d_m / 100;
     555            double dm = ll1.greatCircleDistance(ll2);
     556            double den = 100 * scale;
     557            double scaleMin = 0.01 * den / dm / 100;
    558558            if (!Double.isInfinite(scaleMin) && newScale < scaleMin) {
    559559                newScale = scaleMin;
     
    10261026                    }
    10271027
    1028                     Point2D A = getPoint2D(lastN);
    1029                     Point2D B = getPoint2D(n);
    1030                     double c = A.distanceSq(B);
    1031                     double a = p.distanceSq(B);
    1032                     double b = p.distanceSq(A);
     1028                    Point2D pA = getPoint2D(lastN);
     1029                    Point2D pB = getPoint2D(n);
     1030                    double c = pA.distanceSq(pB);
     1031                    double a = p.distanceSq(pB);
     1032                    double b = p.distanceSq(pA);
    10331033
    10341034                    /* perpendicular distance squared
     
    11421142     * @param p the point for which to search the nearest segment.
    11431143     * @param predicate the returned object has to fulfill certain properties.
    1144      * @param use_selected whether selected way segments should be preferred.
     1144     * @param useSelected whether selected way segments should be preferred.
    11451145     * @param preferredRefs - prefer segments related to these primitives, may be null
    11461146     *
     
    11531153     */
    11541154    public final WaySegment getNearestWaySegment(Point p, Predicate<OsmPrimitive> predicate,
    1155             boolean use_selected,  Collection<OsmPrimitive> preferredRefs) {
     1155            boolean useSelected,  Collection<OsmPrimitive> preferredRefs) {
    11561156        WaySegment wayseg = null, ntsel = null, ntref = null;
    11571157        if (preferredRefs != null && preferredRefs.isEmpty()) preferredRefs = null;
     
    11851185            }
    11861186        }
    1187         if (ntsel != null && use_selected)
     1187        if (ntsel != null && useSelected)
    11881188            return ntsel;
    11891189        if (ntref != null)
     
    13521352     * @param p The point on screen.
    13531353     * @param predicate the returned object has to fulfill certain properties.
    1354      * @param use_selected whether to prefer primitives that are currently selected or referred by selected primitives
     1354     * @param useSelected whether to prefer primitives that are currently selected or referred by selected primitives
    13551355     *
    13561356     * @return A primitive within snap-distance to point p,
     
    13591359     * @see #getNearestWay(Point, Predicate)
    13601360     */
    1361     public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean use_selected) {
     1361    public final OsmPrimitive getNearestNodeOrWay(Point p, Predicate<OsmPrimitive> predicate, boolean useSelected) {
    13621362        Collection<OsmPrimitive> sel;
    13631363        DataSet ds = getCurrentDataSet();
    1364         if (use_selected && ds != null) {
     1364        if (useSelected && ds != null) {
    13651365            sel = ds.getSelected();
    13661366        } else {
    13671367            sel = null;
    13681368        }
    1369         OsmPrimitive osm = getNearestNode(p, predicate, use_selected, sel);
    1370 
    1371         if (isPrecedenceNode((Node) osm, p, use_selected)) return osm;
     1369        OsmPrimitive osm = getNearestNode(p, predicate, useSelected, sel);
     1370
     1371        if (isPrecedenceNode((Node) osm, p, useSelected)) return osm;
    13721372        WaySegment ws;
    1373         if (use_selected) {
    1374             ws = getNearestWaySegment(p, predicate, use_selected, sel);
     1373        if (useSelected) {
     1374            ws = getNearestWaySegment(p, predicate, useSelected, sel);
    13751375        } else {
    1376             ws = getNearestWaySegment(p, predicate, use_selected);
     1376            ws = getNearestWaySegment(p, predicate, useSelected);
    13771377        }
    13781378        if (ws == null) return osm;
    13791379
    1380         if ((ws.way.isSelected() && use_selected) || osm == null) {
     1380        if ((ws.way.isSelected() && useSelected) || osm == null) {
    13811381            // either (no _selected_ nearest node found, if desired) or no nearest node was found
    13821382            osm = ws.way;
  • trunk/src/org/openstreetmap/josm/gui/NotificationManager.java

    r9078 r10001  
    108108        currentNotificationPanel.validate();
    109109
    110         int MARGIN = 5;
     110        int margin = 5;
    111111        int x, y;
    112112        JFrame parentWindow = (JFrame) Main.parent;
     
    115115            MapView mv = Main.map.mapView;
    116116            Point mapViewPos = SwingUtilities.convertPoint(mv.getParent(), mv.getX(), mv.getY(), Main.parent);
    117             x = mapViewPos.x + MARGIN;
    118             y = mapViewPos.y + mv.getHeight() - Main.map.statusLine.getHeight() - size.height - MARGIN;
     117            x = mapViewPos.x + margin;
     118            y = mapViewPos.y + mv.getHeight() - Main.map.statusLine.getHeight() - size.height - margin;
    119119        } else {
    120             x = MARGIN;
    121             y = parentWindow.getHeight() - Main.toolbar.control.getSize().height - size.height - MARGIN;
     120            x = margin;
     121            y = parentWindow.getHeight() - Main.toolbar.control.getSize().height - size.height - margin;
    122122        }
    123123        parentWindow.getLayeredPane().add(currentNotificationPanel, JLayeredPane.POPUP_LAYER, 0);
  • trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java

    r9983 r10001  
    240240            return;
    241241
    242         Point p_max = new Point(Math.max(aEnd.x, aStart.x), Math.max(aEnd.y, aStart.y));
    243         Point p_min = new Point(Math.min(aEnd.x, aStart.x), Math.min(aEnd.y, aStart.y));
    244 
    245         iSelectionRectStart = getPosition(p_min);
    246         iSelectionRectEnd =   getPosition(p_max);
     242        Point pMax = new Point(Math.max(aEnd.x, aStart.x), Math.max(aEnd.y, aStart.y));
     243        Point pMin = new Point(Math.min(aEnd.x, aStart.x), Math.min(aEnd.y, aStart.y));
     244
     245        iSelectionRectStart = getPosition(pMin);
     246        iSelectionRectEnd =   getPosition(pMax);
    247247
    248248        Bounds b = new Bounds(
  • trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java

    r9078 r10001  
    154154
    155155        // calc the screen coordinates for the new selection rectangle
    156         MapMarkerDot xmin_ymin = new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon());
    157         MapMarkerDot xmax_ymax = new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon());
    158 
    159156        List<MapMarker> marker = new ArrayList<>(2);
    160         marker.add(xmin_ymin);
    161         marker.add(xmax_ymax);
     157        marker.add(new MapMarkerDot(bbox.getMinLat(), bbox.getMinLon()));
     158        marker.add(new MapMarkerDot(bbox.getMaxLat(), bbox.getMaxLon()));
    162159        mapViewer.setBoundingBox(bbox);
    163160        mapViewer.setMapMarkerList(marker);
     
    704701                int zoomDiff = MAX_ZOOM - zoom;
    705702                Point tlc = getTopLeftCoordinates();
    706                 int x_min = (min.x >> zoomDiff) - tlc.x;
    707                 int y_min = (min.y >> zoomDiff) - tlc.y;
    708                 int x_max = (max.x >> zoomDiff) - tlc.x;
    709                 int y_max = (max.y >> zoomDiff) - tlc.y;
    710 
    711                 int w = x_max - x_min;
    712                 int h = y_max - y_min;
     703                int xMin = (min.x >> zoomDiff) - tlc.x;
     704                int yMin = (min.y >> zoomDiff) - tlc.y;
     705                int xMax = (max.x >> zoomDiff) - tlc.x;
     706                int yMax = (max.y >> zoomDiff) - tlc.y;
     707
     708                int w = xMax - xMin;
     709                int h = yMax - yMin;
    713710                g.setColor(new Color(0.9f, 0.7f, 0.7f, 0.6f));
    714                 g.fillRect(x_min, y_min, w, h);
     711                g.fillRect(xMin, yMin, w, h);
    715712
    716713                g.setColor(Color.BLACK);
    717                 g.drawRect(x_min, y_min, w, h);
     714                g.drawRect(xMin, yMin, w, h);
    718715            } catch (Exception e) {
    719716                Main.error(e);
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java

    r10000 r10001  
    418418    abstract static class CopyAction extends AbstractAction implements ListSelectionListener {
    419419
    420         protected CopyAction(String icon_name, String action_name, String short_description) {
    421             ImageIcon icon = ImageProvider.get("dialogs/conflict", icon_name);
     420        protected CopyAction(String iconName, String actionName, String shortDescription) {
     421            ImageIcon icon = ImageProvider.get("dialogs/conflict", iconName);
    422422            putValue(Action.SMALL_ICON, icon);
    423423            if (icon == null) {
    424                 putValue(Action.NAME, action_name);
     424                putValue(Action.NAME, actionName);
    425425            }
    426             putValue(Action.SHORT_DESCRIPTION, short_description);
     426            putValue(Action.SHORT_DESCRIPTION, shortDescription);
    427427            setEnabled(false);
    428428        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java

    r9078 r10001  
    107107    public void reconstruct(Action action, ToggleDialog triggeredBy) {
    108108
    109         final int N = allDialogs.size();
     109        final int n = allDialogs.size();
    110110
    111111        /**
     
    126126         * in the last panel anyway.
    127127         */
    128         JPanel p = panels.get(N-1); // current Panel (start with last one)
     128        JPanel p = panels.get(n-1); // current Panel (start with last one)
    129129        int k = -1;                 // indicates that current Panel index is N-1, but no default-view-Dialog has been added to this Panel yet.
    130         for (int i = N-1; i >= 0; --i) {
     130        for (int i = n-1; i >= 0; --i) {
    131131            final ToggleDialog dlg = allDialogs.get(i);
    132132            if (dlg.isDialogInDefaultView()) {
    133133                if (k == -1) {
    134                     k = N-1;
     134                    k = n-1;
    135135                } else {
    136136                    --k;
     
    146146
    147147        if (k == -1) {
    148             k = N-1;
    149         }
    150         final int numPanels = N - k;
     148            k = n-1;
     149        }
     150        final int numPanels = n - k;
    151151
    152152        /**
     
    154154         */
    155155        if (action == Action.ELEMENT_SHRINKS) {
    156             for (int i = 0; i < N; ++i) {
     156            for (int i = 0; i < n; ++i) {
    157157                final ToggleDialog dlg = allDialogs.get(i);
    158158                if (dlg.isDialogInDefaultView()) {
     
    191191
    192192            /** total Height */
    193             final int H = mSpltPane.getMultiSplitLayout().getModel().getBounds().getSize().height;
     193            final int h = mSpltPane.getMultiSplitLayout().getModel().getBounds().getSize().height;
    194194
    195195            /** space, that is available for dialogs in default view (after the reconfiguration) */
    196             final int s2 = H - (numPanels - 1) * DIVIDER_SIZE - sumC;
    197 
    198             final int hp_trig = triggeredBy.getPreferredHeight();
    199             if (hp_trig <= 0) throw new IllegalStateException(); // Must be positive
     196            final int s2 = h - (numPanels - 1) * DIVIDER_SIZE - sumC;
     197
     198            final int hpTrig = triggeredBy.getPreferredHeight();
     199            if (hpTrig <= 0) throw new IllegalStateException(); // Must be positive
    200200
    201201            /** The new dialog gets a fair share */
    202             final int hn_trig = hp_trig * s2 / (hp_trig + sumP);
    203             triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hn_trig));
     202            final int hnTrig = hpTrig * s2 / (hpTrig + sumP);
     203            triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hnTrig));
    204204
    205205            /** This is remainig for the other default view dialogs */
    206             final int R = s2 - hn_trig;
     206            final int r = s2 - hnTrig;
    207207
    208208            /**
    209209             * Take space only from dialogs that are relatively large
    210210             */
    211             int D_m = 0;        // additional space needed by the small dialogs
    212             int D_p = 0;        // available space from the large dialogs
    213             for (int i = 0; i < N; ++i) {
     211            int dm = 0;        // additional space needed by the small dialogs
     212            int dp = 0;        // available space from the large dialogs
     213            for (int i = 0; i < n; ++i) {
    214214                final ToggleDialog dlg = allDialogs.get(i);
    215215                if (dlg.isDialogInDefaultView() && dlg != triggeredBy) {
    216216                    final int ha = dlg.getSize().height;                              // current
    217                     final int h0 = ha * R / sumA;                                     // proportional shrinking
    218                     final int he = dlg.getPreferredHeight() * s2 / (sumP + hp_trig);  // fair share
     217                    final int h0 = ha * r / sumA;                                     // proportional shrinking
     218                    final int he = dlg.getPreferredHeight() * s2 / (sumP + hpTrig);  // fair share
    219219                    if (h0 < he) {                  // dialog is relatively small
    220220                        int hn = Math.min(ha, he);  // shrink less, but do not grow
    221                         D_m += hn - h0;
     221                        dm += hn - h0;
    222222                    } else {                        // dialog is relatively large
    223                         D_p += h0 - he;
     223                        dp += h0 - he;
    224224                    }
    225225                }
    226226            }
    227227            /** adjust, without changing the sum */
    228             for (int i = 0; i < N; ++i) {
     228            for (int i = 0; i < n; ++i) {
    229229                final ToggleDialog dlg = allDialogs.get(i);
    230230                if (dlg.isDialogInDefaultView() && dlg != triggeredBy) {
    231231                    final int ha = dlg.getHeight();
    232                     final int h0 = ha * R / sumA;
    233                     final int he = dlg.getPreferredHeight() * s2 / (sumP + hp_trig);
     232                    final int h0 = ha * r / sumA;
     233                    final int he = dlg.getPreferredHeight() * s2 / (sumP + hpTrig);
    234234                    if (h0 < he) {
    235235                        int hn = Math.min(ha, he);
     
    238238                        int d;
    239239                        try {
    240                             d = (h0-he) * D_m / D_p;
     240                            d = (h0-he) * dm / dp;
    241241                        } catch (ArithmeticException e) { /* D_p may be zero - nothing wrong with that. */
    242242                            d = 0;
     
    253253        final List<Node> ch = new ArrayList<>();
    254254
    255         for (int i = k; i <= N-1; ++i) {
     255        for (int i = k; i <= n-1; ++i) {
    256256            if (i != k) {
    257257                ch.add(new Divider());
     
    279279         * Hide the Panel, if there is nothing to show
    280280         */
    281         if (numPanels == 1 && panels.get(N-1).getComponents().length == 0) {
     281        if (numPanels == 1 && panels.get(n-1).getComponents().length == 0) {
    282282            parent.setDividerSize(0);
    283283            this.setVisible(false);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java

    r9970 r10001  
    212212    }
    213213
    214     private Direction determineDirection(int ref_i, Direction ref_direction, int k) {
    215         return determineDirection(ref_i, ref_direction, k, false);
     214    private Direction determineDirection(int refI, Direction refDirection, int k) {
     215        return determineDirection(refI, refDirection, k, false);
    216216    }
    217217
     
    225225     * Let the relation be a route of oneway streets, and someone travels them in the given order.
    226226     * Direction is FORWARD if it is legal and BACKWARD if it is illegal to do so for the given way.
    227      * @param ref_i way key
    228      * @param ref_direction direction of ref_i
     227     * @param refI way key
     228     * @param refDirection direction of ref_i
    229229     * @param k successor of ref_i
    230230     * @param reversed if {@code true} determine reverse direction
    231231     * @return direction of way {@code k}
    232232     */
    233     private Direction determineDirection(int ref_i, final Direction ref_direction, int k, boolean reversed) {
    234         if (ref_i < 0 || k < 0 || ref_i >= members.size() || k >= members.size())
     233    private Direction determineDirection(int refI, final Direction refDirection, int k, boolean reversed) {
     234        if (refI < 0 || k < 0 || refI >= members.size() || k >= members.size())
    235235            return NONE;
    236         if (ref_direction == NONE)
     236        if (refDirection == NONE)
    237237            return NONE;
    238238
    239         final RelationMember m_ref = members.get(ref_i);
     239        final RelationMember mRef = members.get(refI);
    240240        final RelationMember m = members.get(k);
    241         Way way_ref = null;
     241        Way wayRef = null;
    242242        Way way = null;
    243243
    244         if (m_ref.isWay()) {
    245             way_ref = m_ref.getWay();
     244        if (mRef.isWay()) {
     245            wayRef = mRef.getWay();
    246246        }
    247247        if (m.isWay()) {
     
    249249        }
    250250
    251         if (way_ref == null || way == null)
     251        if (wayRef == null || way == null)
    252252            return NONE;
    253253
     
    255255        List<Node> refNodes = new ArrayList<>();
    256256
    257         switch (ref_direction) {
     257        switch (refDirection) {
    258258        case FORWARD:
    259             refNodes.add(way_ref.lastNode());
     259            refNodes.add(wayRef.lastNode());
    260260            break;
    261261        case BACKWARD:
    262             refNodes.add(way_ref.firstNode());
     262            refNodes.add(wayRef.firstNode());
    263263            break;
    264264        case ROUNDABOUT_LEFT:
    265265        case ROUNDABOUT_RIGHT:
    266             refNodes = way_ref.getNodes();
     266            refNodes = wayRef.getNodes();
    267267            break;
    268268        }
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r9971 r10001  
    10131013
    10141014        // How many pixels into the 'source' rectangle are we drawing?
    1015         int screen_x_offset = target.x - source.x;
    1016         int screen_y_offset = target.y - source.y;
     1015        int screenXoffset = target.x - source.x;
     1016        int screenYoffset = target.y - source.y;
    10171017        // And how many pixels into the image itself does that correlate to?
    1018         int img_x_offset = (int) (screen_x_offset * imageXScaling + 0.5);
    1019         int img_y_offset = (int) (screen_y_offset * imageYScaling + 0.5);
     1018        int imgXoffset = (int) (screenXoffset * imageXScaling + 0.5);
     1019        int imgYoffset = (int) (screenYoffset * imageYScaling + 0.5);
    10201020        // Now calculate the other corner of the image that we need
    10211021        // by scaling the 'target' rectangle's dimensions.
    1022         int img_x_end = img_x_offset + (int) (target.getWidth() * imageXScaling + 0.5);
    1023         int img_y_end = img_y_offset + (int) (target.getHeight() * imageYScaling + 0.5);
     1022        int imgXend = imgXoffset + (int) (target.getWidth() * imageXScaling + 0.5);
     1023        int imgYend = imgYoffset + (int) (target.getHeight() * imageYScaling + 0.5);
    10241024
    10251025        if (Main.isDebugEnabled()) {
     
    10291029                target.x, target.y,
    10301030                target.x + target.width, target.y + target.height,
    1031                 img_x_offset, img_y_offset,
    1032                 img_x_end, img_y_end,
     1031                imgXoffset, imgYoffset,
     1032                imgXend, imgYend,
    10331033                this);
    10341034        if (PROP_FADE_AMOUNT.get() != 0) {
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r9997 r10001  
    840840                return tr("No gpx selected");
    841841
    842             final long offset_ms = ((long) (timezone.getHours() * 3600 * 1000)) + delta.getMilliseconds(); // in milliseconds
    843             lastNumMatched = matchGpxTrack(dateImgLst, selGpx.data, offset_ms);
     842            final long offsetMs = ((long) (timezone.getHours() * 3600 * 1000)) + delta.getMilliseconds(); // in milliseconds
     843            lastNumMatched = matchGpxTrack(dateImgLst, selGpx.data, offsetMs);
    844844
    845845            return trn("<html>Matched <b>{0}</b> of <b>{1}</b> photo to GPX track.</html>",
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r9543 r10001  
    9191        Shortcut scPrev = Shortcut.registerShortcut(
    9292                "geoimage:previous", tr("Geoimage: {0}", tr("Show previous Image")), KeyEvent.VK_PAGE_UP, Shortcut.DIRECT);
    93         final String APREVIOUS = "Previous Image";
     93        final String previousImage = "Previous Image";
    9494        Main.registerActionShortcut(prevAction, scPrev);
    95         btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), APREVIOUS);
    96         btnPrevious.getActionMap().put(APREVIOUS, prevAction);
     95        btnPrevious.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scPrev.getKeyStroke(), previousImage);
     96        btnPrevious.getActionMap().put(previousImage, prevAction);
    9797        btnPrevious.setEnabled(false);
    9898
    99         final String DELETE_TEXT = tr("Remove photo from layer");
    100         ImageAction delAction = new ImageAction(COMMAND_REMOVE, ImageProvider.get("dialogs", "delete"), DELETE_TEXT);
     99        final String removePhoto = tr("Remove photo from layer");
     100        ImageAction delAction = new ImageAction(COMMAND_REMOVE, ImageProvider.get("dialogs", "delete"), removePhoto);
    101101        JButton btnDelete = new JButton(delAction);
    102102        btnDelete.setPreferredSize(buttonDim);
     
    104104                "geoimage:deleteimagefromlayer", tr("Geoimage: {0}", tr("Remove photo from layer")), KeyEvent.VK_DELETE, Shortcut.SHIFT);
    105105        Main.registerActionShortcut(delAction, scDelete);
    106         btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), DELETE_TEXT);
    107         btnDelete.getActionMap().put(DELETE_TEXT, delAction);
     106        btnDelete.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDelete.getKeyStroke(), removePhoto);
     107        btnDelete.getActionMap().put(removePhoto, delAction);
    108108
    109109        ImageAction delFromDiskAction = new ImageAction(COMMAND_REMOVE_FROM_DISK,
     
    113113        Shortcut scDeleteFromDisk = Shortcut.registerShortcut(
    114114                "geoimage:deletefilefromdisk", tr("Geoimage: {0}", tr("Delete File from disk")), KeyEvent.VK_DELETE, Shortcut.CTRL_SHIFT);
    115         final String ADELFROMDISK = "Delete image file from disk";
     115        final String deleteImage = "Delete image file from disk";
    116116        Main.registerActionShortcut(delFromDiskAction, scDeleteFromDisk);
    117         btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), ADELFROMDISK);
    118         btnDeleteFromDisk.getActionMap().put(ADELFROMDISK, delFromDiskAction);
     117        btnDeleteFromDisk.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scDeleteFromDisk.getKeyStroke(), deleteImage);
     118        btnDeleteFromDisk.getActionMap().put(deleteImage, delFromDiskAction);
    119119
    120120        ImageAction copyPathAction = new ImageAction(COMMAND_COPY_PATH, ImageProvider.get("copy"), tr("Copy image path"));
     
    123123        Shortcut scCopyPath = Shortcut.registerShortcut(
    124124                "geoimage:copypath", tr("Geoimage: {0}", tr("Copy image path")), KeyEvent.VK_C, Shortcut.ALT_CTRL_SHIFT);
    125         final String ACOPYPATH = "Copy image path";
     125        final String copyImage = "Copy image path";
    126126        Main.registerActionShortcut(copyPathAction, scCopyPath);
    127         btnCopyPath.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), ACOPYPATH);
    128         btnCopyPath.getActionMap().put(ACOPYPATH, copyPathAction);
     127        btnCopyPath.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scCopyPath.getKeyStroke(), copyImage);
     128        btnCopyPath.getActionMap().put(copyImage, copyPathAction);
    129129
    130130        ImageAction nextAction = new ImageAction(COMMAND_NEXT, ImageProvider.get("dialogs", "next"), tr("Next"));
     
    133133        Shortcut scNext = Shortcut.registerShortcut(
    134134                "geoimage:next", tr("Geoimage: {0}", tr("Show next Image")), KeyEvent.VK_PAGE_DOWN, Shortcut.DIRECT);
    135         final String ANEXT = "Next Image";
     135        final String nextImage = "Next Image";
    136136        Main.registerActionShortcut(nextAction, scNext);
    137         btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), ANEXT);
    138         btnNext.getActionMap().put(ANEXT, nextAction);
     137        btnNext.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scNext.getKeyStroke(), nextImage);
     138        btnNext.getActionMap().put(nextImage, nextAction);
    139139        btnNext.setEnabled(false);
    140140
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackAction.java

    r9817 r10001  
    9393         * and then stop because it has more than 50k nodes.
    9494         */
    95         final double buffer_dist = panel.getDistance();
    96         final double max_area = panel.getArea() / 10000.0 / scale;
    97         final double buffer_y = buffer_dist / 100000.0;
    98         final double buffer_x = buffer_y / scale;
     95        final double bufferDist = panel.getDistance();
     96        final double maxArea = panel.getArea() / 10000.0 / scale;
     97        final double bufferY = bufferDist / 100000.0;
     98        final double bufferX = bufferY / scale;
    9999        final int totalTicks = latcnt;
    100100        // guess if a progress bar might be useful.
    101         final boolean displayProgress = totalTicks > 2000 && buffer_y < 0.01;
     101        final boolean displayProgress = totalTicks > 2000 && bufferY < 0.01;
    102102
    103103        class CalculateDownloadArea extends PleaseWaitRunnable {
     
    126126                    return;
    127127                }
    128                 confirmAndDownloadAreas(a, max_area, panel.isDownloadOsmData(), panel.isDownloadGpxData(),
     128                confirmAndDownloadAreas(a, maxArea, panel.isDownloadOsmData(), panel.isDownloadGpxData(),
    129129                        tr("Download from OSM along this track"), progressMonitor);
    130130            }
     
    147147                tick();
    148148                LatLon c = p.getCoor();
    149                 if (previous == null || c.greatCircleDistance(previous) > buffer_dist) {
     149                if (previous == null || c.greatCircleDistance(previous) > bufferDist) {
    150150                    // we add a buffer around the point.
    151                     r.setRect(c.lon() - buffer_x, c.lat() - buffer_y, 2 * buffer_x, 2 * buffer_y);
     151                    r.setRect(c.lon() - bufferX, c.lat() - bufferY, 2 * bufferX, 2 * bufferY);
    152152                    a.add(new Area(r));
    153153                    return c;
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java

    r9248 r10001  
    9494            /* calculate time differences in waypoints */
    9595            double time = wpt.time;
    96             boolean wpt_has_link = wpt.attr.containsKey(GpxConstants.META_LINKS);
    97             if (firstTime < 0 && wpt_has_link) {
     96            boolean wptHasLink = wpt.attr.containsKey(GpxConstants.META_LINKS);
     97            if (firstTime < 0 && wptHasLink) {
    9898                firstTime = time;
    9999                for (GpxLink oneLink : wpt.<GpxLink>getCollection(GpxConstants.META_LINKS)) {
     
    102102                }
    103103            }
    104             if (wpt_has_link) {
     104            if (wptHasLink) {
    105105                for (GpxLink oneLink : wpt.<GpxLink>getCollection(GpxConstants.META_LINKS)) {
    106106                    String uri = oneLink.uri;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/CSSColors.java

    r7509 r10001  
    99    private static final Map<String, Color> CSS_COLORS = new HashMap<>();
    1010    static {
    11         Object[][] CSSCOLORS_INIT = new Object[][] {
     11        for (Object[] pair : new Object[][] {
    1212            {"aliceblue", 0xf0f8ff},
    1313            {"antiquewhite", 0xfaebd7},
     
    157157            {"yellow", 0xffff00},
    158158            {"yellowgreen", 0x9acd32}
    159         };
    160         for (Object[] pair : CSSCOLORS_INIT) {
     159        }) {
    161160            CSS_COLORS.put((String) pair[0], new Color((Integer) pair[1]));
    162161        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r9983 r10001  
    149149            }
    150150
    151             float test_float;
     151            float testFloat;
    152152            try {
    153                 test_float = Float.parseFloat(testString);
     153                testFloat = Float.parseFloat(testString);
    154154            } catch (NumberFormatException e) {
    155155                return false;
    156156            }
    157             float prototype_float = Float.parseFloat(prototypeString);
     157            float prototypeFloat = Float.parseFloat(prototypeString);
    158158
    159159            switch (this) {
    160160            case GREATER_OR_EQUAL:
    161                 return test_float >= prototype_float;
     161                return testFloat >= prototypeFloat;
    162162            case GREATER:
    163                 return test_float > prototype_float;
     163                return testFloat > prototypeFloat;
    164164            case LESS_OR_EQUAL:
    165                 return test_float <= prototype_float;
     165                return testFloat <= prototypeFloat;
    166166            case LESS:
    167                 return test_float < prototype_float;
     167                return testFloat < prototypeFloat;
    168168            default:
    169169                throw new AssertionError();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java

    r9371 r10001  
    5656        public final float defaultMajorZIndex;
    5757
    58         LineType(String prefix, float default_major_z_index) {
     58        LineType(String prefix, float defaultMajorZindex) {
    5959            this.prefix = prefix;
    60             this.defaultMajorZIndex = default_major_z_index;
    61         }
    62     }
    63 
    64     protected LineElement(Cascade c, float default_major_z_index, BasicStroke line, Color color, BasicStroke dashesLine,
     60            this.defaultMajorZIndex = defaultMajorZindex;
     61        }
     62    }
     63
     64    protected LineElement(Cascade c, float defaultMajorZindex, BasicStroke line, Color color, BasicStroke dashesLine,
    6565            Color dashesBackground, float offset, float realWidth, boolean wayDirectionArrows) {
    66         super(c, default_major_z_index);
     66        super(c, defaultMajorZindex);
    6767        this.line = line;
    6868        this.color = color;
     
    104104    private static LineElement createImpl(Environment env, LineType type) {
    105105        Cascade c = env.mc.getCascade(env.layer);
    106         Cascade c_def = env.mc.getCascade("default");
     106        Cascade cDef = env.mc.getCascade("default");
    107107        Float width;
    108108        switch (type) {
    109109            case NORMAL:
    110                 width = getWidth(c, WIDTH, getWidth(c_def, WIDTH, null));
     110                width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null));
    111111                break;
    112112            case CASING:
    113113                Float casingWidth = c.get(type.prefix + WIDTH, null, Float.class, true);
    114114                if (casingWidth == null) {
    115                     RelativeFloat rel_casingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);
    116                     if (rel_casingWidth != null) {
    117                         casingWidth = rel_casingWidth.val / 2;
     115                    RelativeFloat relCasingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);
     116                    if (relCasingWidth != null) {
     117                        casingWidth = relCasingWidth.val / 2;
    118118                    }
    119119                }
    120120                if (casingWidth == null)
    121121                    return null;
    122                 width = getWidth(c, WIDTH, getWidth(c_def, WIDTH, null));
     122                width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null));
    123123                if (width == null) {
    124124                    width = 0f;
     
    162162            case LEFT_CASING:
    163163            case RIGHT_CASING:
    164                 Float baseWidthOnDefault = getWidth(c_def, WIDTH, null);
     164                Float baseWidthOnDefault = getWidth(cDef, WIDTH, null);
    165165                Float baseWidth = getWidth(c, WIDTH, baseWidthOnDefault);
    166166                if (baseWidth == null || baseWidth < 2f) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java

    r9371 r10001  
    9393            BoxTextElement.SIMPLE_NODE_TEXT_ELEMSTYLE);
    9494
    95     protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float default_major_z_index, RotationAngle rotationAngle) {
    96         super(c, default_major_z_index);
     95    protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle) {
     96        super(c, defaultMajorZindex);
    9797        this.mapImage = mapImage;
    9898        this.symbol = symbol;
     
    104104    }
    105105
    106     private static NodeElement create(Environment env, float default_major_z_index, boolean allowDefault) {
     106    private static NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault) {
    107107        Cascade c = env.mc.getCascade(env.layer);
    108108
     
    138138        if (!allowDefault && symbol == null && mapImage == null) return null;
    139139
    140         return new NodeElement(c, mapImage, symbol, default_major_z_index, rotationAngle);
     140        return new NodeElement(c, mapImage, symbol, defaultMajorZindex, rotationAngle);
    141141    }
    142142
     
    148148            return null;
    149149
    150         Cascade c_def = env.mc.getCascade("default");
    151 
    152         Float widthOnDefault = c_def.get(keys[ICON_WIDTH_IDX], null, Float.class);
     150        Cascade cDef = env.mc.getCascade("default");
     151
     152        Float widthOnDefault = cDef.get(keys[ICON_WIDTH_IDX], null, Float.class);
    153153        if (widthOnDefault != null && widthOnDefault <= 0) {
    154154            widthOnDefault = null;
     
    156156        Float widthF = getWidth(c, keys[ICON_WIDTH_IDX], widthOnDefault);
    157157
    158         Float heightOnDefault = c_def.get(keys[ICON_HEIGHT_IDX], null, Float.class);
     158        Float heightOnDefault = cDef.get(keys[ICON_HEIGHT_IDX], null, Float.class);
    159159        if (heightOnDefault != null && heightOnDefault <= 0) {
    160160            heightOnDefault = null;
     
    189189    private static Symbol createSymbol(Environment env) {
    190190        Cascade c = env.mc.getCascade(env.layer);
    191         Cascade c_def = env.mc.getCascade("default");
     191        Cascade cDef = env.mc.getCascade("default");
    192192
    193193        SymbolShape shape;
     
    216216            return null;
    217217
    218         Float sizeOnDefault = c_def.get("symbol-size", null, Float.class);
     218        Float sizeOnDefault = cDef.get("symbol-size", null, Float.class);
    219219        if (sizeOnDefault != null && sizeOnDefault <= 0) {
    220220            sizeOnDefault = null;
     
    229229            return null;
    230230
    231         Float strokeWidthOnDefault = getWidth(c_def, "symbol-stroke-width", null);
     231        Float strokeWidthOnDefault = getWidth(cDef, "symbol-stroke-width", null);
    232232        Float strokeWidth = getWidth(c, "symbol-stroke-width", strokeWidthOnDefault);
    233233
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java

    r9371 r10001  
    3535    public boolean defaultSelectedHandling;
    3636
    37     public StyleElement(float major_z_index, float z_index, float object_z_index, boolean isModifier, boolean defaultSelectedHandling) {
    38         this.majorZIndex = major_z_index;
    39         this.zIndex = z_index;
    40         this.objectZIndex = object_z_index;
     37    public StyleElement(float majorZindex, float zIndex, float objectZindex, boolean isModifier, boolean defaultSelectedHandling) {
     38        this.majorZIndex = majorZindex;
     39        this.zIndex = zIndex;
     40        this.objectZIndex = objectZindex;
    4141        this.isModifier = isModifier;
    4242        this.defaultSelectedHandling = defaultSelectedHandling;
    4343    }
    4444
    45     protected StyleElement(Cascade c, float default_major_z_index) {
    46         majorZIndex = c.get(MAJOR_Z_INDEX, default_major_z_index, Float.class);
     45    protected StyleElement(Cascade c, float defaultMajorZindex) {
     46        majorZIndex = c.get(MAJOR_Z_INDEX, defaultMajorZindex, Float.class);
    4747        zIndex = c.get(Z_INDEX, 0f, Float.class);
    4848        objectZIndex = c.get(OBJECT_Z_INDEX, 0f, Float.class);
     
    8686                return (float) MapPaintSettings.INSTANCE.getDefaultSegmentWidth();
    8787            if (relativeTo != null) {
    88                 RelativeFloat width_rel = c.get(key, null, RelativeFloat.class, true);
    89                 if (width_rel != null)
    90                     return relativeTo + width_rel.val;
     88                RelativeFloat widthRel = c.get(key, null, RelativeFloat.class, true);
     89                if (widthRel != null)
     90                    return relativeTo + widthRel.val;
    9191            }
    9292        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    r9686 r10001  
    9696        // fill model with colors:
    9797        Map<String, String> colorKeyList = new TreeMap<>();
    98         Map<String, String> colorKeyList_mappaint = new TreeMap<>();
    99         Map<String, String> colorKeyList_layer = new TreeMap<>();
     98        Map<String, String> colorKeyListMappaint = new TreeMap<>();
     99        Map<String, String> colorKeyListLayer = new TreeMap<>();
    100100        for (String key : colorMap.keySet()) {
    101101            if (key.startsWith("layer ")) {
    102                 colorKeyList_layer.put(getName(key), key);
     102                colorKeyListLayer.put(getName(key), key);
    103103            } else if (key.startsWith("mappaint.")) {
    104104                // use getName(key)+key, as getName() may be ambiguous
    105                 colorKeyList_mappaint.put(getName(key)+key, key);
     105                colorKeyListMappaint.put(getName(key)+key, key);
    106106            } else {
    107107                colorKeyList.put(getName(key), key);
     
    109109        }
    110110        addColorRows(colorMap, colorKeyList);
    111         addColorRows(colorMap, colorKeyList_mappaint);
    112         addColorRows(colorMap, colorKeyList_layer);
     111        addColorRows(colorMap, colorKeyListMappaint);
     112        addColorRows(colorMap, colorKeyListLayer);
    113113        if (this.colors != null) {
    114114            this.colors.repaint();
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r9840 r10001  
    7878        if (Main.isPlatformOsx()) {
    7979            try {
    80                 Class<?> Cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");
    81                 Object Oquaqua = Cquaqua.getConstructor((Class[]) null).newInstance((Object[]) null);
     80                Class<?> cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");
     81                Object oquaqua = cquaqua.getConstructor((Class[]) null).newInstance((Object[]) null);
    8282                // no exception? Then Go!
    8383                lafCombo.addItem(
    84                         new UIManager.LookAndFeelInfo(((LookAndFeel) Oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")
     84                        new UIManager.LookAndFeelInfo(((LookAndFeel) oquaqua).getName(), "ch.randelshofer.quaqua.QuaquaLookAndFeel")
    8585                );
    8686            } catch (Exception ex) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java

    r9936 r10001  
    103103    }
    104104
    105     protected static String getLocaleText(String text, String text_context, String defaultText) {
     105    protected static String getLocaleText(String text, String textContext, String defaultText) {
    106106        if (text == null) {
    107107            return defaultText;
    108         } else if (text_context != null) {
    109             return trc(text_context, fixPresetString(text));
     108        } else if (textContext != null) {
     109            return trc(textContext, fixPresetString(text));
    110110        } else {
    111111            return tr(fixPresetString(text));
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Roles.java

    r9665 r10001  
    5252        }
    5353
    54         public void setMember_expression(String member_expression) throws SAXException {
     54        public void setMember_expression(String memberExpression) throws SAXException {
    5555            try {
    5656                final SearchAction.SearchSetting searchSetting = new SearchAction.SearchSetting();
    57                 searchSetting.text = member_expression;
     57                searchSetting.text = memberExpression;
    5858                searchSetting.caseSensitive = true;
    5959                searchSetting.regexSearch = true;
  • trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java

    r9590 r10001  
    9999    public void setFileFilter(final FileFilter cff) {
    100100        FilenameFilter filter = new FilenameFilter() {
    101             public boolean accept(File Directory, String fileName) {
    102                 return cff.accept(new File(Directory.getAbsolutePath() + fileName));
     101            @Override
     102            public boolean accept(File directory, String fileName) {
     103                return cff.accept(new File(directory.getAbsolutePath() + fileName));
    103104            }
    104105        };
  • trunk/src/org/openstreetmap/josm/io/NmeaReader.java

    r9740 r10001  
    173173        try (BufferedReader rd = new BufferedReader(new InputStreamReader(source, StandardCharsets.UTF_8))) {
    174174            StringBuilder sb = new StringBuilder(1024);
    175             int loopstart_char = rd.read();
     175            int loopstartChar = rd.read();
    176176            ps = new NMEAParserState();
    177             if (loopstart_char == -1)
     177            if (loopstartChar == -1)
    178178                //TODO tell user about the problem?
    179179                return;
    180             sb.append((char) loopstart_char);
     180            sb.append((char) loopstartChar);
    181181            ps.pDate = "010100"; // TODO date problem
    182182            while (true) {
  • trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java

    r8855 r10001  
    119119
    120120            // -- min_lon and min_lat
    121             String min_lon = atts.getValue("min_lon");
    122             String min_lat = atts.getValue("min_lat");
    123             String max_lon = atts.getValue("max_lon");
    124             String max_lat = atts.getValue("max_lat");
    125             if (min_lon != null && min_lat != null && max_lon != null && max_lat != null) {
     121            String minLonStr = atts.getValue("min_lon");
     122            String minLatStr = atts.getValue("min_lat");
     123            String maxLonStr = atts.getValue("max_lon");
     124            String maxLatStr = atts.getValue("max_lat");
     125            if (minLonStr != null && minLatStr != null && maxLonStr != null && maxLatStr != null) {
    126126                double minLon = 0;
    127127                try {
    128                     minLon = Double.parseDouble(min_lon);
    129                 } catch (NumberFormatException e) {
    130                     throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lon", min_lon));
     128                    minLon = Double.parseDouble(minLonStr);
     129                } catch (NumberFormatException e) {
     130                    throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lon", minLonStr));
    131131                }
    132132                double minLat = 0;
    133133                try {
    134                     minLat = Double.parseDouble(min_lat);
    135                 } catch (NumberFormatException e) {
    136                     throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lat", min_lat));
     134                    minLat = Double.parseDouble(minLatStr);
     135                } catch (NumberFormatException e) {
     136                    throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "min_lat", minLatStr));
    137137                }
    138138                current.setMin(new LatLon(minLat, minLon));
     
    142142                double maxLon = 0;
    143143                try {
    144                     maxLon = Double.parseDouble(max_lon);
    145                 } catch (NumberFormatException e) {
    146                     throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lon", max_lon));
     144                    maxLon = Double.parseDouble(maxLonStr);
     145                } catch (NumberFormatException e) {
     146                    throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lon", maxLonStr));
    147147                }
    148148                double maxLat = 0;
    149149                try {
    150                     maxLat = Double.parseDouble(max_lat);
    151                 } catch (NumberFormatException e) {
    152                     throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lat", max_lat));
     150                    maxLat = Double.parseDouble(maxLatStr);
     151                } catch (NumberFormatException e) {
     152                    throwException(tr("Illegal value for attribute ''{0}''. Got ''{1}''.", "max_lat", maxLatStr));
    153153                }
    154154                current.setMax(new LatLon(maxLon, maxLat));
  • trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java

    r9528 r10001  
    6161    private long uploadStartTime;
    6262
    63     public String timeLeft(int progress, int list_size) {
     63    public String timeLeft(int progress, int listSize) {
    6464        long now = System.currentTimeMillis();
    6565        long elapsed = now - uploadStartTime;
     
    6767            elapsed = 1;
    6868        }
    69         double uploads_per_ms = (double) progress / elapsed;
    70         double uploads_left = list_size - progress;
    71         long ms_left = (long) (uploads_left / uploads_per_ms);
    72         long minutes_left = ms_left / MSECS_PER_MINUTE;
    73         long seconds_left = (ms_left / MSECS_PER_SECOND) % SECONDS_PER_MINUTE;
    74         StringBuilder time_left_str = new StringBuilder().append(minutes_left).append(':');
    75         if (seconds_left < 10) {
    76             time_left_str.append('0');
    77         }
    78         return time_left_str.append(seconds_left).toString();
     69        double uploadsPerMs = (double) progress / elapsed;
     70        double uploadsLeft = listSize - progress;
     71        long msLeft = (long) (uploadsLeft / uploadsPerMs);
     72        long minutesLeft = msLeft / MSECS_PER_MINUTE;
     73        long secondsLeft = (msLeft / MSECS_PER_SECOND) % SECONDS_PER_MINUTE;
     74        StringBuilder timeLeftStr = new StringBuilder().append(minutesLeft).append(':');
     75        if (secondsLeft < 10) {
     76            timeLeftStr.append('0');
     77        }
     78        return timeLeftStr.append(secondsLeft).toString();
    7979    }
    8080
     
    9494            for (OsmPrimitive osm : primitives) {
    9595                int progress = progressMonitor.getTicks();
    96                 String time_left_str = timeLeft(progress, primitives.size());
     96                String timeLeftStr = timeLeft(progress, primitives.size());
    9797                String msg = "";
    9898                switch(OsmPrimitiveType.from(osm)) {
     
    106106                                progress,
    107107                                primitives.size(),
    108                                 time_left_str,
     108                                timeLeftStr,
    109109                                osm.getName() == null ? osm.getId() : osm.getName(),
    110110                                        osm.getId()));
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r10000 r10001  
    177177
    178178            Map<String, String> headers = new HashMap<>();
    179             int k = 0, MAX_HEADERS = 20;
    180             while (k < MAX_HEADERS) {
     179            int k = 0;
     180            int maxHeaders = 20;
     181            while (k < maxHeaders) {
    181182                get = in.readLine();
    182183                if (get == null) break;
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r9972 r10001  
    8080    protected static final Collection<DeprecatedPlugin> DEPRECATED_PLUGINS;
    8181    static {
    82         String IN_CORE = tr("integrated into main program");
     82        String inCore = tr("integrated into main program");
    8383
    8484        DEPRECATED_PLUGINS = Arrays.asList(new DeprecatedPlugin[] {
    85             new DeprecatedPlugin("mappaint", IN_CORE),
    86             new DeprecatedPlugin("unglueplugin", IN_CORE),
    87             new DeprecatedPlugin("lang-de", IN_CORE),
    88             new DeprecatedPlugin("lang-en_GB", IN_CORE),
    89             new DeprecatedPlugin("lang-fr", IN_CORE),
    90             new DeprecatedPlugin("lang-it", IN_CORE),
    91             new DeprecatedPlugin("lang-pl", IN_CORE),
    92             new DeprecatedPlugin("lang-ro", IN_CORE),
    93             new DeprecatedPlugin("lang-ru", IN_CORE),
    94             new DeprecatedPlugin("ewmsplugin", IN_CORE),
    95             new DeprecatedPlugin("ywms", IN_CORE),
    96             new DeprecatedPlugin("tways-0.2", IN_CORE),
    97             new DeprecatedPlugin("geotagged", IN_CORE),
     85            new DeprecatedPlugin("mappaint", inCore),
     86            new DeprecatedPlugin("unglueplugin", inCore),
     87            new DeprecatedPlugin("lang-de", inCore),
     88            new DeprecatedPlugin("lang-en_GB", inCore),
     89            new DeprecatedPlugin("lang-fr", inCore),
     90            new DeprecatedPlugin("lang-it", inCore),
     91            new DeprecatedPlugin("lang-pl", inCore),
     92            new DeprecatedPlugin("lang-ro", inCore),
     93            new DeprecatedPlugin("lang-ru", inCore),
     94            new DeprecatedPlugin("ewmsplugin", inCore),
     95            new DeprecatedPlugin("ywms", inCore),
     96            new DeprecatedPlugin("tways-0.2", inCore),
     97            new DeprecatedPlugin("geotagged", inCore),
    9898            new DeprecatedPlugin("landsat", tr("replaced by new {0} plugin", "lakewalker")),
    99             new DeprecatedPlugin("namefinder", IN_CORE),
    100             new DeprecatedPlugin("waypoints", IN_CORE),
    101             new DeprecatedPlugin("slippy_map_chooser", IN_CORE),
     99            new DeprecatedPlugin("namefinder", inCore),
     100            new DeprecatedPlugin("waypoints", inCore),
     101            new DeprecatedPlugin("slippy_map_chooser", inCore),
    102102            new DeprecatedPlugin("tcx-support", tr("replaced by new {0} plugin", "dataimport")),
    103             new DeprecatedPlugin("usertools", IN_CORE),
    104             new DeprecatedPlugin("AgPifoJ", IN_CORE),
    105             new DeprecatedPlugin("utilsplugin", IN_CORE),
    106             new DeprecatedPlugin("ghost", IN_CORE),
    107             new DeprecatedPlugin("validator", IN_CORE),
    108             new DeprecatedPlugin("multipoly", IN_CORE),
    109             new DeprecatedPlugin("multipoly-convert", IN_CORE),
    110             new DeprecatedPlugin("remotecontrol", IN_CORE),
    111             new DeprecatedPlugin("imagery", IN_CORE),
    112             new DeprecatedPlugin("slippymap", IN_CORE),
    113             new DeprecatedPlugin("wmsplugin", IN_CORE),
    114             new DeprecatedPlugin("ParallelWay", IN_CORE),
     103            new DeprecatedPlugin("usertools", inCore),
     104            new DeprecatedPlugin("AgPifoJ", inCore),
     105            new DeprecatedPlugin("utilsplugin", inCore),
     106            new DeprecatedPlugin("ghost", inCore),
     107            new DeprecatedPlugin("validator", inCore),
     108            new DeprecatedPlugin("multipoly", inCore),
     109            new DeprecatedPlugin("multipoly-convert", inCore),
     110            new DeprecatedPlugin("remotecontrol", inCore),
     111            new DeprecatedPlugin("imagery", inCore),
     112            new DeprecatedPlugin("slippymap", inCore),
     113            new DeprecatedPlugin("wmsplugin", inCore),
     114            new DeprecatedPlugin("ParallelWay", inCore),
    115115            new DeprecatedPlugin("dumbutils", tr("replaced by new {0} plugin", "utilsplugin2")),
    116             new DeprecatedPlugin("ImproveWayAccuracy", IN_CORE),
     116            new DeprecatedPlugin("ImproveWayAccuracy", inCore),
    117117            new DeprecatedPlugin("Curves", tr("replaced by new {0} plugin", "utilsplugin2")),
    118118            new DeprecatedPlugin("epsg31287", tr("replaced by new {0} plugin", "proj4j")),
    119119            new DeprecatedPlugin("licensechange", tr("no longer required")),
    120             new DeprecatedPlugin("restart", IN_CORE),
    121             new DeprecatedPlugin("wayselector", IN_CORE),
     120            new DeprecatedPlugin("restart", inCore),
     121            new DeprecatedPlugin("wayselector", inCore),
    122122            new DeprecatedPlugin("openstreetbugs", tr("replaced by new {0} plugin", "notes")),
    123123            new DeprecatedPlugin("nearclick", tr("no longer required")),
    124             new DeprecatedPlugin("notes", IN_CORE),
    125             new DeprecatedPlugin("mirrored_download", IN_CORE),
    126             new DeprecatedPlugin("ImageryCache", IN_CORE),
     124            new DeprecatedPlugin("notes", inCore),
     125            new DeprecatedPlugin("mirrored_download", inCore),
     126            new DeprecatedPlugin("ImageryCache", inCore),
    127127            new DeprecatedPlugin("commons-imaging", tr("replaced by new {0} plugin", "apache-commons")),
    128128            new DeprecatedPlugin("missingRoads", tr("replaced by new {0} plugin", "ImproveOsm")),
  • trunk/src/org/openstreetmap/josm/tools/Diff.java

    r9231 r10001  
    177177        for (int c = 1;; ++c) {
    178178            int d;          /* Active diagonal. */
    179             boolean big_snake = false;
     179            boolean bigSnake = false;
    180180
    181181            /* Extend the top-down search by an edit step in each diagonal. */
     
    204204                }
    205205                if (x - oldx > SNAKE_LIMIT) {
    206                     big_snake = true;
     206                    bigSnake = true;
    207207                }
    208208                fd[fdiagoff + d] = x;
     
    238238                }
    239239                if (oldx - x > SNAKE_LIMIT) {
    240                     big_snake = true;
     240                    bigSnake = true;
    241241                }
    242242                bd[bdiagoff + d] = x;
     
    255255       of changes, the algorithm is linear in the file size.  */
    256256
    257             if (c > 200 && big_snake && heuristic) {
     257            if (c > 200 && bigSnake && heuristic) {
    258258                int best = 0;
    259259                int bestpos = -1;
     
    618618         */
    619619        int[] equivCount() {
    620             int[] equiv_count = new int[equivMax];
     620            int[] equivCount = new int[equivMax];
    621621            for (int i = 0; i < bufferedLines; ++i) {
    622                 ++equiv_count[equivs[i]];
    623             }
    624             return equiv_count;
     622                ++equivCount[equivs[i]];
     623            }
     624            return equivCount;
    625625        }
    626626
     
    853853        void shift_boundaries(FileData f) {
    854854            final boolean[] changed = changedFlag;
    855             final boolean[] other_changed = f.changedFlag;
     855            final boolean[] otherChanged = f.changedFlag;
    856856            int i = 0;
    857857            int j = 0;
    858             int i_end = bufferedLines;
     858            int iEnd = bufferedLines;
    859859            int preceding = -1;
    860             int other_preceding = -1;
     860            int otherPreceding = -1;
    861861
    862862            for (;;) {
    863                 int start, end, other_start;
     863                int start, end, otherStart;
    864864
    865865                /* Scan forwards to find beginning of another run of changes.
    866866                   Also keep track of the corresponding point in the other file.  */
    867867
    868                 while (i < i_end && !changed[1+i]) {
    869                     while (other_changed[1+j++]) {
     868                while (i < iEnd && !changed[1+i]) {
     869                    while (otherChanged[1+j++]) {
    870870                        /* Non-corresponding lines in the other file
    871871                           will count as the preceding batch of changes.  */
    872                         other_preceding = j;
     872                        otherPreceding = j;
    873873                    }
    874874                    i++;
    875875                }
    876876
    877                 if (i == i_end) {
     877                if (i == iEnd) {
    878878                    break;
    879879                }
    880880
    881881                start = i;
    882                 other_start = j;
     882                otherStart = j;
    883883
    884884                for (;;) {
    885885                    /* Now find the end of this run of changes.  */
    886886
    887                     while (i < i_end && changed[1+i]) {
     887                    while (i < iEnd && changed[1+i]) {
    888888                        i++;
    889889                    }
     
    899899                       Only because the previous run was shifted here.  */
    900900
    901                     if (end != i_end && equivs[start] == equivs[end] && !other_changed[1+j]
    902                          && !((preceding >= 0 && start == preceding) || (other_preceding >= 0 && other_start == other_preceding))) {
     901                    if (end != iEnd && equivs[start] == equivs[end] && !otherChanged[1+j]
     902                         && !((preceding >= 0 && start == preceding) || (otherPreceding >= 0 && otherStart == otherPreceding))) {
    903903                        changed[1+end++] = true;
    904904                        changed[1+start++] = false;
     
    914914
    915915                preceding = i;
    916                 other_preceding = j;
     916                otherPreceding = j;
    917917            }
    918918        }
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r9949 r10001  
    753753                extensions = new String[] {".png", ".svg"};
    754754            }
    755             final int ARCHIVE = 0, LOCAL = 1;
    756             for (int place : new Integer[] {ARCHIVE, LOCAL}) {
     755            final int typeArchive = 0;
     756            final int typeLocal = 1;
     757            for (int place : new Integer[] {typeArchive, typeLocal}) {
    757758                for (String ext : extensions) {
    758759
     
    777778
    778779                    switch (place) {
    779                     case ARCHIVE:
     780                    case typeArchive:
    780781                        if (archive != null) {
    781782                            ir = getIfAvailableZip(fullName, archive, inArchiveDir, type);
     
    786787                        }
    787788                        break;
    788                     case LOCAL:
     789                    case typeLocal:
    789790                        // getImageUrl() does a ton of "stat()" calls and gets expensive
    790791                        // and redundant when you have a whole ton of objects. So,
     
    924925                }
    925926            } else {
    926                 final String fn_md5 = Utils.md5Hex(fn);
    927                 url = b + fn_md5.substring(0, 1) + '/' + fn_md5.substring(0, 2) + "/" + fn;
     927                final String fnMD5 = Utils.md5Hex(fn);
     928                url = b + fnMD5.substring(0, 1) + '/' + fnMD5.substring(0, 2) + "/" + fn;
    928929            }
    929930            result = getIfAvailableHttp(url, type);
Note: See TracChangeset for help on using the changeset viewer.