Changeset 16567 in josm for trunk


Ignore:
Timestamp:
2020-06-07T22:46:53+02:00 (4 years ago)
Author:
simon04
Message:

fix #19354 - UndoRedoHandler.getUndoCommands: return unmodifiable list

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r16468 r16567  
    22package org.openstreetmap.josm.data;
    33
     4import java.util.Collections;
    45import java.util.EventObject;
    56import java.util.LinkedList;
     
    238239     * Returns all commands that were made on the dataset, that can be undone.
    239240     * @return all commands that were made on the dataset, that can be undone
    240      * @since 14281
    241      */
    242     public LinkedList<Command> getUndoCommands() {
    243         return new LinkedList<>(commands);
     241     * @since 14281, 16567 (signature)
     242     */
     243    public List<Command> getUndoCommands() {
     244        return Collections.unmodifiableList(commands);
    244245    }
    245246
     
    247248     * Returns all commands that were made and undone on the dataset, that can be redone.
    248249     * @return all commands that were made and undone on the dataset, that can be redone.
    249      * @since 14281
    250      */
    251     public LinkedList<Command> getRedoCommands() {
    252         return new LinkedList<>(redoCommands);
     250     * @since 14281, 16567 (signature)
     251     */
     252    public List<Command> getRedoCommands() {
     253        return Collections.unmodifiableList(redoCommands);
    253254    }
    254255
Note: See TracChangeset for help on using the changeset viewer.