Ignore:
Timestamp:
2015-05-02T00:55:19+02:00 (4 years ago)
Author:
Don-vip
Message:

fix potential NPEs and Sonar issues related to serialization

Location:
trunk/src/org/openstreetmap/josm/gui/history
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java

    r8291 r8308  
    3232
    3333    /** the model */
    34     private HistoryBrowserModel model;
     34    private transient HistoryBrowserModel model;
    3535    /** the common info panel for the history node in role REFERENCE_POINT_IN_TIME */
    3636    private VersionInfoPanel referenceInfoPanel;
     
    171171        private JLabel lblLat;
    172172        private JLabel lblLon;
    173         private HistoryBrowserModel model;
     173        private transient HistoryBrowserModel model;
    174174        private PointInTimeType role;
    175175
  • trunk/src/org/openstreetmap/josm/gui/history/DiffTableModel.java

    r8219 r8308  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.history;
    3 
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    53
    64import java.util.ArrayList;
     
    1614 */
    1715class DiffTableModel extends AbstractTableModel {
    18     private List<TwoColumnDiff.Item> rows = new ArrayList<>();
     16    private transient List<TwoColumnDiff.Item> rows = new ArrayList<>();
    1917    private boolean reversed = false;
    2018
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowser.java

    r6666 r8308  
    2424
    2525    /** the model */
    26     private HistoryBrowserModel model;
     26    private transient HistoryBrowserModel model;
    2727    private TagInfoViewer tagInfoViewer;
    2828    private NodeListViewer nodeListViewer;
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java

    r8291 r8308  
    531531    public class TagTableModel extends AbstractTableModel {
    532532
    533         private List<String> keys;
     533        private transient List<String> keys;
    534534        private PointInTimeType pointInTimeType;
    535535
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryViewerPanel.java

    r7937 r8308  
    1717 */
    1818public abstract class HistoryViewerPanel extends JPanel {
    19    
    20     protected HistoryBrowserModel model;
     19
     20    protected transient HistoryBrowserModel model;
    2121    protected VersionInfoPanel referenceInfoPanel;
    2222    protected VersionInfoPanel currentInfoPanel;
    23     protected AdjustmentSynchronizer adjustmentSynchronizer;
    24     protected SelectionSynchronizer selectionSynchronizer;
     23    protected transient AdjustmentSynchronizer adjustmentSynchronizer;
     24    protected transient SelectionSynchronizer selectionSynchronizer;
    2525
    2626    protected HistoryViewerPanel(HistoryBrowserModel model) {
     
    2828        build();
    2929    }
    30    
     30
    3131    private JScrollPane embedInScrollPane(JTable table) {
    3232        JScrollPane pane = new JScrollPane(table);
     
    3434        return pane;
    3535    }
    36    
     36
    3737    /**
    3838     * Sets the history browsing model.
     
    4848        }
    4949    }
    50    
     50
    5151    protected final void unregisterAsObserver(HistoryBrowserModel model) {
    5252        if (currentInfoPanel != null) {
     
    5757        }
    5858    }
    59    
     59
    6060    protected final void registerAsObserver(HistoryBrowserModel model) {
    6161        if (currentInfoPanel != null) {
     
    6666        }
    6767    }
    68    
     68
    6969    protected abstract JTable buildReferenceTable();
    70    
     70
    7171    protected abstract JTable buildCurrentTable();
    72    
     72
    7373    private void build() {
    7474        setLayout(new GridBagLayout());
  • trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java

    r8285 r8308  
    4848public class NodeListViewer extends JPanel {
    4949
    50     private HistoryBrowserModel model;
     50    private transient HistoryBrowserModel model;
    5151    private VersionInfoPanel referenceInfoPanel;
    5252    private VersionInfoPanel currentInfoPanel;
    53     private AdjustmentSynchronizer adjustmentSynchronizer;
    54     private SelectionSynchronizer selectionSynchronizer;
     53    private transient AdjustmentSynchronizer adjustmentSynchronizer;
     54    private transient SelectionSynchronizer selectionSynchronizer;
    5555    private NodeListPopupMenu popupMenu;
    5656
     
    215215
    216216    static class ZoomToNodeAction extends AbstractAction {
    217         private PrimitiveId primitiveId;
    218 
     217        private transient PrimitiveId primitiveId;
     218
     219        /**
     220         * Constructs a new {@code ZoomToNodeAction}.
     221         */
    219222        public ZoomToNodeAction() {
    220223            putValue(NAME, tr("Zoom to node"));
     
    258261
    259262    static class ShowHistoryAction extends AbstractAction {
    260         private PrimitiveId primitiveId;
    261 
     263        private transient PrimitiveId primitiveId;
     264
     265        /**
     266         * Constructs a new {@code ShowHistoryAction}.
     267         */
    262268        public ShowHistoryAction() {
    263269            putValue(NAME, tr("Show history"));
  • trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java

    r7005 r8308  
    3131    public static final Color BGCOLOR_SELECTED = new Color(143,170,255);
    3232
    33     private Map<OsmPrimitiveType, ImageIcon> icons;
     33    private transient Map<OsmPrimitiveType, ImageIcon> icons;
    3434
    3535    /**
  • trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java

    r8304 r8308  
    4646public class VersionInfoPanel extends JPanel implements Observer{
    4747    private PointInTimeType pointInTimeType;
    48     private HistoryBrowserModel model;
     48    private transient HistoryBrowserModel model;
    4949    private JMultilineLabel lblInfo;
    5050    private UrlLabel lblUser;
  • trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java

    r7933 r8308  
    4646public class VersionTable extends JTable implements Observer{
    4747    private VersionTablePopupMenu popupMenu;
    48     private final HistoryBrowserModel model;
     48    private final transient HistoryBrowserModel model;
    4949
    5050    protected void build() {
     
    148148
    149149    static class ChangesetInfoAction extends AbstractInfoAction {
    150         private HistoryOsmPrimitive primitive;
    151 
     150        private transient HistoryOsmPrimitive primitive;
     151
     152        /**
     153         * Constructs a new {@code ChangesetInfoAction}.
     154         */
    152155        public ChangesetInfoAction() {
    153156            super(true);
     
    178181
    179182    static class UserInfoAction extends AbstractInfoAction {
    180         private HistoryOsmPrimitive primitive;
    181 
     183        private transient HistoryOsmPrimitive primitive;
     184
     185        /**
     186         * Constructs a new {@code UserInfoAction}.
     187         */
    182188        public UserInfoAction() {
    183189            super(true);
Note: See TracChangeset for help on using the changeset viewer.