Changeset 34782 in osm for applications/editors


Ignore:
Timestamp:
2018-12-15T17:55:04+01:00 (6 years ago)
Author:
donvip
Message:

fix warnings

Location:
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitOnIntersectionsAction.java

    r34780 r34782  
    4141    public SplitOnIntersectionsAction() {
    4242        super(TITLE, "dumbutils/splitonintersections", TOOL_DESC,
    43                 Shortcut.registerShortcut("tools:splitonintersections", tr("Tool: {0}", TITLE),
    44                         KeyEvent.VK_P, Shortcut.ALT_CTRL_SHIFT), true);
     43                Shortcut.registerShortcut("tools:splitonintersections", tr("Tool: {0}", TITLE), KeyEvent.VK_P, Shortcut.ALT_CTRL_SHIFT),
     44                true);
    4545    }
    4646
     
    8888        }
    8989
    90                 if (splitWays.isEmpty()) {
    91                         new Notification(tr("The selection cannot be used for action ''{0}''", TOOL_DESC))
    92                                         .setIcon(JOptionPane.WARNING_MESSAGE).show();
    93                         return;
    94                 }
     90        if (splitWays.isEmpty()) {
     91            new Notification(tr("The selection cannot be used for action ''{0}''", TOOL_DESC))
     92                    .setIcon(JOptionPane.WARNING_MESSAGE).show();
     93            return;
     94        }
    9595
    96                 // fix #16006: Don't generate SequenceCommand when ways are part of the same relation.
     96        // fix #16006: Don't generate SequenceCommand when ways are part of the same relation.
    9797        boolean createSequenceCommand = true;
    9898        Set<Relation> allWayRefs = new HashSet<>();
     
    103103        }
    104104        for (Entry<Way, List<Node>> entry : splitWays.entrySet()) {
    105                 SplitWayCommand cmd = SplitWayCommand.split(entry.getKey(), entry.getValue(), selectedWays);
    106                 if (!createSequenceCommand) {
    107                         UndoRedoHandler.getInstance().add(cmd);
    108                 }
    109                 list.add(cmd);
     105            SplitWayCommand cmd = SplitWayCommand.split(entry.getKey(), entry.getValue(), selectedWays);
     106            if (!createSequenceCommand) {
     107                UndoRedoHandler.getInstance().add(cmd);
     108            }
     109            list.add(cmd);
    110110        }
    111111
     
    114114                UndoRedoHandler.getInstance().add(list.size() == 1 ? list.get(0) : new SequenceCommand(TITLE, list));
    115115            } else {
    116                                 new Notification(
    117                                                 tr("Affected ways are members of the same relation. {0} actions were created for this split.",
    118                                                                 list.size())).setIcon(JOptionPane.WARNING_MESSAGE).show();
    119                         }
     116                new Notification(
     117                        tr("Affected ways are members of the same relation. {0} actions were created for this split.",
     118                                list.size())).setIcon(JOptionPane.WARNING_MESSAGE).show();
     119            }
    120120            getLayerManager().getEditDataSet().clearSelection();
    121121        }
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java

    r34768 r34782  
    8080    @Override
    8181    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
    82         TagCollection oldTags = getCommonTags(selectionBuf);
    83         if (!oldTags.isEmpty()) {
    84             tagsToPaste = new TagCollection(oldTags);
    85         }
    86         selectionBuf.clear();
    87         selectionBuf.addAll(selection);
     82        TagCollection oldTags = getCommonTags(selectionBuf);
     83        if (!oldTags.isEmpty()) {
     84                tagsToPaste = new TagCollection(oldTags);
     85        }
     86        selectionBuf.clear();
     87        selectionBuf.addAll(selection);
    8888
    8989        setEnabled(!selection.isEmpty() && !tagsToPaste.isEmpty());
     
    9595     */
    9696    private static TagCollection getCommonTags(Set<OsmPrimitive> selection) {
    97         if (selection.isEmpty())
    98                 return EmptyTags;
    99 //              // Fix #8350 - only care about tagged objects
    100                 return TagCollection.commonToAllPrimitives(SubclassFilteredCollection.filter(selection, p -> p.isTagged()));
     97        if (selection.isEmpty())
     98            return EmptyTags;
     99        // Fix #8350 - only care about tagged objects
     100        return TagCollection.commonToAllPrimitives(SubclassFilteredCollection.filter(selection, p -> p.isTagged()));
    101101    }
    102102}
Note: See TracChangeset for help on using the changeset viewer.