Changeset 19120 in josm for trunk/test


Ignore:
Timestamp:
2024-06-20T15:55:07+02:00 (5 months ago)
Author:
taylor.smock
Message:

See #17858: Update code for newer Java features

Also add a note that toUnmodifiableList does not like nulls.

Location:
trunk/test
Files:
2 edited

Legend:

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

    r17275 r19120  
    33
    44import java.awt.BorderLayout;
    5 import java.util.stream.Collectors;
    6 import java.util.stream.IntStream;
    75
    86import javax.swing.JFrame;
     
    2422            n1.put("key" + i, "value" + i);
    2523        }
    26         // Java 11: use String.repeat
    27         String note = IntStream.range(0, 50).mapToObj(i -> " A very long text ").collect(Collectors.joining());
     24        String note = " A very long text ".repeat(50);
    2825        n1.put("note", note);
    2926        w1.addNode(new Node(2));
  • trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetTest.java

    r18853 r19120  
    1414import java.util.HashMap;
    1515import java.util.Map;
    16 import java.util.stream.Collectors;
    17 import java.util.stream.IntStream;
    1816
    1917import org.junit.jupiter.api.Test;
     
    5755        // Add a map with too long values => IllegalArgumentException
    5856        keys = new HashMap<>();
    59         // Java 11: use String.repeat
    60         keys.put("test", IntStream.range(0, MAX_CHANGESET_TAG_LENGTH + 1).mapToObj(i -> "x").collect(Collectors.joining()));
     57        keys.put("test", "x".repeat(MAX_CHANGESET_TAG_LENGTH + 1));
    6158        try {
    6259            cs.setKeys(keys);
Note: See TracChangeset for help on using the changeset viewer.