Changeset 11330 in josm for trunk


Ignore:
Timestamp:
2016-11-27T17:06:21+01:00 (3 years ago)
Author:
Don-vip
Message:

sonar - fix recent issues

Location:
trunk
Files:
17 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java

    r11277 r11330  
    315315                getInputStream()) {
    316316            byte[] data = Utils.readBytesFromStream(in);
    317             if (data == null || data.length == 0) {
     317            if (data.length == 0) {
    318318                cf.clear();
    319319                throw new IllegalArgumentException("Could not read data from: " + baseUrl);
  • trunk/src/org/openstreetmap/josm/data/validation/TestError.java

    r11309 r11330  
    3131    private boolean ignored;
    3232    /** Severity */
    33     private Severity severity;
     33    private final Severity severity;
    3434    /** The error message */
    35     private String message;
     35    private final String message;
    3636    /** Deeper error description */
    3737    private final String description;
    3838    private final String descriptionEn;
    3939    /** The affected primitives */
    40     private Collection<? extends OsmPrimitive> primitives;
     40    private final Collection<? extends OsmPrimitive> primitives;
    4141    /** The primitives or way segments to be highlighted */
    4242    private final Collection<?> highlighted;
    4343    /** The tester that raised this error */
    44     private Test tester;
     44    private final Test tester;
    4545    /** Internal code used by testers to classify errors */
    4646    private final int code;
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMergeModel.java

    r11321 r11330  
    5454 * <ol>
    5555 *   <li>the table model and the list selection for for a  {@link JTable} which shows my entries.
    56  *    See {@link #getMyTableModel()} and {@link ListMergeModel#getMySelectionModel()}</li>
     56 *    See {@link #getMyTableModel()} and {@link AbstractListMergeModel#getMySelectionModel()}</li>
    5757 *   <li>dito for their entries and merged entries</li>
    5858 * </ol>
     
    6464 * ListMergeModel is an abstract class. Three methods have to be implemented by subclasses:
    6565 * <ul>
    66  *   <li>{@link ListMergeModel#cloneEntryForMergedList} - clones an entry of type T</li>
    67  *   <li>{@link ListMergeModel#isEqualEntry} - checks whether two entries are equals </li>
    68  *   <li>{@link ListMergeModel#setValueAt(DefaultTableModel, Object, int, int)} - handles values edited in
     66 *   <li>{@link AbstractListMergeModel#cloneEntryForMergedList} - clones an entry of type T</li>
     67 *   <li>{@link AbstractListMergeModel#isEqualEntry} - checks whether two entries are equals </li>
     68 *   <li>{@link AbstractListMergeModel#setValueAt(DefaultTableModel, Object, int, int)} - handles values edited in
    6969 *     a JTable, dispatched from {@link TableModel#setValueAt(Object, int, int)} </li>
    7070 * </ul>
    71  * A ListMergeModel is used in combination with a {@link ListMerger}.
     71 * A ListMergeModel is used in combination with a {@link AbstractListMerger}.
    7272 *
    7373 * @param <T> the type of the list entries
    7474 * @param <C> the type of conflict resolution command
    75  * @see ListMerger
     75 * @see AbstractListMerger
    7676 */
    77 public abstract class ListMergeModel<T extends PrimitiveId, C extends ConflictResolveCommand> extends ChangeNotifier {
    78     public static final String FROZEN_PROP = ListMergeModel.class.getName() + ".frozen";
     77public abstract class AbstractListMergeModel<T extends PrimitiveId, C extends ConflictResolveCommand> extends ChangeNotifier {
     78    public static final String FROZEN_PROP = AbstractListMergeModel.class.getName() + ".frozen";
    7979
    8080    private static final int MAX_DELETED_PRIMITIVE_IN_DIALOG = 5;
     
    190190     * Constructs a new {@code ListMergeModel}.
    191191     */
    192     public ListMergeModel() {
     192    public AbstractListMergeModel() {
    193193        entries = new EnumMap<>(ListRole.class);
    194194        for (ListRole role : ListRole.values()) {
     
    575575    /**
    576576     * This an adapter between a {@link JTable} and one of the three entry lists
    577      * in the role {@link ListRole} managed by the {@link ListMergeModel}.
     577     * in the role {@link ListRole} managed by the {@link AbstractListMergeModel}.
    578578     *
    579579     * From the point of view of the {@link JTable} it is a {@link TableModel}.
    580580     *
    581      * @see ListMergeModel#getMyTableModel()
    582      * @see ListMergeModel#getTheirTableModel()
    583      * @see ListMergeModel#getMergedTableModel()
     581     * @see AbstractListMergeModel#getMyTableModel()
     582     * @see AbstractListMergeModel#getTheirTableModel()
     583     * @see AbstractListMergeModel#getMergedTableModel()
    584584     */
    585585    public class EntriesTableModel extends DefaultTableModel implements OsmPrimitivesTableModel {
     
    614614        @Override
    615615        public void setValueAt(Object value, int row, int col) {
    616             ListMergeModel.this.setValueAt(this, value, row, col);
     616            AbstractListMergeModel.this.setValueAt(this, value, row, col);
    617617        }
    618618
     
    621621         * @return the list merge model
    622622         */
    623         public ListMergeModel<T, C> getListMergeModel() {
    624             return ListMergeModel.this;
     623        public AbstractListMergeModel<T, C> getListMergeModel() {
     624            return AbstractListMergeModel.this;
    625625        }
    626626
     
    632632         * participates in the current {@link ComparePairType}
    633633         *
    634          * @see ListMergeModel.ComparePairListModel#getSelectedComparePair()
     634         * @see AbstractListMergeModel.ComparePairListModel#getSelectedComparePair()
    635635         */
    636636        public boolean isParticipatingInCurrentComparePair() {
     
    720720    /**
    721721     * This is the selection model to be used in a {@link JTable} which displays
    722      * an entry list managed by {@link ListMergeModel}.
     722     * an entry list managed by {@link AbstractListMergeModel}.
    723723     *
    724724     * The model ensures that only rows displaying an entry in the entry list
    725725     * can be selected. "Empty" rows can't be selected.
    726726     *
    727      * @see ListMergeModel#getMySelectionModel()
    728      * @see ListMergeModel#getMergedSelectionModel()
    729      * @see ListMergeModel#getTheirSelectionModel()
     727     * @see AbstractListMergeModel#getMySelectionModel()
     728     * @see AbstractListMergeModel#getMergedSelectionModel()
     729     * @see AbstractListMergeModel#getTheirSelectionModel()
    730730     *
    731731     */
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMerger.java

    r11321 r11330  
    4848 * @param <T> the type of the entries
    4949 * @param <C> the type of conflict resolution command
    50  * @see ListMergeModel
     50 * @see AbstractListMergeModel
    5151 * @since 1631
    5252 */
    53 public abstract class ListMerger<T extends PrimitiveId, C extends ConflictResolveCommand> extends JPanel
     53public abstract class AbstractListMerger<T extends PrimitiveId, C extends ConflictResolveCommand> extends JPanel
    5454implements PropertyChangeListener, ChangeListener, IConflictResolver {
    5555    protected OsmPrimitivesTable myEntriesTable;
     
    5757    protected OsmPrimitivesTable theirEntriesTable;
    5858
    59     protected transient ListMergeModel<T, C> model;
     59    protected transient AbstractListMergeModel<T, C> model;
    6060
    6161    private CopyStartLeftAction copyStartLeftAction;
     
    409409     * @param model list merger model
    410410     */
    411     public ListMerger(ListMergeModel<T, C> model) {
     411    public AbstractListMerger(AbstractListMergeModel<T, C> model) {
    412412        this.model = model;
    413413        model.addChangeListener(this);
     
    859859    @Override
    860860    public void propertyChange(PropertyChangeEvent evt) {
    861         if (evt.getPropertyName().equals(ListMergeModel.FROZEN_PROP)) {
     861        if (evt.getPropertyName().equals(AbstractListMergeModel.FROZEN_PROP)) {
    862862            handlePropertyChangeFrozen((Boolean) evt.getOldValue(), (Boolean) evt.getNewValue());
    863863        }
     
    868868     * @return the model
    869869     */
    870     public ListMergeModel<T, C> getModel() {
     870    public AbstractListMergeModel<T, C> getModel() {
    871871        return model;
    872872    }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java

    r11318 r11330  
    163163     * @param evt the event
    164164     * @see TagMergeModel
    165      * @see ListMergeModel
     165     * @see AbstractListMergeModel
    166166     * @see PropertiesMergeModel
    167167     */
     
    181181            }
    182182            updateResolvedCompletely();
    183         } else if (evt.getPropertyName().equals(ListMergeModel.FROZEN_PROP)) {
     183        } else if (evt.getPropertyName().equals(AbstractListMergeModel.FROZEN_PROP)) {
    184184            boolean frozen = (Boolean) evt.getNewValue();
    185185            if (evt.getSource() == nodeListMerger.getModel() && my instanceof Way) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListRole.java

    r5266 r11330  
    33
    44/**
    5  * Enumeration of roles entry lists play in {@link ListMergeModel}
     5 * Enumeration of roles entry lists play in {@link AbstractListMergeModel}
    66 */
    77public enum ListRole {
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/PairTable.java

    r11318 r11330  
    1515public abstract class PairTable extends OsmPrimitivesTable {
    1616
    17     private final transient ListMergeModel<? extends PrimitiveId, ? extends ConflictResolveCommand> model;
     17    private final transient AbstractListMergeModel<? extends PrimitiveId, ? extends ConflictResolveCommand> model;
    1818
    1919    /**
     
    2525     * @param sm selection model
    2626     */
    27     public PairTable(String name, ListMergeModel<? extends PrimitiveId, ? extends ConflictResolveCommand> model,
     27    public PairTable(String name, AbstractListMergeModel<? extends PrimitiveId, ? extends ConflictResolveCommand> model,
    2828            OsmPrimitivesTableModel dm, TableColumnModel cm, ListSelectionModel sm) {
    2929        super(dm, cm, sm);
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModel.java

    r11318 r11330  
    1515import org.openstreetmap.josm.data.osm.PrimitiveId;
    1616import org.openstreetmap.josm.data.osm.Way;
    17 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
     17import org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel;
    1818import org.openstreetmap.josm.gui.conflict.pair.ListRole;
    1919
     
    2222 * @since 1622
    2323 */
    24 public class NodeListMergeModel extends ListMergeModel<Node, WayNodesConflictResolverCommand> {
     24public class NodeListMergeModel extends AbstractListMergeModel<Node, WayNodesConflictResolverCommand> {
    2525
    2626    /**
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMerger.java

    r11318 r11330  
    99import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1010import org.openstreetmap.josm.data.osm.Way;
    11 import org.openstreetmap.josm.gui.conflict.pair.ListMerger;
     11import org.openstreetmap.josm.gui.conflict.pair.AbstractListMerger;
    1212
    1313/**
     
    1515 * @since 1622
    1616 */
    17 public class NodeListMerger extends ListMerger<Node, WayNodesConflictResolverCommand> {
     17public class NodeListMerger extends AbstractListMerger<Node, WayNodesConflictResolverCommand> {
    1818
    1919    /**
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTable.java

    r11318 r11330  
    77import org.openstreetmap.josm.command.conflict.WayNodesConflictResolverCommand;
    88import org.openstreetmap.josm.data.osm.Node;
    9 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
     9import org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel;
    1010import org.openstreetmap.josm.gui.conflict.pair.PairTable;
    1111import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTableModel;
     
    2424     * @param sm selection model
    2525     */
    26     public NodeListTable(String name, ListMergeModel<Node, WayNodesConflictResolverCommand> model,
     26    public NodeListTable(String name, AbstractListMergeModel<Node, WayNodesConflictResolverCommand> model,
    2727            OsmPrimitivesTableModel dm, ListSelectionModel sm) {
    2828        super(name, model, dm, new NodeListColumnModel(new NodeListTableCellRenderer()), sm);
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java

    r11318 r11330  
    1616import org.openstreetmap.josm.gui.DefaultNameFormatter;
    1717import org.openstreetmap.josm.gui.conflict.ConflictColors;
    18 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
     18import org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel;
    1919import org.openstreetmap.josm.tools.ImageProvider;
    2020
     
    5555     * @param isSelected true, if the current row is selected
    5656     */
    57     protected void renderNode(ListMergeModel<Node, WayNodesConflictResolverCommand>.EntriesTableModel model, Node node,
     57    protected void renderNode(AbstractListMergeModel<Node, WayNodesConflictResolverCommand>.EntriesTableModel model, Node node,
    5858            int row, boolean isSelected) {
    5959        setIcon(icon);
     
    9090     * @param row the row index
    9191     */
    92     protected void renderRowId(ListMergeModel<Node, WayNodesConflictResolverCommand>.EntriesTableModel model, int row) {
     92    protected void renderRowId(AbstractListMergeModel<Node, WayNodesConflictResolverCommand>.EntriesTableModel model, int row) {
    9393        setIcon(null);
    9494        setBorder(rowNumberBorder);
     
    132132     */
    133133    @SuppressWarnings("unchecked")
    134     protected ListMergeModel<Node, WayNodesConflictResolverCommand>.EntriesTableModel getModel(JTable table) {
    135         return (ListMergeModel<Node, WayNodesConflictResolverCommand>.EntriesTableModel) table.getModel();
     134    protected AbstractListMergeModel<Node, WayNodesConflictResolverCommand>.EntriesTableModel getModel(JTable table) {
     135        return (AbstractListMergeModel<Node, WayNodesConflictResolverCommand>.EntriesTableModel) table.getModel();
    136136    }
    137137}
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java

    r11318 r11330  
    1414import org.openstreetmap.josm.data.osm.Relation;
    1515import org.openstreetmap.josm.data.osm.RelationMember;
    16 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
     16import org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel;
    1717import org.openstreetmap.josm.gui.conflict.pair.ListRole;
    1818import org.openstreetmap.josm.tools.CheckParameterUtil;
     
    2222 * @since 1631
    2323 */
    24 public class RelationMemberListMergeModel extends ListMergeModel<RelationMember, RelationMemberConflictResolverCommand> {
     24public class RelationMemberListMergeModel extends AbstractListMergeModel<RelationMember, RelationMemberConflictResolverCommand> {
    2525
    2626    @Override
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMerger.java

    r11318 r11330  
    99import org.openstreetmap.josm.data.osm.Relation;
    1010import org.openstreetmap.josm.data.osm.RelationMember;
    11 import org.openstreetmap.josm.gui.conflict.pair.ListMerger;
     11import org.openstreetmap.josm.gui.conflict.pair.AbstractListMerger;
    1212
    1313/**
     
    1515 * @since 1631
    1616 */
    17 public class RelationMemberMerger extends ListMerger<RelationMember, RelationMemberConflictResolverCommand> {
     17public class RelationMemberMerger extends AbstractListMerger<RelationMember, RelationMemberConflictResolverCommand> {
    1818
    1919    /**
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTable.java

    r11318 r11330  
    77import org.openstreetmap.josm.command.conflict.RelationMemberConflictResolverCommand;
    88import org.openstreetmap.josm.data.osm.RelationMember;
    9 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
     9import org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel;
    1010import org.openstreetmap.josm.gui.conflict.pair.PairTable;
    1111import org.openstreetmap.josm.gui.widgets.OsmPrimitivesTableModel;
     
    2424     * @param sm selection model
    2525     */
    26     public RelationMemberTable(String name, ListMergeModel<RelationMember, RelationMemberConflictResolverCommand> model,
     26    public RelationMemberTable(String name, AbstractListMergeModel<RelationMember, RelationMemberConflictResolverCommand> model,
    2727            OsmPrimitivesTableModel dm, ListSelectionModel sm) {
    2828        super(name, model, dm, new RelationMemberListColumnModel(), sm);
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRenderer.java

    r11318 r11330  
    1515import org.openstreetmap.josm.gui.DefaultNameFormatter;
    1616import org.openstreetmap.josm.gui.conflict.ConflictColors;
    17 import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
     17import org.openstreetmap.josm.gui.conflict.pair.AbstractListMergeModel;
    1818import org.openstreetmap.josm.tools.ImageProvider;
    1919
     
    4545    }
    4646
    47     protected void renderBackground(ListMergeModel<RelationMember, RelationMemberConflictResolverCommand>.EntriesTableModel model,
     47    protected void renderBackground(AbstractListMergeModel<RelationMember, RelationMemberConflictResolverCommand>.EntriesTableModel model,
    4848            RelationMember member, int row, int col, boolean isSelected) {
    4949        Color bgc = ConflictColors.BGCOLOR.get();
     
    7878    }
    7979
    80     protected void renderForeground(ListMergeModel<RelationMember, RelationMemberConflictResolverCommand>.EntriesTableModel model,
     80    protected void renderForeground(AbstractListMergeModel<RelationMember, RelationMemberConflictResolverCommand>.EntriesTableModel model,
    8181            RelationMember member, int row, int col, boolean isSelected) {
    8282        Color fgc = ConflictColors.FGCOLOR.get();
     
    148148     */
    149149    @SuppressWarnings("unchecked")
    150     protected ListMergeModel<RelationMember, RelationMemberConflictResolverCommand>.EntriesTableModel getModel(JTable table) {
    151         return (ListMergeModel<RelationMember, RelationMemberConflictResolverCommand>.EntriesTableModel) table.getModel();
     150    protected AbstractListMergeModel<RelationMember, RelationMemberConflictResolverCommand>.EntriesTableModel getModel(JTable table) {
     151        return (AbstractListMergeModel<RelationMember, RelationMemberConflictResolverCommand>.EntriesTableModel) table.getModel();
    152152    }
    153153}
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/OpenAndCloseStateRestrictionPanel.java

    r11326 r11330  
    2323 */
    2424public class OpenAndCloseStateRestrictionPanel extends JPanel implements RestrictionPanel {
     25
     26    private static final String PREF_ROOT = "changeset-query.advanced.open-restrictions";
     27    private static final String PREF_QUERY_TYPE = PREF_ROOT + ".query-type";
    2528
    2629    private final JRadioButton rbOpenOnly = new JRadioButton();
     
    105108     */
    106109    public void rememberSettings() {
    107         String prefRoot = "changeset-query.advanced.open-restrictions";
    108110        if (rbBoth.isSelected()) {
    109             Main.pref.put(prefRoot + ".query-type", "both");
     111            Main.pref.put(PREF_QUERY_TYPE, "both");
    110112        } else if (rbOpenOnly.isSelected()) {
    111             Main.pref.put(prefRoot + ".query-type", "open");
     113            Main.pref.put(PREF_QUERY_TYPE, "open");
    112114        } else if (rbClosedOnly.isSelected()) {
    113             Main.pref.put(prefRoot + ".query-type", "closed");
     115            Main.pref.put(PREF_QUERY_TYPE, "closed");
    114116        }
    115117    }
     
    119121     */
    120122    public void restoreFromSettings() {
    121         String prefRoot = "changeset-query.advanced.open-restrictions";
    122         String v = Main.pref.get(prefRoot + ".query-type", "open");
     123        String v = Main.pref.get(PREF_QUERY_TYPE, "open");
    123124        rbBoth.setSelected("both".equals(v));
    124125        rbOpenOnly.setSelected("open".equals(v));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UserRestrictionPanel.java

    r11326 r11330  
    3434 */
    3535public class UserRestrictionPanel extends JPanel implements RestrictionPanel {
     36    private static final String PREF_ROOT = "changeset-query.advanced.user-restrictions";
     37    private static final String PREF_QUERY_TYPE = PREF_ROOT + ".query-type";
     38
    3639    private final ButtonGroup bgUserRestrictions = new ButtonGroup();
    3740    private final JRadioButton rbRestrictToMyself = new JRadioButton();
     
    257260     */
    258261    public void rememberSettings() {
    259         String prefRoot = "changeset-query.advanced.user-restrictions";
    260262        if (rbRestrictToMyself.isSelected()) {
    261             Main.pref.put(prefRoot + ".query-type", "mine");
     263            Main.pref.put(PREF_QUERY_TYPE, "mine");
    262264        } else if (rbRestrictToUid.isSelected()) {
    263             Main.pref.put(prefRoot + ".query-type", "uid");
     265            Main.pref.put(PREF_QUERY_TYPE, "uid");
    264266        } else if (rbRestrictToUserName.isSelected()) {
    265             Main.pref.put(prefRoot + ".query-type", "username");
    266         }
    267         Main.pref.put(prefRoot + ".uid", tfUid.getText());
    268         Main.pref.put(prefRoot + ".username", tfUserName.getText());
     267            Main.pref.put(PREF_QUERY_TYPE, "username");
     268        }
     269        Main.pref.put(PREF_ROOT + ".uid", tfUid.getText());
     270        Main.pref.put(PREF_ROOT + ".username", tfUserName.getText());
    269271    }
    270272
     
    273275     */
    274276    public void restoreFromSettings() {
    275         String prefRoot = "changeset-query.advanced.user-restrictions";
    276         String v = Main.pref.get(prefRoot + ".query-type", "mine");
     277        String v = Main.pref.get(PREF_QUERY_TYPE, "mine");
    277278        if ("mine".equals(v)) {
    278279            JosmUserIdentityManager im = JosmUserIdentityManager.getInstance();
     
    287288            rbRestrictToUserName.setSelected(true);
    288289        }
    289         tfUid.setText(Main.pref.get(prefRoot + ".uid", ""));
     290        tfUid.setText(Main.pref.get(PREF_ROOT + ".uid", ""));
    290291        if (!valUid.isValid()) {
    291292            tfUid.setText("");
    292293        }
    293         tfUserName.setText(Main.pref.get(prefRoot + ".username", ""));
     294        tfUserName.setText(Main.pref.get(PREF_ROOT + ".username", ""));
    294295    }
    295296
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r11320 r11330  
    13661366     *
    13671367     * @param stream input stream
    1368      * @return byte array of data in input stream or null if stream is null
     1368     * @return byte array of data in input stream (empty if stream is null)
    13691369     * @throws IOException if any I/O error occurs
    13701370     */
    13711371    public static byte[] readBytesFromStream(InputStream stream) throws IOException {
    13721372        if (stream == null) {
    1373             return null;
     1373            return new byte[0];
    13741374        }
    13751375        try {
     
    13861386            } while (!finished);
    13871387            if (bout.size() == 0)
    1388                 return null;
     1388                return new byte[0];
    13891389            return bout.toByteArray();
    13901390        } finally {
    1391             if (stream != null) {
    1392                 stream.close();
    1393             }
     1391            stream.close();
    13941392        }
    13951393    }
  • trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java

    r11324 r11330  
    33
    44import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertNull;
    65
    76import java.io.IOException;
     
    170169    /**
    171170     * Tests if readBytesFromStream handles null streams (might happen when there is no data on error stream)
    172      * @throws IOException
    173      *
     171     * @throws IOException in case of I/O error
    174172     */
    175173    @Test
    176174    public void testNullStreamForReadBytesFromStream() throws IOException {
    177         assertNull("Null on null stream", Utils.readBytesFromStream(null));
     175        assertEquals("Empty on null stream", 0, Utils.readBytesFromStream(null).length);
    178176    }
    179 
    180177}
Note: See TracChangeset for help on using the changeset viewer.