Ignore:
Timestamp:
2015-12-02T00:05:09+01:00 (10 years ago)
Author:
Don-vip
Message:

sonar - Immutable Field

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java

    r9059 r9078  
    6363    private final JTree redoTree = new JTree(redoTreeModel);
    6464
    65     private transient UndoRedoSelectionListener undoSelectionListener;
    66     private transient UndoRedoSelectionListener redoSelectionListener;
    67 
    68     private JScrollPane scrollPane;
    69     private JSeparator separator = new JSeparator();
     65    private final transient UndoRedoSelectionListener undoSelectionListener;
     66    private final transient UndoRedoSelectionListener redoSelectionListener;
     67
     68    private final JScrollPane scrollPane;
     69    private final JSeparator separator = new JSeparator();
    7070    // only visible, if separator is the top most component
    71     private Component spacer = Box.createRigidArea(new Dimension(0, 3));
     71    private final Component spacer = Box.createRigidArea(new Dimension(0, 3));
    7272
    7373    // last operation is remembered to select the next undo/redo entry in the list
     
    7676
    7777    // Actions for context menu and Enter key
    78     private SelectAction selectAction = new SelectAction();
    79     private SelectAndZoomAction selectAndZoomAction = new SelectAndZoomAction();
     78    private final SelectAction selectAction = new SelectAction();
     79    private final SelectAndZoomAction selectAndZoomAction = new SelectAndZoomAction();
    8080
    8181    /**
     
    167167     */
    168168    private class UndoRedoSelectionListener implements TreeSelectionListener {
    169         private JTree source;
     169        private final JTree source;
    170170
    171171        UndoRedoSelectionListener(JTree source) {
     
    247247     * Simple listener setup to update the button enabled state when the side dialog shows.
    248248     */
    249     private transient Set<IEnabledStateUpdating> showNotifyListener = new LinkedHashSet<>();
     249    private final transient Set<IEnabledStateUpdating> showNotifyListener = new LinkedHashSet<>();
    250250
    251251    private void addShowNotifyListener(IEnabledStateUpdating listener) {
     
    431431     */
    432432    protected class UndoRedoAction extends AbstractAction implements IEnabledStateUpdating {
    433         private UndoRedoType type;
    434         private JTree tree;
     433        private final UndoRedoType type;
     434        private final JTree tree;
    435435
    436436        /**
     
    439439         */
    440440        public UndoRedoAction(UndoRedoType type) {
    441             super();
    442441            this.type = type;
    443             switch (type) {
    444             case UNDO:
     442            if (UndoRedoType.UNDO == type) {
    445443                tree = undoTree;
    446444                putValue(NAME, tr("Undo"));
    447445                putValue(SHORT_DESCRIPTION, tr("Undo the selected and all later commands"));
    448446                putValue(SMALL_ICON, ImageProvider.get("undo"));
    449                 break;
    450             case REDO:
     447            } else {
    451448                tree = redoTree;
    452449                putValue(NAME, tr("Redo"));
    453450                putValue(SHORT_DESCRIPTION, tr("Redo the selected and all earlier commands"));
    454451                putValue(SMALL_ICON, ImageProvider.get("redo"));
    455                 break;
    456452            }
    457453        }
Note: See TracChangeset for help on using the changeset viewer.