Ignore:
Timestamp:
2017-09-04T23:45:49+02:00 (7 years ago)
Author:
Don-vip
Message:

see #13036 - deprecate Command() default constructor, fix unit tests and java warnings

File:
1 edited

Legend:

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

    r10663 r12726  
    66import java.util.Collection;
    77import java.util.HashMap;
    8 import java.util.LinkedList;
    98import java.util.Map;
     9import java.util.NoSuchElementException;
    1010import java.util.Objects;
    1111
     
    2828     * The nodes to transform.
    2929     */
    30     protected Collection<Node> nodes = new LinkedList<>();
     30    protected final Collection<Node> nodes;
    3131
    3232    /**
    3333     * List of all old states of the nodes.
    3434     */
    35     protected Map<Node, OldNodeState> oldStates = new HashMap<>();
     35    protected final Map<Node, OldNodeState> oldStates = new HashMap<>();
    3636
    3737    /**
     
    4747     * Creates a TransformNodesObject.
    4848     * Find out the impacted nodes and store their initial state.
    49      * @param objects objects to fetch nodes from
     49     * @param objects objects to fetch nodes from. Must neither be null nor empty. Items must belong to a data set
     50     * @throws NullPointerException if objects is null or contain null item
     51     * @throws NoSuchElementException if objects is empty
    5052     */
    5153    public TransformNodesCommand(Collection<? extends OsmPrimitive> objects) {
     54        super(objects.iterator().next().getDataSet());
    5255        this.nodes = AllNodesVisitor.getAllNodes(objects);
    5356        storeOldState();
Note: See TracChangeset for help on using the changeset viewer.