Modify ↓
#19354 closed enhancement (fixed)
UndoRedoHandler.getUndoCommands: return unmodifiable list
Reported by: | simon04 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 20.06 |
Component: | Core | Version: | |
Keywords: | refactoring | Cc: | taylor.smock |
Description
Avoids unnecessary list creation.
-
src/org/openstreetmap/josm/data/UndoRedoHandler.java
diff --git a/src/org/openstreetmap/josm/data/UndoRedoHandler.java b/src/org/openstreetmap/josm/data/UndoRedoHandler.java index 239693b43..c930656a7 100644
a b 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data; 3 3 4 import java.util.Collections; 4 5 import java.util.EventObject; 5 6 import java.util.LinkedList; 6 7 import java.util.List; … … void fire(CommandQueuePreciseListener listener) { 239 240 * @return all commands that were made on the dataset, that can be undone 240 241 * @since 14281 241 242 */ 242 public Li nkedList<Command> getUndoCommands() {243 return new LinkedList<>(commands);243 public List<Command> getUndoCommands() { 244 return Collections.unmodifiableList(commands); 244 245 } 245 246 246 247 /** … … void fire(CommandQueuePreciseListener listener) { 248 249 * @return all commands that were made and undone on the dataset, that can be redone. 249 250 * @since 14281 250 251 */ 251 public Li nkedList<Command> getRedoCommands() {252 return new LinkedList<>(redoCommands);252 public List<Command> getRedoCommands() { 253 return Collections.unmodifiableList(redoCommands); 253 254 } 254 255 255 256 /**
Requires recompilation of some plugins:
- reverter
- utilsplugin2
- https://trac.openstreetmap.org/browser/subversion/applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModNodesAction.java
- https://trac.openstreetmap.org/browser/subversion/applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModWaysAction.java
- MapWithAI
Attachments (0)
Change History (9)
comment:1 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 5 years ago
Cc: | added |
---|
comment:7 by , 5 years ago
MapWithAI has been updated in v1.6.0. It just has to run through the release process now. :)
Note:
See TracTickets
for help on using tickets.
In 16567/josm: