Ignore:
Timestamp:
2017-01-31T23:27:09+01:00 (2 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib:PDP_POORLY_DEFINED_PARAMETER - Correctness - Method defines parameters more abstractly than needed to function properly

File:
1 edited

Legend:

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

    r11366 r11519  
    2020import javax.swing.event.TableModelEvent;
    2121import javax.swing.event.TableModelListener;
    22 import javax.swing.table.TableModel;
    2322
    2423import org.openstreetmap.josm.Main;
     
    318317    }
    319318
    320     private static PrimitiveId primitiveIdAtRow(TableModel model, int row) {
    321         DiffTableModel castedModel = (DiffTableModel) model;
    322         Long id = (Long) castedModel.getValueAt(row, 0).value;
     319    private static PrimitiveId primitiveIdAtRow(DiffTableModel model, int row) {
     320        Long id = (Long) model.getValueAt(row, 0).value;
    323321        return id == null ? null : new SimplePrimitiveId(id, OsmPrimitiveType.NODE);
    324322    }
     
    332330        protected int checkTableSelection(JTable table, Point p) {
    333331            int row = super.checkTableSelection(table, p);
    334             popupMenu.prepare(primitiveIdAtRow(table.getModel(), row));
     332            popupMenu.prepare(primitiveIdAtRow((DiffTableModel) table.getModel(), row));
    335333            return row;
    336334        }
     
    353351            if (row <= 0)
    354352                return;
    355             PrimitiveId pid = primitiveIdAtRow(table.getModel(), row);
     353            PrimitiveId pid = primitiveIdAtRow((DiffTableModel) table.getModel(), row);
    356354            if (pid == null || pid.isNew())
    357355                return;
Note: See TracChangeset for help on using the changeset viewer.