Changeset 11874 in josm


Ignore:
Timestamp:
2017-04-09T17:24:39+02:00 (7 years ago)
Author:
Don-vip
Message:

findbugs - UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD

Location:
trunk
Files:
2 edited

Legend:

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

    r11747 r11874  
    2828    private final String name;
    2929    /** Determines if the sequence execution should continue after one of its commands fails. */
    30     public boolean continueOnError;
     30    protected final boolean continueOnError;
     31
     32    /**
     33     * Create the command by specifying the list of commands to execute.
     34     * @param name The description text
     35     * @param sequenz The sequence that should be executed
     36     * @param continueOnError Determines if the sequence execution should continue after one of its commands fails
     37     * @since 11874
     38     */
     39    public SequenceCommand(String name, Collection<Command> sequenz, boolean continueOnError) {
     40        this.name = name;
     41        this.sequence = sequenz.toArray(new Command[sequenz.size()]);
     42        this.continueOnError = continueOnError;
     43    }
    3144
    3245    /**
     
    3649     */
    3750    public SequenceCommand(String name, Collection<Command> sequenz) {
    38         super();
    39         this.name = name;
    40         this.sequence = sequenz.toArray(new Command[sequenz.size()]);
     51        this(name, sequenz, false);
    4152    }
    4253
  • trunk/test/unit/org/openstreetmap/josm/command/SequenceCommandTest.java

    r11734 r11874  
    122122        FailingCommand command2 = new FailingCommand();
    123123        TestCommand command3 = new TestCommand(null);
    124         SequenceCommand command = new SequenceCommand("seq", Arrays.<Command>asList(command1, command2, command3));
    125         command.continueOnError = true;
     124        SequenceCommand command = new SequenceCommand("seq", Arrays.<Command>asList(command1, command2, command3), true);
    126125        assertTrue(command.executeCommand());
    127126        assertTrue(command1.executed);
Note: See TracChangeset for help on using the changeset viewer.