Changeset 8338 in josm


Ignore:
Timestamp:
2015-05-07T01:27:41+02:00 (5 years ago)
Author:
Don-vip
Message:

fix squid:S1319 - Declarations should use Java collection interfaces rather than specific implementation classes

Location:
trunk
Files:
94 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java

    r8285 r8338  
    1313import java.util.LinkedList;
    1414import java.util.List;
     15import java.util.Set;
    1516
    1617import javax.swing.JOptionPane;
     
    133134        List<Node> nodes = new LinkedList<>();
    134135        // fixNodes: All nodes for which the angle relative to center should not be modified
    135         HashSet<Node> fixNodes = new HashSet<>();
     136        Set<Node> fixNodes = new HashSet<>();
    136137        List<Way> ways = new LinkedList<>();
    137138        EastNorth center = null;
     
    156157            Way closedWay = new Way(w);
    157158            closedWay.addNode(w.firstNode());
    158             ArrayList<Way> usedWays = new ArrayList<>(1);
     159            List<Way> usedWays = new ArrayList<>(1);
    159160            usedWays.add(closedWay);
    160161            nodes = collectNodesAnticlockwise(usedWays);
    161162        } else if (!ways.isEmpty() && checkWaysArePolygon(ways)) {
    162163            // Case 2
    163             ArrayList<Node> inside = new ArrayList<>();
    164             ArrayList<Node> outside = new ArrayList<>();
     164            List<Node> inside = new ArrayList<>();
     165            List<Node> outside = new ArrayList<>();
    165166
    166167            for(Node n: nodes) {
     
    287288     */
    288289    private List<Node> collectNodesWithExternReferers(List<Way> ways) {
    289         ArrayList<Node> withReferrers = new ArrayList<>();
     290        List<Node> withReferrers = new ArrayList<>();
    290291        for(Way w: ways)
    291292            for(Node n: w.getNodes())
     
    301302     */
    302303    private List<Node> collectNodesAnticlockwise(List<Way> ways) {
    303         ArrayList<Node> nodes = new ArrayList<>();
     304        List<Node> nodes = new ArrayList<>();
    304305        Node firstNode = ways.get(0).firstNode();
    305306        Node lastNode = null;
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r8308 r8338  
    271271            DataSet dataset = Main.main.getCurrentDataSet();
    272272            if(dataset != null) {
    273                 ArrayList<DataSource> dataSources = new ArrayList<>(dataset.getDataSources());
     273                List<DataSource> dataSources = new ArrayList<>(dataset.getDataSources());
    274274                int s = dataSources.size();
    275275                if(s > 0) {
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r8182 r8338  
    1111import java.util.Collection;
    1212import java.util.Collections;
    13 import java.util.HashSet;
    1413import java.util.LinkedHashMap;
    1514import java.util.LinkedHashSet;
     
    184183        List<Command> resolution = CombinePrimitiveResolverDialog.launchIfNecessary(wayTags, ways, Collections.singleton(targetWay));
    185184
    186         LinkedList<Command> cmds = new LinkedList<>();
    187         LinkedList<Way> deletedWays = new LinkedList<>(ways);
     185        List<Command> cmds = new LinkedList<>();
     186        List<Way> deletedWays = new LinkedList<>(ways);
    188187        deletedWays.remove(targetWay);
    189188
     
    561560
    562561        protected Set<Node> getNodes(Stack<NodePair> pairs) {
    563             HashSet<Node> nodes = new LinkedHashSet<>(2*pairs.size());
     562            Set<Node> nodes = new LinkedHashSet<>(2*pairs.size());
    564563            for (NodePair pair: pairs) {
    565564                nodes.add(pair.getA());
     
    594593
    595594        protected List<Node> buildPathFromNodePairs(Stack<NodePair> path) {
    596             LinkedList<Node> ret = new LinkedList<>();
     595            List<Node> ret = new LinkedList<>();
    597596            for (NodePair pair: path) {
    598597                ret.add(pair.getA());
  • trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java

    r7732 r8338  
    164164    public static List<ExtensionFileFilter> getImportExtensionFileFilters() {
    165165        updateAllFormatsImporter();
    166         LinkedList<ExtensionFileFilter> filters = new LinkedList<>();
     166        List<ExtensionFileFilter> filters = new LinkedList<>();
    167167        for (FileImporter importer : importers) {
    168168            filters.add(importer.filter);
     
    181181     */
    182182    public static List<ExtensionFileFilter> getExportExtensionFileFilters() {
    183         LinkedList<ExtensionFileFilter> filters = new LinkedList<>();
     183        List<ExtensionFileFilter> filters = new LinkedList<>();
    184184        for (FileExporter exporter : exporters) {
    185185            if (filters.contains(exporter.filter) || !exporter.isEnabled()) {
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r8308 r8338  
    10711071        // This seems to appear when is apply over invalid way like #9911 test-case
    10721072        // Remove all of these way to make the next work.
    1073         ArrayList<WayInPolygon> cleanMultigonWays = new ArrayList<>();
     1073        List<WayInPolygon> cleanMultigonWays = new ArrayList<>();
    10741074        for(WayInPolygon way: multigonWays)
    10751075            if(way.way.getNodesCount() == 2 && way.way.firstNode() == way.way.lastNode())
     
    10831083        WayInPolygon startWay;
    10841084        while((startWay = traverser.startNewWay()) != null) {
    1085             ArrayList<WayInPolygon> path = new ArrayList<>();
     1085            List<WayInPolygon> path = new ArrayList<>();
    10861086            List<WayInPolygon> startWays = new ArrayList<>();
    10871087            path.add(startWay);
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r7859 r8338  
    283283
    284284        // put the nodes of all ways in a set
    285         final HashSet<Node> allNodes = new HashSet<>();
     285        final Set<Node> allNodes = new HashSet<>();
    286286        for (WayData w : wayDataList) {
    287287            for (Node n : w.way.getNodes()) {
     
    291291
    292292        // the new x and y value for each node
    293         final HashMap<Node, Double> nX = new HashMap<>();
    294         final HashMap<Node, Double> nY = new HashMap<>();
     293        final Map<Node, Double> nX = new HashMap<>();
     294        final Map<Node, Double> nY = new HashMap<>();
    295295
    296296        // calculate the centroid of all nodes
     
    314314        final Direction[][] ORIENTATIONS = {HORIZONTAL, VERTICAL};
    315315        for (Direction[] orientation : ORIENTATIONS){
    316             final HashSet<Node> s = new HashSet<>(allNodes);
     316            final Set<Node> s = new HashSet<>(allNodes);
    317317            int s_size = s.size();
    318318            for (int dummy = 0; dummy < s_size; ++dummy) {
     
    322322                final Node dummy_n = s.iterator().next();     // pick arbitrary element of s
    323323
    324                 final HashSet<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummy_n
    325                 cs.add(dummy_n);                              // walking only on horizontal / vertical segments
     324                final Set<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummy_n
     325                cs.add(dummy_n);                      // walking only on horizontal / vertical segments
    326326
    327327                boolean somethingHappened = true;
     
    349349                }
    350350
    351                 final HashMap<Node, Double> nC = (orientation == HORIZONTAL) ? nY : nX;
     351                final Map<Node, Double> nC = (orientation == HORIZONTAL) ? nY : nX;
    352352
    353353                double average = 0;
  • trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java

    r7005 r8338  
    119119
    120120        protected Map<OsmPrimitiveType, Integer> getSourceStatistics() {
    121             HashMap<OsmPrimitiveType, Integer> ret = new HashMap<>();
     121            Map<OsmPrimitiveType, Integer> ret = new HashMap<>();
    122122            for (OsmPrimitiveType type: OsmPrimitiveType.dataValues()) {
    123123                if (!getSourceTagsByType(type).isEmpty()) {
     
    129129
    130130        protected Map<OsmPrimitiveType, Integer> getTargetStatistics() {
    131             HashMap<OsmPrimitiveType, Integer> ret = new HashMap<>();
     131            Map<OsmPrimitiveType, Integer> ret = new HashMap<>();
    132132            for (OsmPrimitiveType type: OsmPrimitiveType.dataValues()) {
    133133                int count = OsmPrimitive.getFilteredList(target, type.getOsmClass()).size();
  • trunk/src/org/openstreetmap/josm/actions/PurgeAction.java

    r8308 r8338  
    101101        // Add referrer, unless the object to purge is not new
    102102        // and the parent is a relation
    103         HashSet<OsmPrimitive> toPurgeRecursive = new HashSet<>();
     103        Set<OsmPrimitive> toPurgeRecursive = new HashSet<>();
    104104        while (!toPurge.isEmpty()) {
    105105
  • trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java

    r8114 r8338  
    66import java.util.Collection;
    77import java.util.Collections;
     8import java.util.Map;
    89import java.util.TreeMap;
    910
     
    3940        }
    4041        final Node n = new Node(internalPoint);
    41         final TreeMap<Double, OsmPrimitive> found = new TreeMap<>();
     42        final Map<Double, OsmPrimitive> found = new TreeMap<>();
    4243        for (Way w : ds.getWays()) {
    4344            if (w.isUsable() && w.isClosed() && w.isSelectable()) {
  • trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java

    r8285 r8338  
    135135    public void extend(DataSet data) {
    136136        Collection<OsmPrimitive> currentSelection;
    137         LinkedList<OsmPrimitive> selection;
     137        Collection<OsmPrimitive> selection;
    138138        boolean selectionChanged = false;
    139139        Way way;
  • trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java

    r7509 r8338  
    1414import java.util.LinkedList;
    1515import java.util.List;
     16import java.util.Set;
    1617
    1718import javax.swing.JOptionPane;
     
    191192        }
    192193
    193         HashSet<Node> delNodes = new HashSet<>();
     194        Set<Node> delNodes = new HashSet<>();
    194195        delNodes.addAll(w.getNodes());
    195196        delNodes.removeAll(newNodes);
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r8318 r8338  
    167167     */
    168168    private void unglueNode(ActionEvent e) {
    169         LinkedList<Command> cmds = new LinkedList<>();
     169        List<Command> cmds = new LinkedList<>();
    170170
    171171        Node c = new Node(selectedNode);
     
    332332            }
    333333            Relation newRel = null;
    334             HashMap<String, Integer> rolesToReAdd = null; // <role name, index>
     334            Map<String, Integer> rolesToReAdd = null; // <role name, index>
    335335            int i = 0;
    336336            for (RelationMember rm : r.getMembers()) {
     
    361361     */
    362362    private void unglueWays() {
    363         LinkedList<Command> cmds = new LinkedList<>();
    364         LinkedList<Node> newNodes = new LinkedList<>();
     363        List<Command> cmds = new LinkedList<>();
     364        List<Node> newNodes = new LinkedList<>();
    365365
    366366        if (selectedWay == null) {
     
    409409    private boolean unglueSelfCrossingWay() {
    410410        // According to previous check, only one valid way through that node
    411         LinkedList<Command> cmds = new LinkedList<>();
     411        List<Command> cmds = new LinkedList<>();
    412412        Way way = null;
    413413        for (Way w: OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class))
     
    416416            }
    417417        List<Node> oldNodes = way.getNodes();
    418         ArrayList<Node> newNodes = new ArrayList<>(oldNodes.size());
    419         ArrayList<Node> addNodes = new ArrayList<>();
     418        List<Node> newNodes = new ArrayList<>(oldNodes.size());
     419        List<Node> addNodes = new ArrayList<>();
    420420        boolean seen = false;
    421421        for (Node n: oldNodes) {
     
    451451     */
    452452    private void unglueWays2() {
    453         LinkedList<Command> cmds = new LinkedList<>();
     453        List<Command> cmds = new LinkedList<>();
    454454        List<Node> allNewNodes = new LinkedList<>();
    455455        Way tmpWay = selectedWay;
  • trunk/src/org/openstreetmap/josm/actions/UploadAction.java

    r7402 r8338  
    1010import java.util.LinkedList;
    1111import java.util.List;
     12import java.util.Map;
    1213
    1314import javax.swing.JOptionPane;
     
    239240            @Override
    240241            public void run() {
    241                 final HashMap<String, String> tags = new HashMap<>(layer.data.getChangeSetTags());
     242                final Map<String, String> tags = new HashMap<>(layer.data.getChangeSetTags());
    242243                if (!tags.containsKey("source")) {
    243244                    tags.put("source", dialog.getLastChangesetSourceFromHistory());
  • trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java

    r8291 r8338  
    6969
    7070    protected Set<OsmPrimitive> getDeletedPrimitives(DataSet ds) {
    71         HashSet<OsmPrimitive> ret = new HashSet<>();
     71        Set<OsmPrimitive> ret = new HashSet<>();
    7272        for (OsmPrimitive p: ds.allPrimitives()) {
    7373            if (p.isDeleted() && !p.isNew() && p.isVisible() && p.isModified()) {
     
    7979
    8080    protected Set<OsmPrimitive> getModifiedPrimitives(Collection<OsmPrimitive> primitives) {
    81         HashSet<OsmPrimitive> ret = new HashSet<>();
     81        Set<OsmPrimitive> ret = new HashSet<>();
    8282        for (OsmPrimitive p: primitives) {
    8383            if (p.isNewOrUndeleted()) {
     
    306306         */
    307307        protected Set<OsmPrimitive> getPrimitivesToCheckForParents() {
    308             HashSet<OsmPrimitive> ret = new HashSet<>();
     308            Set<OsmPrimitive> ret = new HashSet<>();
    309309            for (OsmPrimitive p: toUpload) {
    310310                if (p.isDeleted() && !p.isNewOrUndeleted()) {
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java

    r7005 r8338  
    126126     */
    127127    protected Set<OsmPrimitive> getCompletePrimitives(DataSet ds) {
    128         HashSet<OsmPrimitive> ret = new HashSet<>();
     128        Set<OsmPrimitive> ret = new HashSet<>();
    129129        for (OsmPrimitive primitive : ds.allPrimitives()) {
    130130            if (!primitive.isIncomplete() && !primitive.isNew()) {
     
    216216     */
    217217    public Set<OsmPrimitive> getDownloadedPrimitives() {
    218         HashSet<OsmPrimitive> ret = new HashSet<>();
     218        Set<OsmPrimitive> ret = new HashSet<>();
    219219        for (DownloadTask task : tasks) {
    220220            if (task instanceof DownloadOsmTask) {
     
    253253                }
    254254            }
    255             LinkedHashSet<Object> errors = new LinkedHashSet<>();
     255            Set<Object> errors = new LinkedHashSet<>();
    256256            for (DownloadTask dt : tasks) {
    257257                errors.addAll(dt.getErrorObjects());
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java

    r7005 r8338  
    88import java.util.LinkedHashSet;
    99import java.util.List;
     10import java.util.Set;
    1011import java.util.concurrent.Future;
    1112
     
    7778        // make sure errors are reported only once
    7879        //
    79         LinkedHashSet<Object> errors = new LinkedHashSet<>();
     80        Set<Object> errors = new LinkedHashSet<>();
    8081        errors.addAll(task.getErrorObjects());
    8182        if (errors.isEmpty())
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r8308 r8338  
    950950
    951951    private static void pruneSuccsAndReverse(List<Integer> is) {
    952         HashSet<Integer> is2 = new HashSet<>();
     952        Set<Integer> is2 = new HashSet<>();
    953953        for (int i : is) {
    954954            if (!is2.contains(i - 1) && !is2.contains(i + 1)) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r8308 r8338  
    101101     * Collection of nodes that is moved
    102102     */
    103     private ArrayList<Node> movingNodeList;
     103    private List<Node> movingNodeList;
    104104
    105105    /**
     
    626626        boolean segmentAngleZero = prevNode != null && Math.abs(Geometry.getCornerAngle(prevNode.getEastNorth(), initialN1en, newN1en)) < 1e-5;
    627627        boolean hasOtherWays = hasNodeOtherWays(selectedSegment.getFirstNode(), selectedSegment.way);
    628         ArrayList<Node> changedNodes = new ArrayList<>();
     628        List<Node> changedNodes = new ArrayList<>();
    629629        if (nodeOverlapsSegment && !alwaysCreateNodes && !hasOtherWays) {
    630630            //move existing node
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java

    r8285 r8338  
    88import java.util.HashSet;
    99import java.util.List;
     10import java.util.Map;
    1011import java.util.Set;
    1112
     
    4041        // Make a deep copy of the ways, keeping the copied ways connected
    4142        // TODO: This assumes the first/last nodes of the ways are the only possible shared nodes.
    42         HashMap<Node, Node> splitNodeMap = new HashMap<>(sourceWays.size());
     43        Map<Node, Node> splitNodeMap = new HashMap<>(sourceWays.size());
    4344        for (Way w : sourceWays) {
    4445            if (!splitNodeMap.containsKey(w.firstNode())) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r8318 r8338  
    248248        determineMapMode(!c.isEmpty());
    249249
    250         HashSet<OsmPrimitive> newHighlights = new HashSet<>();
     250        Set<OsmPrimitive> newHighlights = new HashSet<>();
    251251
    252252        virtualManager.clear();
  • trunk/src/org/openstreetmap/josm/actions/relation/SelectMembersAction.java

    r7937 r8338  
    66import java.awt.event.ActionEvent;
    77import java.util.HashSet;
     8import java.util.Set;
    89
    910import org.openstreetmap.josm.Main;
     
    1718 */
    1819public class SelectMembersAction extends AbstractRelationAction {
    19    
     20
    2021    private final boolean add;
    2122
     
    3536    public void actionPerformed(ActionEvent e) {
    3637        if (!isEnabled() || relations.isEmpty() || !Main.isDisplayingMapView()) return;
    37        
    38         HashSet<OsmPrimitive> members = new HashSet<>();
     38
     39        Set<OsmPrimitive> members = new HashSet<>();
    3940        for (Relation r: relations) {
    4041            members.addAll(r.getMemberPrimitives());
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r8332 r8338  
    2323import java.util.List;
    2424import java.util.Map;
     25import java.util.Set;
    2526
    2627import javax.swing.ButtonGroup;
     
    109110            searchHistory.removeLast();
    110111        }
    111         LinkedHashSet<String> savedHistory = new LinkedHashSet<>(searchHistory.size());
     112        Set<String> savedHistory = new LinkedHashSet<>(searchHistory.size());
    112113        for (SearchSetting item: searchHistory) {
    113114            savedHistory.add(item.writeToString());
  • trunk/src/org/openstreetmap/josm/actions/upload/DiscardTagsHook.java

    r7937 r8338  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.util.AbstractMap;
    76import java.util.Collection;
    87import java.util.HashMap;
    98import java.util.HashSet;
    109import java.util.List;
     10import java.util.Map;
    1111
    1212import org.openstreetmap.josm.Main;
     
    3737
    3838        if (needsChange) {
    39             AbstractMap<String, String> map = new HashMap<>();
     39            Map<String, String> map = new HashMap<>();
    4040            for (String key : discardableKeys) {
    4141                map.put(key, null);
  • trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java

    r8285 r8338  
    190190
    191191        for (OsmPrimitive osm : objectsToUpload) {
    192             HashMap<String, String> keys = new HashMap<>(osm.getKeys());
     192            Map<String, String> keys = new HashMap<>(osm.getKeys());
    193193            if(!keys.isEmpty()) {
    194194                boolean modified = false;
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r7005 r8338  
    66import static org.openstreetmap.josm.tools.I18n.trn;
    77
    8 import java.util.AbstractMap;
    98import java.util.ArrayList;
    109import java.util.Arrays;
     
    4039     * those objects that do not have the key yet.
    4140     */
    42     private final AbstractMap<String, String> tags;
     41    private final Map<String, String> tags;
    4342
    4443    /**
     
    4847     * @param tags the tags to set
    4948     */
    50     public ChangePropertyCommand(Collection<? extends OsmPrimitive> objects, AbstractMap<String, String> tags) {
     49    public ChangePropertyCommand(Collection<? extends OsmPrimitive> objects, Map<String, String> tags) {
    5150        this.objects = new LinkedList<>();
    5251        this.tags = tags;
  • trunk/src/org/openstreetmap/josm/command/PurgeCommand.java

    r7005 r8338  
    201201        List<Relation> outR = new ArrayList<>(inR.size());
    202202
    203         HashMap<Relation, Integer> numChilds = new HashMap<>();
     203        Map<Relation, Integer> numChilds = new HashMap<>();
    204204
    205205        // calculate initial number of childs
  • trunk/src/org/openstreetmap/josm/data/APIDataSet.java

    r8291 r8338  
    185185     */
    186186    public List<OsmPrimitive> getPrimitives() {
    187         LinkedList<OsmPrimitive> ret = new LinkedList<>();
     187        List<OsmPrimitive> ret = new LinkedList<>();
    188188        ret.addAll(toAdd);
    189189        ret.addAll(toUpdate);
     
    218218     */
    219219    public void adjustRelationUploadOrder() throws CyclicUploadDependencyException{
    220         LinkedList<OsmPrimitive> newToAdd = new LinkedList<>();
     220        List<OsmPrimitive> newToAdd = new LinkedList<>();
    221221        newToAdd.addAll(Utils.filteredCollection(toAdd, Node.class));
    222222        newToAdd.addAll(Utils.filteredCollection(toAdd, Way.class));
     
    231231        toAdd = newToAdd;
    232232
    233         LinkedList<OsmPrimitive> newToDelete = new LinkedList<>();
     233        List<OsmPrimitive> newToDelete = new LinkedList<>();
    234234        graph = new RelationUploadDependencyGraph(Utils.filteredCollection(toDelete, Relation.class), false);
    235235        newToDelete.addAll(graph.computeUploadOrder());
  • trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java

    r8308 r8338  
    2121import java.util.Map;
    2222import java.util.Map.Entry;
     23import java.util.Set;
    2324import java.util.SortedMap;
    2425import java.util.TreeMap;
     
    202203     */
    203204    public static void exportPreferencesKeysToFile(String filename, boolean append, String... keys) {
    204         HashSet<String> keySet = new HashSet<>();
     205        Set<String> keySet = new HashSet<>();
    205206        Collections.addAll(keySet, keys);
    206207        exportPreferencesKeysToFile(filename, append, keySet);
  • trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java

    r8291 r8338  
    320320     */
    321321    public Set<OsmPrimitive> getMyConflictParties() {
    322         HashSet<OsmPrimitive> ret = new HashSet<>();
     322        Set<OsmPrimitive> ret = new HashSet<>();
    323323        for (Conflict<?> c: conflicts) {
    324324            ret.add(c.getMy());
     
    326326        return ret;
    327327    }
     328
    328329    /**
    329330     * Replies the set of  {@link OsmPrimitive} which participate in the role
     
    334335     */
    335336    public Set<OsmPrimitive> getTheirConflictParties() {
    336         HashSet<OsmPrimitive> ret = new HashSet<>();
     337        Set<OsmPrimitive> ret = new HashSet<>();
    337338        for (Conflict<?> c: conflicts) {
    338339            ret.add(c.getTheir());
  • trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java

    r7005 r8338  
    8686
    8787    public static void saveBookmarks() {
    88         LinkedList<Collection<String>> coll = new LinkedList<>();
     88        List<Collection<String>> coll = new LinkedList<>();
    8989        for (OffsetBookmark b : allBookmarks) {
    9090            coll.add(b.getInfoArray());
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java

    r7079 r8338  
    4848    private final Map<Integer, Changeset> cache = new HashMap<>();
    4949
    50     private final CopyOnWriteArrayList<ChangesetCacheListener> listeners =
    51         new CopyOnWriteArrayList<>();
     50    private final CopyOnWriteArrayList<ChangesetCacheListener> listeners = new CopyOnWriteArrayList<>();
    5251
    5352    private ChangesetCache() {
  • trunk/src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java

    r8291 r8338  
    116116    public Set<HistoryOsmPrimitive> getPrimitivesByModificationType(ChangesetModificationType cmt) {
    117117        CheckParameterUtil.ensureParameterNotNull(cmt,"cmt");
    118         HashSet<HistoryOsmPrimitive> ret = new HashSet<>();
     118        Set<HistoryOsmPrimitive> ret = new HashSet<>();
    119119        for (Entry<PrimitiveId, ChangesetModificationType> entry: modificationTypes.entrySet()) {
    120120            if (entry.getValue().equals(cmt)) {
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r8291 r8338  
    729729        boolean changed;
    730730        synchronized (selectionLock) {
    731             LinkedHashSet<OsmPrimitive> oldSelection = new LinkedHashSet<>(selectedPrimitives);
     731            Set<OsmPrimitive> oldSelection = new LinkedHashSet<>(selectedPrimitives);
    732732            selectedPrimitives = new LinkedHashSet<>();
    733733            addSelected(selection, false);
     
    878878        try {
    879879            DataSet ds = new DataSet();
    880             HashMap<OsmPrimitive, OsmPrimitive> primMap = new HashMap<>();
     880            Map<OsmPrimitive, OsmPrimitive> primMap = new HashMap<>();
    881881            for (Node n : nodes) {
    882882                Node newNode = new Node(n);
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r8291 r8338  
    264264        if (target == null)
    265265            throw new IllegalStateException(tr("Missing merge target for relation with id {0}", source.getUniqueId()));
    266         LinkedList<RelationMember> newMembers = new LinkedList<>();
     266        List<RelationMember> newMembers = new LinkedList<>();
    267267        for (RelationMember sourceMember : source.getMembers()) {
    268268            OsmPrimitive targetMember = getMergeTarget(sourceMember.getMember());
  • trunk/src/org/openstreetmap/josm/data/osm/NoteData.java

    r8224 r8338  
    77import java.util.Comparator;
    88import java.util.Date;
     9import java.util.List;
    910import java.util.Map;
    1011
     
    113114     */
    114115    public Collection<Note> getSortedNotes() {
    115         final ArrayList<Note> list = new ArrayList<>(noteList);
     116        final List<Note> list = new ArrayList<>(noteList);
    116117        Collections.sort(list, comparator);
    117118        return list;
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r8291 r8338  
    161161     */
    162162    public static Set<OsmPrimitive> getReferrer(Collection<? extends OsmPrimitive> primitives) {
    163         HashSet<OsmPrimitive> ret = new HashSet<>();
     163        Set<OsmPrimitive> ret = new HashSet<>();
    164164        if (primitives == null || primitives.isEmpty()) return ret;
    165165        for (OsmPrimitive p: primitives) {
     
    173173     */
    174174    public static final Predicate<OsmPrimitive> isUsablePredicate = new Predicate<OsmPrimitive>() {
    175         @Override public boolean evaluate(OsmPrimitive primitive) {
     175        @Override
     176        public boolean evaluate(OsmPrimitive primitive) {
    176177            return primitive.isUsable();
    177178        }
     
    179180
    180181    public static final Predicate<OsmPrimitive> isSelectablePredicate = new Predicate<OsmPrimitive>() {
    181         @Override public boolean evaluate(OsmPrimitive primitive) {
     182        @Override
     183        public boolean evaluate(OsmPrimitive primitive) {
    182184            return primitive.isSelectable();
    183185        }
     
    665667    public static Collection<String> getUninterestingKeys() {
    666668        if (uninteresting == null) {
    667             LinkedList<String> l = new LinkedList<>(Arrays.asList(
     669            List<String> l = new LinkedList<>(Arrays.asList(
    668670                "source", "source_ref", "source:", "comment",
    669671                "converted_by", "watch", "watch:",
     
    13641366     */
    13651367    public static Set<Relation> getParentRelations(Collection<? extends OsmPrimitive> primitives) {
    1366         HashSet<Relation> ret = new HashSet<>();
     1368        Set<Relation> ret = new HashSet<>();
    13671369        for (OsmPrimitive w : primitives) {
    13681370            ret.addAll(OsmPrimitive.getFilteredList(w.getReferrers(), Relation.class));
  • trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java

    r8318 r8338  
    477477    }
    478478
    479     public ArrayList<T> toArrayList() {
    480         ArrayList<T> a = new ArrayList<>();
     479    public List<T> toList() {
     480        List<T> a = new ArrayList<>();
    481481        for (T n : this) {
    482482            a.add(n);
     
    487487    @Override
    488488    public Object[] toArray() {
    489         return this.toArrayList().toArray();
     489        return this.toList().toArray();
    490490    }
    491491
    492492    @Override
    493493    public <A> A[] toArray(A[] template) {
    494         return this.toArrayList().toArray(template);
     494        return this.toList().toArray(template);
    495495    }
    496496
  • trunk/src/org/openstreetmap/josm/data/osm/Relation.java

    r8291 r8338  
    388388     */
    389389    public Set<OsmPrimitive> getMemberPrimitives() {
    390         HashSet<OsmPrimitive> ret = new HashSet<>();
     390        Set<OsmPrimitive> ret = new HashSet<>();
    391391        RelationMember[] members = this.members;
    392392        for (RelationMember m: members) {
  • trunk/src/org/openstreetmap/josm/data/osm/SimplePrimitiveId.java

    r8308 r8338  
    9797     */
    9898    public static List<SimplePrimitiveId> fuzzyParse(String s) {
    99         final ArrayList<SimplePrimitiveId> ids = new ArrayList<>();
     99        final List<SimplePrimitiveId> ids = new ArrayList<>();
    100100        final Matcher m = ID_PATTERN.matcher(s);
    101101        while (m.find()) {
  • trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java

    r8291 r8338  
    499499     */
    500500    public Set<String> getKeys() {
    501         HashSet<String> ret = new HashSet<>();
     501        Set<String> ret = new HashSet<>();
    502502        for (Tag tag: tags) {
    503503            ret.add(tag.getKey());
     
    512512     */
    513513    public Set<String> getKeysWithMultipleValues() {
    514         HashMap<String, Integer> counters = new HashMap<>();
     514        Map<String, Integer> counters = new HashMap<>();
    515515        for (Tag tag: tags) {
    516516            Integer v = counters.get(tag.getKey());
     
    557557     */
    558558    public Set<String> getValues() {
    559         HashSet<String> ret = new HashSet<>();
     559        Set<String> ret = new HashSet<>();
    560560        for (Tag tag: tags) {
    561561            ret.add(tag.getValue());
     
    573573     */
    574574    public Set<String> getValues(String key) {
    575         HashSet<String> ret = new HashSet<>();
     575        Set<String> ret = new HashSet<>();
    576576        if (key == null) return ret;
    577577        for (Tag tag: tags) {
  • trunk/src/org/openstreetmap/josm/data/osm/TigerUtils.java

    r7509 r8338  
    4646
    4747    public static String combineTags(String name, Set<String> values) {
    48         TreeSet<Object> resultSet = new TreeSet<>();
     48        Set<Object> resultSet = new TreeSet<>();
    4949        for (String value: values) {
    5050            String[] parts = value.split(":");
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r8325 r8338  
    168168     */
    169169    public Set<Node> getNeighbours(Node node) {
    170         HashSet<Node> neigh = new HashSet<>();
     170        Set<Node> neigh = new HashSet<>();
    171171
    172172        if (node == null) return neigh;
  • trunk/src/org/openstreetmap/josm/data/osm/history/HistoryDataSet.java

    r8291 r8338  
    99import java.util.List;
    1010import java.util.Map;
     11import java.util.Set;
    1112import java.util.concurrent.CopyOnWriteArrayList;
    1213
     
    187188
    188189    public Collection<Long> getChangesetIds() {
    189         final HashSet<Long> ids = new HashSet<>();
     190        final Set<Long> ids = new HashSet<>();
    190191        for (Collection<HistoryOsmPrimitive> i : data.values()) {
    191192            for (HistoryOsmPrimitive j : i) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java

    r7005 r8338  
    386386        if (!isFixable(testError)) return null;
    387387        Collection<OsmPrimitive> sel = new LinkedList<>(testError.getPrimitives());
    388         LinkedHashSet<Node> nodes = new LinkedHashSet<>(OsmPrimitive.getFilteredList(sel, Node.class));
     388        Set<Node> nodes = new LinkedHashSet<>(OsmPrimitive.getFilteredList(sel, Node.class));
    389389
    390390        // Filter nodes that have already been deleted (see #5764 and #5773)
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java

    r7937 r8338  
    229229        if (testError.getCode() == SAME_RELATION) return null;
    230230        Collection<? extends OsmPrimitive> sel = testError.getPrimitives();
    231         HashSet<Relation> relFix = new HashSet<>();
     231        Set<Relation> relFix = new HashSet<>();
    232232
    233233        for (OsmPrimitive osm : sel)
     
    292292        // We fix it only if there is no more than one relation that is relation member.
    293293        Collection<? extends OsmPrimitive> sel = testError.getPrimitives();
    294         HashSet<Relation> relations = new HashSet<>();
     294        Set<Relation> relations = new HashSet<>();
    295295
    296296        for (OsmPrimitive osm : sel)
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java

    r7721 r8338  
    237237    public Command fixError(TestError testError) {
    238238        Collection<? extends OsmPrimitive> sel = testError.getPrimitives();
    239         HashSet<Way> ways = new HashSet<>();
     239        Set<Way> ways = new HashSet<>();
    240240
    241241        for (OsmPrimitive osm : sel) {
     
    305305        // We fix it only if there is no more than one way that is relation member.
    306306        Collection<? extends OsmPrimitive> sel = testError.getPrimitives();
    307         HashSet<Way> ways = new HashSet<>();
     307        Set<Way> ways = new HashSet<>();
    308308
    309309        for (OsmPrimitive osm : sel) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java

    r8285 r8338  
    1212import java.util.Locale;
    1313import java.util.Map;
     14import java.util.Set;
    1415
    1516import org.openstreetmap.josm.command.ChangePropertyCommand;
     
    152153        }
    153154
    154         final HashSet<OsmPrimitive> referrers = new HashSet<>();
     155        final Set<OsmPrimitive> referrers = new HashSet<>();
    155156
    156157        if (way.isClosed()) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java

    r8239 r8338  
    66import java.util.HashSet;
    77import java.util.Map.Entry;
     8import java.util.Set;
    89import java.util.regex.Pattern;
    910
     
    6061    @Override
    6162    public void check(OsmPrimitive p) {
    62         HashSet<String> names = new HashSet<>();
     63        Set<String> names = new HashSet<>();
    6364
    6465        for (Entry<String, String> entry : p.getKeys().entrySet()) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java

    r7941 r8338  
    1010import java.util.HashMap;
    1111import java.util.LinkedList;
     12import java.util.List;
    1213import java.util.Map;
    1314
     
    8485
    8586    private static class RolePreset {
    86         public RolePreset(LinkedList<Role> roles, String name) {
     87        public RolePreset(List<Role> roles, String name) {
    8788            this.roles = roles;
    8889            this.name = name;
    8990        }
    90         private final LinkedList<Role> roles;
     91        private final List<Role> roles;
    9192        private final String name;
    9293    }
     
    151152                for(Role role: r.roles) {
    152153                    String key = role.key;
    153                     LinkedList<Role> roleGroup = null;
     154                    List<Role> roleGroup = null;
    154155                    if (allroles.containsKey(key)) {
    155156                        roleGroup = allroles.get(key).roles;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWay.java

    r7005 r8338  
    66import java.util.Arrays;
    77import java.util.HashSet;
     8import java.util.Set;
    89
    910import org.openstreetmap.josm.data.osm.Node;
     
    2930    }
    3031
    31     @Override public void visit(Way w) {
    32         HashSet<Node> nodes = new HashSet<>();
     32    @Override
     33    public void visit(Way w) {
     34        Set<Node> nodes = new HashSet<>();
    3335
    3436        for (int i = 1; i < w.getNodesCount() - 1; i++) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java

    r7848 r8338  
    4040    private MultiMap<Way, Way> errorWays;
    4141
    42     private ArrayList<NormalizeRule> rules = new ArrayList<NormalizeRule>();
     42    private List<NormalizeRule> rules = new ArrayList<NormalizeRule>();
    4343
    4444    /**
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r8308 r8338  
    684684    private Map<Double, List<Node>> getNearestNodesImpl(Point p,
    685685            Predicate<OsmPrimitive> predicate) {
    686         TreeMap<Double, List<Node>> nearestMap = new TreeMap<>();
     686        Map<Double, List<Node>> nearestMap = new TreeMap<>();
    687687        DataSet ds = getCurrentDataSet();
    688688
  • trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java

    r8308 r8338  
    229229
    230230        public Set<OsmPrimitive> getObjectsToDelete() {
    231             HashSet<OsmPrimitive> ret = new HashSet<>();
     231            Set<OsmPrimitive> ret = new HashSet<>();
    232232            for (RelationToChildReference ref: data) {
    233233                ret.add(ref.getChild());
     
    241241
    242242        public Set<OsmPrimitive> getParentRelations() {
    243             HashSet<OsmPrimitive> ret = new HashSet<>();
     243            Set<OsmPrimitive> ret = new HashSet<>();
    244244            for (RelationToChildReference ref: data) {
    245245                ret.add(ref.getParent());
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java

    r8308 r8338  
    731731        private final transient List<T> entries;
    732732
    733         public EntriesSelectionModel(ArrayList<T> nodes) {
     733        public EntriesSelectionModel(List<T> nodes) {
    734734            this.entries = nodes;
    735735        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r8308 r8338  
    253253
    254254    protected List<Command> buildTagChangeCommand(OsmPrimitive primitive, TagCollection tc) {
    255         LinkedList<Command> cmds = new LinkedList<>();
     255        List<Command> cmds = new LinkedList<>();
    256256        for (String key : tc.getKeys()) {
    257257            if (tc.hasUniqueEmptyValue(key)) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java

    r8308 r8338  
    287287
    288288        protected Map<User, Integer> computeStatistics(Collection<? extends OsmPrimitive> primitives) {
    289             HashMap<User, Integer> ret = new HashMap<>();
     289            Map<User, Integer> ret = new HashMap<>();
    290290            if (primitives == null || primitives.isEmpty()) return ret;
    291291            for (OsmPrimitive primitive: primitives) {
     
    354354
    355355        public List<User> getSelectedUsers(int[] rows) {
    356             LinkedList<User> ret = new LinkedList<>();
     356            List<User> ret = new LinkedList<>();
    357357            if (rows == null || rows.length == 0) return ret;
    358358            for (int row: rows) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r8308 r8338  
    190190        Set<DefaultMutableTreeNode> processedNodes = new HashSet<>();
    191191
    192         LinkedList<TestError> errorsToFix = new LinkedList<>();
     192        List<TestError> errorsToFix = new LinkedList<>();
    193193        for (TreePath path : selectionPaths) {
    194194            DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
     
    548548            tree.setFilter(null);
    549549        }
    550         HashSet<OsmPrimitive> filter = new HashSet<>(newSelection);
    551         tree.setFilter(filter);
     550        tree.setFilter(new HashSet<>(newSelection));
    552551    }
    553552
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetHeaderDownloadTask.java

    r8291 r8338  
    6565        }
    6666
    67         HashSet<Integer> ids = new HashSet<>();
     67        Set<Integer> ids = new HashSet<>();
    6868        for (Changeset cs: changesets) {
    6969            if (cs == null || cs.isNew()) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r8308 r8338  
    608608        final Map<String, String> tags = new HashMap<>();
    609609        valueCount.clear();
    610         EnumSet<TaggingPresetType> types = EnumSet.noneOf(TaggingPresetType.class);
     610        Set<TaggingPresetType> types = EnumSet.noneOf(TaggingPresetType.class);
    611611        for (OsmPrimitive osm : newSel) {
    612612            types.add(TaggingPresetType.forPrimitive(osm));
     
    619619                        v.put(value, v.containsKey(value) ? v.get(value) + 1 : 1);
    620620                    } else {
    621                         TreeMap<String, Integer> v = new TreeMap<>();
     621                        Map<String, Integer> v = new TreeMap<>();
    622622                        v.put(value, 1);
    623623                        valueCount.put(key, v);
     
    753753        int row = tagTable.getSelectedRow();
    754754        if (row == -1) return null;
    755         TreeMap<String, Integer> map = (TreeMap<String, Integer>) tagData.getValueAt(row, 1);
     755        Map<String, Integer> map = (TreeMap<String, Integer>) tagData.getValueAt(row, 1);
    756756        return new Tag(
    757757                tagData.getValueAt(row, 0).toString(),
     
    905905        protected void deleteTags(int[] rows){
    906906            // convert list of rows to HashMap (and find gap for nextKey)
    907             HashMap<String, String> tags = new HashMap<>(rows.length);
     907            Map<String, String> tags = new HashMap<>(rows.length);
    908908            int nextKeyIndex = rows[0];
    909909            for (int row : rows) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java

    r8308 r8338  
    258258            if (selection == null || selection.length == 0)
    259259                return;
    260             HashSet<Relation> relations = new HashSet<>();
     260            Set<Relation> relations = new HashSet<>();
    261261            for (TreePath aSelection : selection) {
    262262                relations.add((Relation) aSelection.getLastPathComponent());
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java

    r8318 r8338  
    514514     */
    515515    public Set<OsmPrimitive> getChildPrimitives(Collection<? extends OsmPrimitive> referenceSet) {
    516         HashSet<OsmPrimitive> ret = new HashSet<>();
     516        Set<OsmPrimitive> ret = new HashSet<>();
    517517        if (referenceSet == null) return null;
    518518        for (RelationMember m: members) {
     
    606606        if (primitives == null || primitives.isEmpty())
    607607            return false;
    608         HashSet<OsmPrimitive> referrers = new HashSet<>();
     608        Set<OsmPrimitive> referrers = new HashSet<>();
    609609        for (RelationMember member : members) {
    610610            referrers.add(member.getMember());
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java

    r8285 r8338  
    233233    private Integer popBackwardOnewayPart(int way){
    234234        if (lastOnewayNode != null) {
    235             TreeSet<Node> nodes = new TreeSet<>();
     235            Set<Node> nodes = new TreeSet<>();
    236236            if (onewayReverseMap.ways.containsKey(way)) {
    237237                nodes.addAll(onewayReverseMap.ways.get(way));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorter.java

    r8259 r8338  
    175175        }
    176176
    177         for (LinkedList<Integer> tmpGroup : allGroups) {
     177        for (List<Integer> tmpGroup : allGroups) {
    178178            for (Integer p : tmpGroup) {
    179179                newMembers.add(defaultMembers.get(p));
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java

    r8291 r8338  
    158158        Collection<Collection<String>> args = Main.pref.getArray("bookmarks", null);
    159159        if(args != null) {
    160             LinkedList<Bookmark> bookmarks = new LinkedList<>();
     160            List<Bookmark> bookmarks = new LinkedList<>();
    161161            for(Collection<String> entry : args) {
    162162                try {
     
    178178     */
    179179    public final void save() {
    180         LinkedList<Collection<String>> coll = new LinkedList<>();
     180        List<Collection<String>> coll = new LinkedList<>();
    181181        for (Object o : ((DefaultListModel<Bookmark>)getModel()).toArray()) {
    182182            String[] array = new String[5];
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java

    r8308 r8338  
    1010import java.util.List;
    1111import java.util.Observable;
     12import java.util.Set;
    1213
    1314import javax.swing.JTable;
     
    535536
    536537        protected void initKeyList() {
    537             HashSet<String> keySet = new HashSet<>();
     538            Set<String> keySet = new HashSet<>();
    538539            if (current != null) {
    539540                keySet.addAll(current.getTags().keySet());
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java

    r8221 r8338  
    190190                return null;
    191191        }
    192         ArrayList<PrimitiveId> downloaded = new ArrayList<>(ids);
     192        List<PrimitiveId> downloaded = new ArrayList<>(ids);
    193193        downloaded.removeAll(mainTask.getMissingPrimitives());
    194194        return downloaded;
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r8332 r8338  
    2727import java.util.List;
    2828import java.util.Map;
     29import java.util.Set;
    2930import java.util.concurrent.Callable;
    3031import java.util.concurrent.CopyOnWriteArrayList;
     
    548549        GpxData gpxData = new GpxData();
    549550        gpxData.storageFile = file;
    550         HashSet<Node> doneNodes = new HashSet<>();
     551        Set<Node> doneNodes = new HashSet<>();
    551552        waysToGpxData(data.getWays(), gpxData, doneNodes);
    552553        nodesToGpxData(data.getNodes(), gpxData, doneNodes);
     
    554555    }
    555556
    556     private static void waysToGpxData(Collection<Way> ways, GpxData gpxData, HashSet<Node> doneNodes) {
     557    private static void waysToGpxData(Collection<Way> ways, GpxData gpxData, Set<Node> doneNodes) {
    557558        for (Way w : ways) {
    558559            if (!w.isUsable()) {
     
    632633    }
    633634
    634     private static void nodesToGpxData(Collection<Node> nodes, GpxData gpxData, HashSet<Node> doneNodes) {
     635    private static void nodesToGpxData(Collection<Node> nodes, GpxData gpxData, Set<Node> doneNodes) {
    635636        List<Node> sortedNodes = new ArrayList<>(nodes);
    636637        sortedNodes.removeAll(doneNodes);
     
    645646
    646647    private static void addIntegerIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String ... osmKeys) {
    647         ArrayList<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys));
     648        List<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys));
    648649        possibleKeys.add(0, gpxKey);
    649650        for (String key : possibleKeys) {
     
    668669
    669670    private static void addDoubleIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String ... osmKeys) {
    670         ArrayList<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys));
     671        List<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys));
    671672        possibleKeys.add(0, gpxKey);
    672673        for (String key : possibleKeys) {
     
    690691
    691692    private static void addStringIfPresent(WayPoint wpt, OsmPrimitive p, String gpxKey, String ... osmKeys) {
    692         ArrayList<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys));
     693        List<String> possibleKeys = new ArrayList<>(Arrays.asList(osmKeys));
    693694        possibleKeys.add(0, gpxKey);
    694695        for (String key : possibleKeys) {
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportImagesAction.java

    r8308 r8338  
    5959            File[] sel = fc.getSelectedFiles();
    6060            if (sel != null && sel.length > 0) {
    61                 LinkedList<File> files = new LinkedList<>();
     61                List<File> files = new LinkedList<>();
    6262                addRecursiveFiles(files, sel);
    6363                importer.importDataHandleExceptions(files, NullProgressMonitor.INSTANCE);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java

    r8332 r8338  
    196196    public Cascade clone() {
    197197        @SuppressWarnings("unchecked")
    198         HashMap<String, Object> clonedProp = (HashMap<String, Object>) ((HashMap) this.prop).clone();
     198        Map<String, Object> clonedProp = (Map<String, Object>) ((HashMap) this.prop).clone();
    199199        Cascade c = new Cascade();
    200200        c.prop = clonedProp;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/LabelCompositionStrategy.java

    r7005 r8338  
    188188                nameTags = Collections.emptyList();
    189189            }
    190             ArrayList<String> result = new ArrayList<>();
     190            List<String> result = new ArrayList<>();
    191191            for(String tag: nameTags) {
    192192                if (tag == null) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r8297 r8338  
    146146    }
    147147
    148     public static final EnumSet<Op> COMPARISON_OPERATERS =
    149         EnumSet.of(Op.GREATER_OR_EQUAL, Op.GREATER, Op.LESS_OR_EQUAL, Op.LESS);
    150 
    151148    /**
    152149     * Most common case of a KeyValueCondition.
     
    223220
    224221        public final Pattern pattern;
    225         public static final EnumSet<Op> SUPPORTED_OPS = EnumSet.of(Op.REGEX, Op.NREGEX);
     222        public static final Set<Op> SUPPORTED_OPS = EnumSet.of(Op.REGEX, Op.NREGEX);
    226223
    227224        public KeyValueRegexpCondition(String k, String v, Op op, boolean considerValAsKey) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r8318 r8338  
    185185             * primitive. This includes all key=* rules.
    186186             */
    187             HashMap<String, BitSet> specialRules = new HashMap<>();
     187            Map<String, BitSet> specialRules = new HashMap<>();
    188188
    189189            public void addForKey(int ruleIndex) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java

    r7596 r8338  
    186186    private void get(OsmPrimitive primitive, boolean closed, WayPrototypesRecord p, Double scale, MultiCascade mc) {
    187187        String lineIdx = null;
    188         HashMap<String, LinemodPrototype> overlayMap = new HashMap<>();
     188        Map<String, LinemodPrototype> overlayMap = new HashMap<>();
    189189        boolean isNotArea = primitive.isKeyFalse("area");
    190190        for (String key : primitive.keySet()) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r8308 r8338  
    10711071     */
    10721072    public void addCustomButton(String definitionText, int preferredIndex, boolean removeIfExists) {
    1073         LinkedList<String> t = new LinkedList<>(getToolString());
     1073        List<String> t = new LinkedList<>(getToolString());
    10741074        if (t.contains(definitionText)) {
    10751075            if (!removeIfExists) return; // do nothing
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java

    r8018 r8338  
    286286        pnlPluginUpdatePolicy.rememberInPreferences();
    287287        if (model.isActivePluginsChanged()) {
    288             LinkedList<String> l = new LinkedList<>(model.getSelectedPluginNames());
     288            List<String> l = new LinkedList<>(model.getSelectedPluginNames());
    289289            Collections.sort(l);
    290290            Main.pref.putCollection("plugins", l);
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java

    r8308 r8338  
    310310        if (tags == null)
    311311            return;
    312         ArrayList<TagModel> toDelete = new ArrayList<>();
     312        List<TagModel> toDelete = new ArrayList<>();
    313313        for (int tagIdx : tagIndices) {
    314314            TagModel tag = tags.get(tagIdx);
     
    488488
    489489        List<String> currentkeys = getKeys();
    490         ArrayList<Command> commands = new ArrayList<>();
     490        List<Command> commands = new ArrayList<>();
    491491
    492492        for (OsmPrimitive primitive : primitives) {
     
    512512     */
    513513    public List<String> getKeys() {
    514         ArrayList<String> keys = new ArrayList<>();
     514        List<String> keys = new ArrayList<>();
    515515        for (TagModel tag: tags) {
    516516            if (!tag.getName().trim().isEmpty()) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r8318 r8338  
    2020import java.util.List;
    2121import java.util.Map;
     22import java.util.Set;
    2223
    2324import javax.swing.AbstractAction;
     
    8586     * The types as preparsed collection.
    8687     */
    87     public EnumSet<TaggingPresetType> types;
     88    public Set<TaggingPresetType> types;
    8889    public transient List<TaggingPresetItem> data = new LinkedList<>();
    8990    public transient Roles roles;
     
    502503            super("", ImageProvider.get("dialogs", "pin"));
    503504            putValue(SHORT_DESCRIPTION, tr("Add or remove toolbar button"));
    504             LinkedList<String> t = new LinkedList<>(ToolbarPreferences.getToolString());
     505            List<String> t = new LinkedList<>(ToolbarPreferences.getToolString());
    505506            toolbarIndex = t.indexOf(getToolbarString());
    506507            putValue(SELECTED_KEY, toolbarIndex >= 0);
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java

    r8332 r8338  
    3030import java.util.Map;
    3131import java.util.Map.Entry;
     32import java.util.Set;
     33import java.util.SortedSet;
    3234import java.util.TreeSet;
    3335
     
    8183
    8284    // cache the parsing of types using a LRU cache (http://java-planet.blogspot.com/2005/08/how-to-set-up-simple-lru-cache-using.html)
    83     private static final Map<String,EnumSet<TaggingPresetType>> TYPE_CACHE = new LinkedHashMap<>(16, 1.1f, true);
     85    private static final Map<String,Set<TaggingPresetType>> TYPE_CACHE = new LinkedHashMap<>(16, 1.1f, true);
    8486
    8587    /**
     
    167169
    168170    public static class Role {
    169         public EnumSet<TaggingPresetType> types;
     171        public Set<TaggingPresetType> types;
    170172        public String key;
    171173        /** The text to display */
     
    290292
    291293    public static class Usage {
    292         private TreeSet<String> values;
     294        private SortedSet<String> values;
    293295        private boolean hadKeys = false;
    294296        private boolean hadEmpty = false;
     
    13961398            } else {
    13971399                String s = o.toString();
    1398                 TreeSet<String> parts = new TreeSet<>(Arrays.asList(s.split(delimiter)));
     1400                Set<String> parts = new TreeSet<>(Arrays.asList(s.split(delimiter)));
    13991401                ListModel<PresetListEntry> lm = getModel();
    14001402                int[] intParts = new int[lm.getSize()];
     
    14291431    }
    14301432
    1431     public static EnumSet<TaggingPresetType> getType(String types) throws SAXException {
     1433    public static Set<TaggingPresetType> getType(String types) throws SAXException {
    14321434        if (TYPE_CACHE.containsKey(types))
    14331435            return TYPE_CACHE.get(types);
    1434         EnumSet<TaggingPresetType> result = EnumSet.noneOf(TaggingPresetType.class);
     1436        Set<TaggingPresetType> result = EnumSet.noneOf(TaggingPresetType.class);
    14351437        for (String type : Arrays.asList(types.split(","))) {
    14361438            try {
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetReader.java

    r8126 r8338  
    287287     */
    288288    public static Collection<TaggingPreset> readAll(Collection<String> sources, boolean validate, boolean displayErrMsg) {
    289         LinkedList<TaggingPreset> allPresets = new LinkedList<>();
     289        List<TaggingPreset> allPresets = new LinkedList<>();
    290290        for(String source : sources)  {
    291291            try {
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchPrimitiveDialog.java

    r8126 r8338  
    77import java.awt.event.KeyEvent;
    88import java.util.HashSet;
     9import java.util.Set;
    910
    1011import org.openstreetmap.josm.Main;
     
    6263            TaggingPreset preset = selector.getSelectedPreset();
    6364            if (preset != null) {
    64                 final HashSet<OsmPrimitive> matching = new HashSet<>(Utils.filter(Main.main.getCurrentDataSet().allPrimitives(), preset));
     65                final Set<OsmPrimitive> matching = new HashSet<>(Utils.filter(Main.main.getCurrentDataSet().allPrimitives(), preset));
    6566                Main.main.getCurrentDataSet().setSelected(matching);
    6667            }
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java

    r8308 r8338  
    2323import java.util.List;
    2424import java.util.Objects;
     25import java.util.Set;
    2526
    2627import javax.swing.AbstractAction;
     
    7475    private final JCheckBox ckOnlyApplicable;
    7576    private final JCheckBox ckSearchInTags;
    76     private final EnumSet<TaggingPresetType> typesInSelection = EnumSet.noneOf(TaggingPresetType.class);
     77    private final Set<TaggingPresetType> typesInSelection = EnumSet.noneOf(TaggingPresetType.class);
    7778    private boolean typesInSelectionDirty = true;
    7879    private final transient PresetClassifications classifications = new PresetClassifications();
     
    356357        private final List<PresetClassification> classifications = new ArrayList<>();
    357358
    358         public List<PresetClassification> getMatchingPresets(String searchText, boolean onlyApplicable, boolean inTags, EnumSet<TaggingPresetType> presetTypes, final Collection<? extends OsmPrimitive> selectedPrimitives) {
     359        public List<PresetClassification> getMatchingPresets(String searchText, boolean onlyApplicable, boolean inTags,
     360                Set<TaggingPresetType> presetTypes, final Collection<? extends OsmPrimitive> selectedPrimitives) {
    359361            final String[] groupWords;
    360362            final String[] nameWords;
     
    371373        }
    372374
    373         public List<PresetClassification> getMatchingPresets(String[] groupWords, String[] nameWords, boolean onlyApplicable, boolean inTags, EnumSet<TaggingPresetType> presetTypes, final Collection<? extends OsmPrimitive> selectedPrimitives) {
     375        public List<PresetClassification> getMatchingPresets(String[] groupWords, String[] nameWords, boolean onlyApplicable,
     376                boolean inTags, Set<TaggingPresetType> presetTypes, final Collection<? extends OsmPrimitive> selectedPrimitives) {
    374377
    375378            final List<PresetClassification> result = new ArrayList<>();
     
    451454    }
    452455
    453     private EnumSet<TaggingPresetType> getTypesInSelection() {
     456    private Set<TaggingPresetType> getTypesInSelection() {
    454457        if (typesInSelectionDirty) {
    455458            synchronized (typesInSelection) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresets.java

    r7937 r8338  
    55import java.util.Collection;
    66import java.util.HashMap;
     7import java.util.Map;
    78
    89import javax.swing.JMenu;
     
    5152        } else {
    5253            AutoCompletionManager.cachePresets(taggingPresets);
    53             HashMap<TaggingPresetMenu,JMenu> submenus = new HashMap<>();
     54            Map<TaggingPresetMenu,JMenu> submenus = new HashMap<>();
    5455            for (final TaggingPreset p : taggingPresets) {
    5556                JMenu m = p.group != null ? submenus.get(p.group) : Main.main.menu.presetsMenu;
  • trunk/src/org/openstreetmap/josm/gui/util/AdvancedKeyPressDetector.java

    r8072 r8338  
    1313import java.awt.event.KeyEvent;
    1414import java.util.ArrayList;
     15import java.util.List;
    1516import java.util.Set;
    1617import java.util.TreeSet;
     
    3536    private Timer timer;
    3637
    37     private final ArrayList<KeyPressReleaseListener> keyListeners = new ArrayList<>();
    38     private final ArrayList<ModifierListener> modifierListeners = new ArrayList<>();
     38    private final List<KeyPressReleaseListener> keyListeners = new ArrayList<>();
     39    private final List<ModifierListener> modifierListeners = new ArrayList<>();
    3940    private int previousModifiers;
    4041
  • trunk/src/org/openstreetmap/josm/io/CacheFiles.java

    r8308 r8338  
    1010import java.util.Iterator;
    1111import java.util.Set;
     12import java.util.SortedMap;
    1213import java.util.TreeMap;
    1314
     
    245246        if(!this.enabled || maxsize == -1) return;
    246247
    247         TreeMap<Long, File> modtime = new TreeMap<>();
     248        SortedMap<Long, File> modtime = new TreeMap<>();
    248249        long dirsize = 0;
    249250
  • trunk/src/org/openstreetmap/josm/io/Capabilities.java

    r8287 r8338  
    5151public class Capabilities {
    5252
    53     private final Map<String, HashMap<String,String>> capabilities;
     53    private final Map<String, Map<String,String>> capabilities;
    5454    private final List<String> imageryBlacklist;
    5555
     
    7171    public boolean isDefined(String element, String attribute) {
    7272        if (! capabilities.containsKey(element)) return false;
    73         HashMap<String, String> e = capabilities.get(element);
     73        Map<String, String> e = capabilities.get(element);
    7474        if (e == null) return false;
    7575        return (e.get(attribute) != null);
     
    8585    public String get(String element, String attribute) {
    8686        if (! capabilities.containsKey(element)) return null;
    87         HashMap<String, String> e = capabilities.get(element);
     87        Map<String, String> e = capabilities.get(element);
    8888        if (e == null) return null;
    8989        return e.get(attribute);
     
    132132        } else {
    133133            if (! capabilities.containsKey(element))  {
    134                 HashMap<String,String> h = new HashMap<>();
     134                Map<String,String> h = new HashMap<>();
    135135                capabilities.put(element, h);
    136136            }
    137             HashMap<String, String> e = capabilities.get(element);
     137            Map<String, String> e = capabilities.get(element);
    138138            e.put(attribute, value);
    139139        }
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r8291 r8338  
    239239     */
    240240    protected Set<Long> extractIdPackage(Set<Long> ids) {
    241         HashSet<Long> pkg = new HashSet<>();
     241        Set<Long> pkg = new HashSet<>();
    242242        if (ids.isEmpty())
    243243            return pkg;
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java

    r7937 r8338  
    233233        ImageryInfo i = new ImageryInfo(name, buildGetMapUrl(selectedLayers));
    234234        if (selectedLayers != null) {
    235             HashSet<String> proj = new HashSet<>();
     235            Set<String> proj = new HashSet<>();
    236236            for (WMSImagery.LayerDetails l : selectedLayers) {
    237237                proj.addAll(l.getProjections());
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java

    r8318 r8338  
    1313import java.util.List;
    1414import java.util.Map;
     15import java.util.Set;
    1516
    1617import javax.swing.JLabel;
     
    228229            }
    229230        }
    230         HashSet<String> knownParams = new HashSet<>();
     231        Set<String> knownParams = new HashSet<>();
    231232        if (mandatory != null) Collections.addAll(knownParams, mandatory);
    232233        if (optional != null) Collections.addAll(knownParams, optional);
     
    316317        @Override
    317318        protected void parseArgs() {
    318             HashMap<String, String> args = new HashMap<>();
     319            Map<String, String> args = new HashMap<>();
    319320            if (request.indexOf('?') != -1) {
    320321                String query = request.substring(request.indexOf('?') + 1);
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r8308 r8338  
    745745                return null;
    746746            }
    747             HashMap<String, PluginInformation> ret = new HashMap<>();
     747            Map<String, PluginInformation> ret = new HashMap<>();
    748748            for (PluginInformation pi: task.getAvailablePlugins()) {
    749749                ret.put(pi.name, pi);
     
    13191319    public static String getBugReportText() {
    13201320        StringBuilder text = new StringBuilder();
    1321         LinkedList <String> pl = new LinkedList<>(Main.pref.getCollection("plugins", new LinkedList<String>()));
     1321        List <String> pl = new LinkedList<>(Main.pref.getCollection("plugins", new LinkedList<String>()));
    13221322        for (final PluginProxy pp : pluginList) {
    13231323            PluginInformation pi = pp.getPluginInformation();
  • trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java

    r8290 r8338  
    2727import java.util.LinkedList;
    2828import java.util.List;
     29import java.util.Set;
    2930
    3031import javax.swing.JLabel;
     
    276277    protected List<PluginInformation> filterDeprecatedPlugins(List<PluginInformation> plugins) {
    277278        List<PluginInformation> ret = new ArrayList<>(plugins.size());
    278         HashSet<String> deprecatedPluginNames = new HashSet<>();
     279        Set<String> deprecatedPluginNames = new HashSet<>();
    279280        for (PluginHandler.DeprecatedPlugin p : PluginHandler.DEPRECATED_PLUGINS) {
    280281            deprecatedPluginNames.add(p.name);
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r8304 r8338  
    4242        }
    4343        String[] args = url.substring(i+1).split("&");
    44         HashMap<String, String> map = new HashMap<>();
     44        Map<String, String> map = new HashMap<>();
    4545        for (String arg : args) {
    4646            int eq = arg.indexOf('=');
  • trunk/src/org/openstreetmap/josm/tools/Pair.java

    r7509 r8338  
    22package org.openstreetmap.josm.tools;
    33import java.util.ArrayList;
     4import java.util.List;
    45
    56/**
     
    3132    }
    3233
    33     @Override public int hashCode() {
     34    @Override
     35    public int hashCode() {
    3436        return a.hashCode() + b.hashCode();
    3537    }
    3638
    37     @Override public boolean equals(Object other) {
     39    @Override
     40    public boolean equals(Object other) {
    3841        if (other instanceof Pair<?, ?>) {
    3942            Pair<?, ?> o = (Pair<?, ?>)other;
     
    4346    }
    4447
    45     public static <T> ArrayList<T> toArrayList(Pair<T, T> p) {
    46         ArrayList<T> l = new ArrayList<>(2);
     48    public static <T> List<T> toList(Pair<T, T> p) {
     49        List<T> l = new ArrayList<>(2);
    4750        l.add(p.a);
    4851        l.add(p.b);
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r7606 r8338  
    310310        Main.platform.initSystemShortcuts();
    311311        // (2) User defined shortcuts
    312         LinkedList<Shortcut> newshortcuts = new LinkedList<>();
     312        List<Shortcut> newshortcuts = new LinkedList<>();
    313313        for(String s : Main.pref.getAllPrefixCollectionKeys("shortcut.entry.")) {
    314314            newshortcuts.add(new Shortcut(s));
  • trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java

    r7937 r8338  
    183183    public void testWriteGpxAndMarkerJoz() throws IOException {
    184184        GpxLayer gpx = createGpxLayer();
    185         testWrite(Pair.toArrayList(new Pair<Layer, Layer>(gpx, createMarkerLayer(gpx))), true);
     185        testWrite(Pair.toList(new Pair<Layer, Layer>(gpx, createMarkerLayer(gpx))), true);
    186186    }
    187187}
Note: See TracChangeset for help on using the changeset viewer.