Ignore:
Timestamp:
2020-11-29T10:33:58+01:00 (3 years ago)
Author:
GerdP
Message:

see #20167: [patch] Improve code readability by replacing indexed loops with foreach
Patch by gaben, slightly modified
I removed the changes for

  • GpxImageCorrelation.java, they introduce a TODO
  • ConnectivityRelations.java (no improvement in readability)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModelTest.java

    r17275 r17374  
    7676    protected void ensureSelected(DefaultListSelectionModel model, Object... idx) {
    7777        if (idx == null) return;
    78         for (int i = 0; i < idx.length; i++) {
    79             if (idx[i] instanceof Integer) {
    80                 int j = (Integer) idx[i];
     78        for (Object object : idx) {
     79            if (object instanceof Integer) {
     80                int j = (Integer) object;
    8181                assertTrue(model.isSelectedIndex(j), "expected row " + j + " to be selected");
    8282                break;
    8383            }
    84             int[] rows = (int[]) idx[i];
     84            int[] rows = (int[]) object;
    8585            if (rows.length != 2) {
    8686                fail("illegal selection range. Either null or not length 2: " + Arrays.toString(rows));
Note: See TracChangeset for help on using the changeset viewer.