Index: /trunk/src/org/openstreetmap/josm/command/SequenceCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/SequenceCommand.java	(revision 6395)
+++ /trunk/src/org/openstreetmap/josm/command/SequenceCommand.java	(revision 6396)
@@ -17,17 +17,18 @@
  * and undo them in reverse order.
  * @author imi
+ * @since 31
  */
 public class SequenceCommand extends Command {
 
-    /**
-     * The command sequenz to be executed.
-     */
+    /** The command sequence to be executed. */
     private Command[] sequence;
-    private boolean sequence_complete;
+    private boolean sequenceComplete;
     private final String name;
+    /** Determines if the sequence execution should continue after one of its commands fails. */
     public boolean continueOnError = false;
 
     /**
      * Create the command by specifying the list of commands to execute.
+     * @param name The description text
      * @param sequenz The sequence that should be executed.
      */
@@ -35,10 +36,11 @@
         super();
         this.name = name;
-        this.sequence = new Command[sequenz.size()];
-        this.sequence = sequenz.toArray(this.sequence);
+        this.sequence = sequenz.toArray(new Command[sequenz.size()]);
     }
 
     /**
      * Convenient constructor, if the commands are known at compile time.
+     * @param name The description text
+     * @param sequenz The sequence that should be executed.
      */
     public SequenceCommand(String name, Command... sequenz) {
@@ -48,6 +50,5 @@
     @Override public boolean executeCommand() {
         for (int i=0; i < sequence.length; i++) {
-            Command c = sequence[i];
-            boolean result = c.executeCommand();
+            boolean result = sequence[i].executeCommand();
             if (!result && !continueOnError) {
                 this.undoCommands(i-1);
@@ -55,18 +56,23 @@
             }
         }
-        sequence_complete = true;
+        sequenceComplete = true;
         return true;
     }
 
+    /**
+     * Returns the last command.
+     * @return The last command, or {@code null} if the sequence is empty.
+     */
     public Command getLastCommand() {
-        if(sequence.length == 0)
+        if (sequence.length == 0)
             return null;
         return sequence[sequence.length-1];
     }
+    
     private void undoCommands(int start) {
         // We probably aborted this halfway though the
         // execution sequence because of a sub-command
         // error.  We already undid the sub-commands.
-        if (!sequence_complete)
+        if (!sequenceComplete)
             return;
         for (int i = start; i >= 0; --i) {
@@ -108,3 +114,7 @@
         return prims;
     }
+    
+    protected final void setSequence(Command[] sequence) {
+        this.sequence = sequence;
+    }
 }
