Ignore:
Timestamp:
2014-12-20T16:00:06+01:00 (10 years ago)
Author:
Don-vip
Message:

fix various Sonar issues, improve Javadoc

File:
1 edited

Legend:

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

    r7668 r7859  
    3838 * <li><b>Move Node onto Way</b>: Move the node onto the nearest way segments and include it</li>
    3939 * </ul>
     40 * @since 466
    4041 */
    4142public class JoinNodeWayAction extends JosmAction {
     
    4344    protected final boolean joinWayToNode;
    4445
    45     protected JoinNodeWayAction(boolean joinWayToNode, String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar) {
     46    protected JoinNodeWayAction(boolean joinWayToNode, String name, String iconName, String tooltip,
     47            Shortcut shortcut, boolean registerInToolbar) {
    4648        super(name, iconName, tooltip, shortcut, registerInToolbar);
    4749        this.joinWayToNode = joinWayToNode;
     
    5456    public static JoinNodeWayAction createJoinNodeToWayAction() {
    5557        JoinNodeWayAction action = new JoinNodeWayAction(false,
    56                 tr("Join Node to Way"), /* ICON */ "joinnodeway", tr("Include a node into the nearest way segments"),
    57                 Shortcut.registerShortcut("tools:joinnodeway", tr("Tool: {0}", tr("Join Node to Way")), KeyEvent.VK_J, Shortcut.DIRECT), true);
     58                tr("Join Node to Way"), /* ICON */ "joinnodeway",
     59                tr("Include a node into the nearest way segments"),
     60                Shortcut.registerShortcut("tools:joinnodeway", tr("Tool: {0}", tr("Join Node to Way")),
     61                        KeyEvent.VK_J, Shortcut.DIRECT), true);
    5862        action.putValue("help", ht("/Action/JoinNodeWay"));
    5963        return action;
     
    6670    public static JoinNodeWayAction createMoveNodeOntoWayAction() {
    6771        JoinNodeWayAction action = new JoinNodeWayAction(true,
    68                 tr("Move Node onto Way"), /* ICON*/ "movenodeontoway", tr("Move the node onto the nearest way segments and include it"),
    69                 Shortcut.registerShortcut("tools:movenodeontoway", tr("Tool: {0}", tr("Move Node onto Way")), KeyEvent.VK_N, Shortcut.DIRECT), true);
     72                tr("Move Node onto Way"), /* ICON*/ "movenodeontoway",
     73                tr("Move the node onto the nearest way segments and include it"),
     74                Shortcut.registerShortcut("tools:movenodeontoway", tr("Tool: {0}", tr("Move Node onto Way")),
     75                        KeyEvent.VK_N, Shortcut.DIRECT), true);
     76        action.putValue("help", ht("/Action/MoveNodeWay"));
    7077        return action;
    7178    }
     
    95102                }
    96103
    97                 if (ws.getFirstNode() != node && ws.getSecondNode() != node) {
     104                if (!ws.getFirstNode().equals(node) && !ws.getSecondNode().equals(node)) {
    98105                    insertPoints.put(ws.way, ws.lowerIndex);
    99106                }
     
    137144                List<Node> nodesToAdd = new LinkedList<>();
    138145                nodesToAdd.addAll(nodesInSegment);
    139                 Collections.sort(nodesToAdd, new NodeDistanceToRefNodeComparator(w.getNode(segmentIndex), w.getNode(segmentIndex+1), !joinWayToNode));
     146                Collections.sort(nodesToAdd, new NodeDistanceToRefNodeComparator(
     147                        w.getNode(segmentIndex), w.getNode(segmentIndex+1), !joinWayToNode));
    140148                wayNodes.addAll(segmentIndex + 1, nodesToAdd);
    141149            }
Note: See TracChangeset for help on using the changeset viewer.