Ignore:
Timestamp:
2017-04-10T00:14:42+02:00 (7 years ago)
Author:
Don-vip
Message:

findbugs - EI_EXPOSE_REP2 + javadoc

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
6 edited

Legend:

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

    r8510 r11878  
    1717public class ChangesetContentTableCellRenderer extends AbstractCellRenderer {
    1818
     19    /**
     20     * Renders primitive modification type.
     21     * @param type modification type
     22     */
    1923    protected void renderModificationType(ChangesetModificationType type) {
    2024        switch(type) {
     
    3539        switch(column) {
    3640        case 0:
    37             ChangesetModificationType type = (ChangesetModificationType) value;
    38             renderModificationType(type);
     41            renderModificationType((ChangesetModificationType) value);
    3942            break;
    4043        case 1:
    41             HistoryOsmPrimitive primitive = (HistoryOsmPrimitive) value;
    42             renderId(primitive.getId());
     44            renderId(((HistoryOsmPrimitive) value).getId());
    4345            break;
    4446        default:
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentTableModel.java

    r10619 r11878  
    1818/**
    1919 * This is the table model for the content of a changeset.
    20  *
     20 * @since 2689
    2121 */
    2222public class ChangesetContentTableModel extends AbstractTableModel {
     
    2525    private final DefaultListSelectionModel selectionModel;
    2626
     27    /**
     28     * Constructs a new {@code ChangesetContentTableModel}.
     29     * @param selectionModel selection model
     30     */
    2731    public ChangesetContentTableModel(DefaultListSelectionModel selectionModel) {
    2832        this.selectionModel = selectionModel;
     
    3842    }
    3943
     44    /**
     45     * Selects a single item by its index.
     46     * @param row index
     47     */
    4048    public void setSelectedByIdx(int row) {
    4149        selectionModel.setSelectionInterval(row, row);
     
    5058    }
    5159
     60    /**
     61     * Returns the selected history primitives.
     62     * @return the selected history primitives
     63     */
    5264    public Set<HistoryOsmPrimitive> getSelectedPrimitives() {
    5365        Set<HistoryOsmPrimitive> ret = new HashSet<>();
     
    7890    }
    7991
     92    /**
     93     * Sort data.
     94     */
    8095    protected void sort() {
    8196        data.sort((c1, c2) -> {
     
    130145     * The type used internally to keep information about {@link HistoryOsmPrimitive}
    131146     * with their {@link ChangesetModificationType}.
    132      *
    133147     */
    134148    private static class ChangesetContentEntry implements ChangesetDataSetEntry {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java

    r11848 r11878  
    1717import java.text.DateFormat;
    1818import java.util.Collections;
     19import java.util.Date;
    1920import java.util.HashSet;
    2021import java.util.Set;
     
    238239        DateFormat sdf = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.SHORT);
    239240
    240         tfCreatedOn.setText(cs.getCreatedAt() == null ? "" : sdf.format(cs.getCreatedAt()));
    241         tfClosedOn.setText(cs.getClosedAt() == null ? "" : sdf.format(cs.getClosedAt()));
     241        Date createdDate = cs.getCreatedAt();
     242        Date closedDate = cs.getClosedAt();
     243        tfCreatedOn.setText(createdDate == null ? "" : sdf.format(createdDate));
     244        tfClosedOn.setText(closedDate == null ? "" : sdf.format(closedDate));
    242245    }
    243246
  • trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java

    r11059 r11878  
    231231        protected final Pair<LatLon, LatLon> getCoordinates() {
    232232            HistoryOsmPrimitive p = getPrimitive();
     233            if (!(p instanceof HistoryNode)) return null;
    233234            HistoryOsmPrimitive opposite = getOppositePrimitive();
    234             if (!(p instanceof HistoryNode)) return null;
    235235            if (!(opposite instanceof HistoryNode)) return null;
    236236            HistoryNode node = (HistoryNode) p;
  • trunk/src/org/openstreetmap/josm/gui/io/ChangesetCellRenderer.java

    r11848 r11878  
    66import java.awt.Component;
    77import java.text.DateFormat;
     8import java.util.Date;
    89
    910import javax.swing.ImageIcon;
     
    3738        StringBuilder sb = new StringBuilder(64);
    3839        sb.append("<html><strong>").append(tr("Changeset id:")).append("</strong>").append(cs.getId()).append("<br>");
    39         if (cs.getCreatedAt() != null) {
     40        Date createdDate = cs.getCreatedAt();
     41        if (createdDate != null) {
    4042            sb.append("<strong>").append(tr("Created at:")).append("</strong>").append(
    41                     DateUtils.formatDateTime(cs.getCreatedAt(), DateFormat.SHORT, DateFormat.SHORT)).append("<br>");
     43                    DateUtils.formatDateTime(createdDate, DateFormat.SHORT, DateFormat.SHORT)).append("<br>");
    4244        }
    4345        String comment = cs.get("comment");
  • trunk/src/org/openstreetmap/josm/gui/widgets/DateEditorWithSlider.java

    r10611 r11878  
    9191
    9292    public void setRange(Date dateMin, Date dateMax) {
    93         this.dateMin = dateMin;
    94         this.dateMax = dateMax;
     93        this.dateMin = DateUtils.cloneDate(dateMin);
     94        this.dateMax = DateUtils.cloneDate(dateMax);
    9595    }
    9696
    9797    public void setDate(Date date) {
    98         spinner.setValue(date);
     98        spinner.setValue(DateUtils.cloneDate(date));
    9999    }
    100100
    101101    public Date getDate() {
    102         return (Date) spinner.getValue();
     102        return DateUtils.cloneDate((Date) spinner.getValue());
    103103    }
    104104
Note: See TracChangeset for help on using the changeset viewer.