Ignore:
Timestamp:
2014-04-26T17:39:23+02:00 (6 years ago)
Author:
Don-vip
Message:

see #8465 - use diamond operator where applicable

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
63 edited

Legend:

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

    r6920 r7005  
    113113
    114114    protected void launchInfoBrowsersForSelectedPrimitives() {
    115         List<OsmPrimitive> primitivesToShow = new ArrayList<OsmPrimitive>(getCurrentDataSet().getAllSelected());
     115        List<OsmPrimitive> primitivesToShow = new ArrayList<>(getCurrentDataSet().getAllSelected());
    116116
    117117        // filter out new primitives which are not yet uploaded to the server
  • trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java

    r6934 r7005  
    131131
    132132        Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
    133         List<Node> nodes = new LinkedList<Node>();
     133        List<Node> nodes = new LinkedList<>();
    134134        // fixNodes: All nodes for which the angle relative to center should not be modified
    135         HashSet<Node> fixNodes = new HashSet<Node>();
    136         List<Way> ways = new LinkedList<Way>();
     135        HashSet<Node> fixNodes = new HashSet<>();
     136        List<Way> ways = new LinkedList<>();
    137137        EastNorth center = null;
    138138        double radius = 0;
     
    156156            Way closedWay = new Way(w);
    157157            closedWay.addNode(w.firstNode());
    158             ArrayList<Way> usedWays = new ArrayList<Way>(1);
     158            ArrayList<Way> usedWays = new ArrayList<>(1);
    159159            usedWays.add(closedWay);
    160160            nodes = collectNodesAnticlockwise(usedWays);
    161161        } else if (!ways.isEmpty() && checkWaysArePolygon(ways)) {
    162162            // Case 2
    163             ArrayList<Node> inside = new ArrayList<Node>();
    164             ArrayList<Node> outside = new ArrayList<Node>();
     163            ArrayList<Node> inside = new ArrayList<>();
     164            ArrayList<Node> outside = new ArrayList<>();
    165165           
    166166            for(Node n: nodes) {
     
    240240        if(!actionAllowed(nodes)) return;
    241241
    242         Collection<Command> cmds = new LinkedList<Command>();
     242        Collection<Command> cmds = new LinkedList<>();
    243243
    244244        // Move each node to that distance from the center.
     
    287287     */
    288288    private List<Node> collectNodesWithExternReferers(List<Way> ways) {
    289         ArrayList<Node> withReferrers = new ArrayList<Node>();
     289        ArrayList<Node> withReferrers = new ArrayList<>();
    290290        for(Way w: ways)
    291291            for(Node n: w.getNodes())
     
    301301     */
    302302    private List<Node> collectNodesAnticlockwise(List<Way> ways) {
    303         ArrayList<Node> nodes = new ArrayList<Node>();
     303        ArrayList<Node> nodes = new ArrayList<>();
    304304        Node firstNode = ways.get(0).firstNode();
    305305        Node lastNode = null;
  • trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java

    r6977 r7005  
    8989            Collection<Way> ref = OsmPrimitive.getFilteredList(n.getReferrers(), Way.class);
    9090            if(waysRef == null)
    91                 waysRef = new HashSet<Way>(ref);
     91                waysRef = new HashSet<>(ref);
    9292            else
    9393                waysRef.retainAll(ref);
     
    9595        if(waysRef.size() == 1) {
    9696            // All nodes are part of the same way. See #9605
    97             HashSet<Node> remainNodes = new HashSet<Node>(nodes);
     97            HashSet<Node> remainNodes = new HashSet<>(nodes);
    9898            Way way = waysRef.iterator().next();
    9999            for(Node n: way.getNodes()) {
     
    135135            return;
    136136
    137         List<Node> selectedNodes = new ArrayList<Node>(getCurrentDataSet().getSelectedNodes());
    138         List<Way> selectedWays = new ArrayList<Way>(getCurrentDataSet().getSelectedWays());
     137        List<Node> selectedNodes = new ArrayList<>(getCurrentDataSet().getSelectedNodes());
     138        List<Way> selectedWays = new ArrayList<>(getCurrentDataSet().getSelectedWays());
    139139
    140140        try {
     
    196196        // use the nodes furthest apart as anchors
    197197        nodePairFurthestApart(nodes, anchors);
    198         Collection<Command> cmds = new ArrayList<Command>(nodes.size());
     198        Collection<Command> cmds = new ArrayList<>(nodes.size());
    199199        Line line = new Line(anchors[0], anchors[1]);
    200200        for(Node node: nodes)
     
    212212    private Command alignMultiWay(Collection<Way> ways) throws InvalidSelection {
    213213        // Collect all nodes and compute line equation
    214         HashSet<Node> nodes = new HashSet<Node>();
    215         HashMap<Way, Line> lines = new HashMap<Way, Line>();
     214        HashSet<Node> nodes = new HashSet<>();
     215        HashMap<Way, Line> lines = new HashMap<>();
    216216        for(Way w: ways) {
    217217            if(w.firstNode() == w.lastNode())
     
    220220            lines.put(w, new Line(w));
    221221        }
    222         Collection<Command> cmds = new ArrayList<Command>(nodes.size());
    223         List<Way> referers = new ArrayList<Way>(ways.size());
     222        Collection<Command> cmds = new ArrayList<>(nodes.size());
     223        List<Way> referers = new ArrayList<>(ways.size());
    224224        for(Node n: nodes) {
    225225            referers.clear();
     
    250250     */
    251251    private List<Line> getInvolvedLines(Node node, List<Way> refWays) throws InvalidSelection {
    252         ArrayList<Line> lines = new ArrayList<Line>();
    253         ArrayList<Node> neighbors = new ArrayList<Node>();
     252        ArrayList<Line> lines = new ArrayList<>();
     253        ArrayList<Node> neighbors = new ArrayList<>();
    254254        for(Way way: refWays) {
    255255            List<Node> nodes = way.getNodes();
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r6890 r7005  
    207207            l.visitBoundingBox(v);
    208208        } else if (mode.equals("selection") || mode.equals("conflict")) {
    209             Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>();
     209            Collection<OsmPrimitive> sel = new HashSet<>();
    210210            if (mode.equals("selection")) {
    211211                sel = getCurrentDataSet().getSelected();
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r6889 r7005  
    109109
    110110        // remove duplicates, preserving order
    111         ways = new LinkedHashSet<Way>(ways);
     111        ways = new LinkedHashSet<>(ways);
    112112
    113113        // try to build a new way which includes all the combined
     
    125125        TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways);
    126126
    127         List<Way> reversedWays = new LinkedList<Way>();
    128         List<Way> unreversedWays = new LinkedList<Way>();
     127        List<Way> reversedWays = new LinkedList<>();
     128        List<Way> unreversedWays = new LinkedList<>();
    129129        for (Way w: ways) {
    130130            // Treat zero or one-node ways as unreversed as Combine action action is a good way to fix them (see #8971)
     
    155155            // if there are still reversed ways with direction-dependent tags, reverse their tags
    156156            if (!reversedWays.isEmpty() && PROP_REVERSE_WAY.get()) {
    157                 List<Way> unreversedTagWays = new ArrayList<Way>(ways);
     157                List<Way> unreversedTagWays = new ArrayList<>(ways);
    158158                unreversedTagWays.removeAll(reversedWays);
    159159                ReverseWayTagCorrector reverseWayTagCorrector = new ReverseWayTagCorrector();
    160                 List<Way> reversedTagWays = new ArrayList<Way>(reversedWays.size());
     160                List<Way> reversedTagWays = new ArrayList<>(reversedWays.size());
    161161                Collection<Command> changePropertyCommands =  null;
    162162                for (Way w : reversedWays) {
     
    183183        List<Command> resolution = CombinePrimitiveResolverDialog.launchIfNecessary(wayTags, ways, Collections.singleton(targetWay));
    184184
    185         LinkedList<Command> cmds = new LinkedList<Command>();
    186         LinkedList<Way> deletedWays = new LinkedList<Way>(ways);
     185        LinkedList<Command> cmds = new LinkedList<>();
     186        LinkedList<Way> deletedWays = new LinkedList<>(ways);
    187187        deletedWays.remove(targetWay);
    188188
     
    377377    public static class NodeGraph {
    378378        public static List<NodePair> buildNodePairs(Way way, boolean directed) {
    379             List<NodePair> pairs = new ArrayList<NodePair>();
     379            List<NodePair> pairs = new ArrayList<>();
    380380            for (Pair<Node,Node> pair: way.getNodePairs(false /* don't sort */)) {
    381381                pairs.add(new NodePair(pair));
     
    388388
    389389        public static List<NodePair> buildNodePairs(List<Way> ways, boolean directed) {
    390             List<NodePair> pairs = new ArrayList<NodePair>();
     390            List<NodePair> pairs = new ArrayList<>();
    391391            for (Way w: ways) {
    392392                pairs.addAll(buildNodePairs(w, directed));
     
    396396
    397397        public static List<NodePair> eliminateDuplicateNodePairs(List<NodePair> pairs) {
    398             List<NodePair> cleaned = new ArrayList<NodePair>();
     398            List<NodePair> cleaned = new ArrayList<>();
    399399            for(NodePair p: pairs) {
    400400                if (!cleaned.contains(p) && !cleaned.contains(p.swap())) {
     
    449449                }
    450450            } else {
    451                 List<NodePair> l = new ArrayList<NodePair>();
     451                List<NodePair> l = new ArrayList<>();
    452452                l.add(pair);
    453453                successors.put(pair.getA(), l);
     
    461461                }
    462462            } else {
    463                 List<NodePair> l = new ArrayList<NodePair>();
     463                List<NodePair> l = new ArrayList<>();
    464464                l.add(pair);
    465465                predecessors.put(pair.getB(), l);
     
    480480
    481481        protected void prepare() {
    482             Set<NodePair> undirectedEdges = new LinkedHashSet<NodePair>();
    483             successors = new LinkedHashMap<Node, List<NodePair>>();
    484             predecessors = new LinkedHashMap<Node, List<NodePair>>();
     482            Set<NodePair> undirectedEdges = new LinkedHashSet<>();
     483            successors = new LinkedHashMap<>();
     484            predecessors = new LinkedHashMap<>();
    485485
    486486            for (NodePair pair: edges) {
     
    498498         */
    499499        public NodeGraph() {
    500             edges = new LinkedHashSet<NodePair>();
     500            edges = new LinkedHashSet<>();
    501501        }
    502502
     
    523523
    524524        protected Set<Node> getTerminalNodes() {
    525             Set<Node> ret = new LinkedHashSet<Node>();
     525            Set<Node> ret = new LinkedHashSet<>();
    526526            for (Node n: getNodes()) {
    527527                if (isTerminalNode(n)) {
     
    533533
    534534        protected Set<Node> getNodes(Stack<NodePair> pairs) {
    535             HashSet<Node> nodes = new LinkedHashSet<Node>(2*pairs.size());
     535            HashSet<Node> nodes = new LinkedHashSet<>(2*pairs.size());
    536536            for (NodePair pair: pairs) {
    537537                nodes.add(pair.getA());
     
    553553
    554554        protected Set<Node> getNodes() {
    555             Set<Node> nodes = new LinkedHashSet<Node>(2 * edges.size());
     555            Set<Node> nodes = new LinkedHashSet<>(2 * edges.size());
    556556            for (NodePair pair: edges) {
    557557                nodes.add(pair.getA());
     
    566566
    567567        protected List<Node> buildPathFromNodePairs(Stack<NodePair> path) {
    568             LinkedList<Node> ret = new LinkedList<Node>();
     568            LinkedList<Node> ret = new LinkedList<>();
    569569            for (NodePair pair: path) {
    570570                ret.add(pair.getA());
     
    585585            if (startNode == null)
    586586                return null;
    587             Stack<NodePair> path = new Stack<NodePair>();
    588             Stack<NodePair> nextPairs  = new Stack<NodePair>();
     587            Stack<NodePair> path = new Stack<>();
     588            Stack<NodePair> nextPairs  = new Stack<>();
    589589            nextPairs.addAll(getOutboundPairs(startNode));
    590590            while(!nextPairs.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java

    r6977 r7005  
    137137
    138138        Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
    139         List<Node> nodes = new LinkedList<Node>();
     139        List<Node> nodes = new LinkedList<>();
    140140        Way existingWay = null;
    141141
     
    170170
    171171        // now we can start doing things to OSM data
    172         Collection<Command> cmds = new LinkedList<Command>();
     172        Collection<Command> cmds = new LinkedList<>();
    173173        EastNorth center = null;
    174174       
     
    210210
    211211        // build a way for the circle
    212         List<Node> wayToAdd = new ArrayList<Node>();
     212        List<Node> wayToAdd = new ArrayList<>();
    213213        for(int i = 0; i < nodes.size(); i++) {
    214214            wayToAdd.add(angles[i].node);
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r6913 r7005  
    174174            return selectedRelations.iterator().next();
    175175        } else {
    176             final HashSet<Relation> relatedRelations = new HashSet<Relation>();
     176            final HashSet<Relation> relatedRelations = new HashSet<>();
    177177            for (final Way w : selectedWays) {
    178178                relatedRelations.addAll(Utils.filteredCollection(w.getReferrers(), Relation.class));
     
    188188
    189189        // add ways of existing relation to include them in polygon analysis
    190         Set<Way> ways = new HashSet<Way>(selectedWays);
     190        Set<Way> ways = new HashSet<>(selectedWays);
    191191        ways.addAll(selectedMultipolygonRelation.getMemberPrimitives(Way.class));
    192192
     
    303303    private static void addMembers(JoinedPolygon polygon, Relation rel, String role) {
    304304        final int count = rel.getMembersCount();
    305         final HashSet<Way> ways = new HashSet<Way>(polygon.ways);
     305        final HashSet<Way> ways = new HashSet<>(polygon.ways);
    306306        for (int i = 0; i < count; i++) {
    307307            final RelationMember m = rel.getMember(i);
     
    325325     */
    326326    public static List<Command> removeTagsFromWaysIfNeeded( Relation relation ) {
    327         Map<String, String> values = new HashMap<String, String>(relation.getKeys());
    328 
    329         List<Way> innerWays = new ArrayList<Way>();
    330         List<Way> outerWays = new ArrayList<Way>();
    331 
    332         Set<String> conflictingKeys = new TreeSet<String>();
     327        Map<String, String> values = new HashMap<>(relation.getKeys());
     328
     329        List<Way> innerWays = new ArrayList<>();
     330        List<Way> outerWays = new ArrayList<>();
     331
     332        Set<String> conflictingKeys = new TreeSet<>();
    333333
    334334        for( RelationMember m : relation.getMembers() ) {
     
    371371        values.put("area", "yes");
    372372
    373         List<Command> commands = new ArrayList<Command>();
     373        List<Command> commands = new ArrayList<>();
    374374        boolean moveTags = Main.pref.getBoolean("multipoly.movetags", true);
    375375
    376376        for (Entry<String, String> entry : values.entrySet()) {
    377             List<OsmPrimitive> affectedWays = new ArrayList<OsmPrimitive>();
     377            List<OsmPrimitive> affectedWays = new ArrayList<>();
    378378            String key = entry.getKey();
    379379            String value = entry.getValue();
  • trunk/src/org/openstreetmap/josm/actions/DistributeAction.java

    r6380 r7005  
    5252            return;
    5353        Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
    54         Collection<Node> nodes = new LinkedList<Node>();
    55         Collection<Node> itnodes = new LinkedList<Node>();
     54        Collection<Node> nodes = new LinkedList<>();
     55        Collection<Node> itnodes = new LinkedList<>();
    5656        for (OsmPrimitive osm : sel)
    5757            if (osm instanceof Node) {
     
    115115
    116116        // A list of commands to do
    117         Collection<Command> cmds = new LinkedList<Command>();
     117        Collection<Command> cmds = new LinkedList<>();
    118118
    119119        // Amount of nodes between A and B plus 1
     
    152152
    153153    private Set<Node> removeNodesWithoutCoordinates(Collection<Node> col) {
    154         Set<Node> result = new HashSet<Node>();
     154        Set<Node> result = new HashSet<>();
    155155        for (Iterator<Node> it = col.iterator(); it.hasNext();) {
    156156            Node n = it.next();
  • trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java

    r6987 r7005  
    9393     */
    9494    protected static void confirmAndDownloadAreas(Area a, double maxArea, boolean osmDownload, boolean gpxDownload, String title, ProgressMonitor progressMonitor) {
    95         List<Rectangle2D> toDownload = new ArrayList<Rectangle2D>();
     95        List<Rectangle2D> toDownload = new ArrayList<>();
    9696        addToDownload(a, a.getBounds(), toDownload, maxArea);
    9797        if (toDownload.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/actions/ExpertToggleAction.java

    r6890 r7005  
    2323    }
    2424
    25     private static final List<WeakReference<ExpertModeChangeListener>> listeners = new ArrayList<WeakReference<ExpertModeChangeListener>>();
    26     private static final List<WeakReference<Component>> visibilityToggleListeners = new ArrayList<WeakReference<Component>>();
     25    private static final List<WeakReference<ExpertModeChangeListener>> listeners = new ArrayList<>();
     26    private static final List<WeakReference<Component>> visibilityToggleListeners = new ArrayList<>();
    2727
    2828    private static final ExpertToggleAction INSTANCE = new ExpertToggleAction();
     
    7070            if (wr.get() == listener) return;
    7171        }
    72         listeners.add(new WeakReference<ExpertModeChangeListener>(listener));
     72        listeners.add(new WeakReference<>(listener));
    7373        if (fireWhenAdding) {
    7474            listener.expertChanged(isExpert());
     
    100100            if (wr.get() == c) return;
    101101        }
    102         visibilityToggleListeners.add(new WeakReference<Component>(c));
     102        visibilityToggleListeners.add(new WeakReference<>(c));
    103103        c.setVisible(isExpert());
    104104    }
  • trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java

    r6889 r7005  
    4343    static {
    4444
    45         importers = new ArrayList<FileImporter>();
     45        importers = new ArrayList<>();
    4646
    4747        String[] importerNames = {
     
    6969        }
    7070
    71         exporters = new ArrayList<FileExporter>();
     71        exporters = new ArrayList<>();
    7272
    7373        String[] exporterNames = {
     
    138138    public static List<ExtensionFileFilter> getImportExtensionFileFilters() {
    139139        updateAllFormatsImporter();
    140         LinkedList<ExtensionFileFilter> filters = new LinkedList<ExtensionFileFilter>();
     140        LinkedList<ExtensionFileFilter> filters = new LinkedList<>();
    141141        for (FileImporter importer : importers) {
    142142            filters.add(importer.filter);
     
    155155     */
    156156    public static List<ExtensionFileFilter> getExportExtensionFileFilters() {
    157         LinkedList<ExtensionFileFilter> filters = new LinkedList<ExtensionFileFilter>();
     157        LinkedList<ExtensionFileFilter> filters = new LinkedList<>();
    158158        for (FileExporter exporter : exporters) {
    159159            if (filters.contains(exporter.filter) || !exporter.isEnabled()) {
  • trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java

    r6327 r7005  
    7070        JFrame frame = (JFrame) Main.parent;
    7171
    72         List<Window> visibleWindows = new ArrayList<Window>();
     72        List<Window> visibleWindows = new ArrayList<>();
    7373        visibleWindows.add(frame);
    7474        for (Window w : Frame.getWindows()) {
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r6987 r7005  
    5252public class JoinAreasAction extends JosmAction {
    5353    // This will be used to commit commands and unite them into one large command sequence at the end
    54     private final LinkedList<Command> cmds = new LinkedList<Command>();
     54    private final LinkedList<Command> cmds = new LinkedList<>();
    5555    private int cmdsCount = 0;
    56     private final List<Relation> addedRelations = new LinkedList<Relation>();
     56    private final List<Relation> addedRelations = new LinkedList<>();
    5757
    5858    /**
     
    7474        public Multipolygon(Way way) {
    7575            outerWay = way;
    76             innerWays = new ArrayList<Way>();
     76            innerWays = new ArrayList<>();
    7777        }
    7878    }
     
    143143
    144144        public List<Node> getNodes() {
    145             List<Node> nodes = new ArrayList<Node>();
     145            List<Node> nodes = new ArrayList<>();
    146146            for (WayInPolygon way : this.ways) {
    147147                //do not add the last node as it will be repeated in the next way
     
    177177        public AssembledMultipolygon(AssembledPolygon way) {
    178178            outerWay = way;
    179             innerWays = new ArrayList<AssembledPolygon>();
     179            innerWays = new ArrayList<>();
    180180        }
    181181    }
     
    195195        public WayTraverser(Collection<WayInPolygon> ways) {
    196196
    197             availableWays = new HashSet<WayInPolygon>(ways);
     197            availableWays = new HashSet<>(ways);
    198198            lastWay = null;
    199199        }
     
    310310    @Override
    311311    public void actionPerformed(ActionEvent e) {
    312         LinkedList<Way> ways = new LinkedList<Way>(Main.main.getCurrentDataSet().getSelectedWays());
     312        LinkedList<Way> ways = new LinkedList<>(Main.main.getCurrentDataSet().getSelectedWays());
    313313        addedRelations.clear();
    314314
     
    321321        }
    322322
    323         List<Node> allNodes = new ArrayList<Node>();
     323        List<Node> allNodes = new ArrayList<>();
    324324        for (Way way : ways) {
    325325            if (!way.isClosed()) {
     
    376376                commitCommands(tr("Move tags from ways to relations"));
    377377
    378                 List<Way> allWays = new ArrayList<Way>();
     378                List<Way> allWays = new ArrayList<>();
    379379                for (Multipolygon pol : result.polygons) {
    380380                    allWays.add(pol.outerWay);
     
    406406     */
    407407    private boolean testJoin(List<Multipolygon> areas) {
    408         List<Way> allStartingWays = new ArrayList<Way>();
     408        List<Way> allStartingWays = new ArrayList<>();
    409409
    410410        for (Multipolygon area : areas) {
     
    428428        result.hasChanges = false;
    429429
    430         List<Way> allStartingWays = new ArrayList<Way>();
    431         List<Way> innerStartingWays = new ArrayList<Way>();
    432         List<Way> outerStartingWays = new ArrayList<Way>();
     430        List<Way> allStartingWays = new ArrayList<>();
     431        List<Way> innerStartingWays = new ArrayList<>();
     432        List<Way> outerStartingWays = new ArrayList<>();
    433433
    434434        for (Multipolygon area : areas) {
     
    457457        commitCommands(marktr("Added node on all intersections"));
    458458
    459         List<RelationRole> relations = new ArrayList<RelationRole>();
     459        List<RelationRole> relations = new ArrayList<>();
    460460
    461461        // Remove ways from all relations so ways can be combined/split quietly
     
    467467        boolean warnAboutRelations = !relations.isEmpty() && allStartingWays.size() > 1;
    468468
    469         List<WayInPolygon> preparedWays = new ArrayList<WayInPolygon>();
     469        List<WayInPolygon> preparedWays = new ArrayList<>();
    470470
    471471        for (Way way : outerStartingWays) {
     
    480480
    481481        // Find boundary ways
    482         List<Way> discardedWays = new ArrayList<Way>();
     482        List<Way> discardedWays = new ArrayList<>();
    483483        List<AssembledPolygon> bounadries = findBoundaryPolygons(preparedWays, discardedWays);
    484484
     
    488488
    489489        //assemble final polygons
    490         List<Multipolygon> polygons = new ArrayList<Multipolygon>();
    491         Set<Relation> relationsToDelete = new LinkedHashSet<Relation>();
     490        List<Multipolygon> polygons = new ArrayList<>();
     491        Set<Relation> relationsToDelete = new LinkedHashSet<>();
    492492
    493493        for (AssembledMultipolygon pol : preparedPolygons) {
     
    548548    private boolean resolveTagConflicts(List<Multipolygon> polygons) {
    549549
    550         List<Way> ways = new ArrayList<Way>();
     550        List<Way> ways = new ArrayList<>();
    551551
    552552        for (Multipolygon pol : polygons) {
     
    577577        //TODO: maybe join nodes with JoinNodesAction, rather than reconnect the ways.
    578578
    579         Map<Node, Node> nodeMap = new TreeMap<Node, Node>(new NodePositionComparator());
     579        Map<Node, Node> nodeMap = new TreeMap<>(new NodePositionComparator());
    580580        int totalNodesRemoved = 0;
    581581
     
    586586
    587587            int nodesRemoved = 0;
    588             List<Node> newNodes = new ArrayList<Node>();
     588            List<Node> newNodes = new ArrayList<>();
    589589            Node prevNode = null;
    590590
     
    661661    private List<WayInPolygon> markWayInsideSide(List<Way> parts, boolean isInner) {
    662662
    663         List<WayInPolygon> result = new ArrayList<WayInPolygon>();
     663        List<WayInPolygon> result = new ArrayList<>();
    664664
    665665        //prepare prev and next maps
    666         Map<Way, Way> nextWayMap = new HashMap<Way, Way>();
    667         Map<Way, Way> prevWayMap = new HashMap<Way, Way>();
     666        Map<Way, Way> nextWayMap = new HashMap<>();
     667        Map<Way, Way> prevWayMap = new HashMap<>();
    668668
    669669        for (int pos = 0; pos < parts.size(); pos ++) {
     
    831831    private List<Way> splitWayOnNodes(Way way, Set<Node> nodes) {
    832832
    833         List<Way> result = new ArrayList<Way>();
     833        List<Way> result = new ArrayList<>();
    834834        List<List<Node>> chunks = buildNodeChunks(way, nodes);
    835835
     
    859859     */
    860860    private List<List<Node>> buildNodeChunks(Way way, Collection<Node> splitNodes) {
    861         List<List<Node>> result = new ArrayList<List<Node>>();
    862         List<Node> curList = new ArrayList<Node>();
     861        List<List<Node>> result = new ArrayList<>();
     862        List<Node> curList = new ArrayList<>();
    863863
    864864        for (Node node : way.getNodes()) {
     
    866866            if (curList.size() > 1 && splitNodes.contains(node)) {
    867867                result.add(curList);
    868                 curList = new ArrayList<Node>();
     868                curList = new ArrayList<>();
    869869                curList.add(node);
    870870            }
     
    877877        return result;
    878878    }
    879 
    880879
    881880    /**
     
    887886
    888887        List<PolygonLevel> list = findOuterWaysImpl(0, boundaries);
    889         List<AssembledMultipolygon> result = new ArrayList<AssembledMultipolygon>();
     888        List<AssembledMultipolygon> result = new ArrayList<>();
    890889
    891890        //take every other level
     
    908907
    909908        //TODO: bad performance for deep nestings...
    910         List<PolygonLevel> result = new ArrayList<PolygonLevel>();
     909        List<PolygonLevel> result = new ArrayList<>();
    911910
    912911        for (AssembledPolygon outerWay : boundaryWays) {
    913912
    914913            boolean outerGood = true;
    915             List<AssembledPolygon> innerCandidates = new ArrayList<AssembledPolygon>();
     914            List<AssembledPolygon> innerCandidates = new ArrayList<>();
    916915
    917916            for (AssembledPolygon innerWay : boundaryWays) {
     
    963962        //first find all discardable ways, by getting outer shells.
    964963        //this will produce incorrect boundaries in some cases, but second pass will fix it.
    965         List<WayInPolygon> discardedWays = new ArrayList<WayInPolygon>();
     964        List<WayInPolygon> discardedWays = new ArrayList<>();
    966965
    967966        // In multigonWays collection, some way are just a point (i.e. way like nodeA-nodeA)
    968967        // This seems to appear when is apply over invalid way like #9911 test-case
    969968        // Remove all of these way to make the next work.
    970         ArrayList<WayInPolygon> cleanMultigonWays = new ArrayList<WayInPolygon>();
     969        ArrayList<WayInPolygon> cleanMultigonWays = new ArrayList<>();
    971970        for(WayInPolygon way: multigonWays)
    972971            if(way.way.getNodesCount() == 2 && way.way.firstNode() == way.way.lastNode())
     
    976975
    977976        WayTraverser traverser = new WayTraverser(cleanMultigonWays);
    978         List<AssembledPolygon> result = new ArrayList<AssembledPolygon>();
     977        List<AssembledPolygon> result = new ArrayList<>();
    979978
    980979        WayInPolygon startWay;
    981980        while((startWay = traverser.startNewWay()) != null) {
    982             ArrayList<WayInPolygon> path = new ArrayList<WayInPolygon>();
     981            ArrayList<WayInPolygon> path = new ArrayList<>();
    983982            path.add(startWay);
    984983            while(true) {
     
    10241023     */
    10251024    public static List<AssembledPolygon> fixTouchingPolygons(List<AssembledPolygon> polygons) {
    1026         List<AssembledPolygon> newPolygons = new ArrayList<AssembledPolygon>();
     1025        List<AssembledPolygon> newPolygons = new ArrayList<>();
    10271026
    10281027        for (AssembledPolygon ring : polygons) {
     
    10321031
    10331032            while((startWay = traverser.startNewWay()) != null) {
    1034                 List<WayInPolygon> simpleRingWays = new ArrayList<WayInPolygon>();
     1033                List<WayInPolygon> simpleRingWays = new ArrayList<>();
    10351034                simpleRingWays.add(startWay);
    10361035                WayInPolygon nextWay;
     
    10571056     */
    10581057    public static boolean wayInsideWay(AssembledPolygon inside, AssembledPolygon outside) {
    1059         Set<Node> outsideNodes = new HashSet<Node>(outside.getNodes());
     1058        Set<Node> outsideNodes = new HashSet<>(outside.getNodes());
    10601059        List<Node> insideNodes = inside.getNodes();
    10611060
     
    11271126
    11281127        //TODO: ReverseWay and Combine way are really slow and we use them a lot here. This slows down large joins.
    1129         List<Way> actionWays = new ArrayList<Way>(ways.size());
     1128        List<Way> actionWays = new ArrayList<>(ways.size());
    11301129
    11311130        for (WayInPolygon way : ways) {
     
    11541153    private List<Multipolygon> collectMultipolygons(List<Way> selectedWays) {
    11551154
    1156         List<Multipolygon> result = new ArrayList<Multipolygon>();
     1155        List<Multipolygon> result = new ArrayList<>();
    11571156
    11581157        //prepare the lists, to minimize memory allocation.
    1159         List<Way> outerWays = new ArrayList<Way>();
    1160         List<Way> innerWays = new ArrayList<Way>();
    1161 
    1162         Set<Way> processedOuterWays = new LinkedHashSet<Way>();
    1163         Set<Way> processedInnerWays = new LinkedHashSet<Way>();
     1158        List<Way> outerWays = new ArrayList<>();
     1159        List<Way> innerWays = new ArrayList<>();
     1160
     1161        Set<Way> processedOuterWays = new LinkedHashSet<>();
     1162        Set<Way> processedInnerWays = new LinkedHashSet<>();
    11641163
    11651164        for (Relation r : OsmPrimitive.getParentRelations(selectedWays)) {
     
    12831282     */
    12841283    private List<RelationRole> removeFromAllRelations(OsmPrimitive osm) {
    1285         List<RelationRole> result = new ArrayList<RelationRole>();
     1284        List<RelationRole> result = new ArrayList<>();
    12861285
    12871286        for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
     
    13221321     */
    13231322    private void fixRelations(List<RelationRole> rels, Way outer, RelationRole ownMultipol, Set<Relation> relationsToDelete) {
    1324         List<RelationRole> multiouters = new ArrayList<RelationRole>();
     1323        List<RelationRole> multiouters = new ArrayList<>();
    13251324
    13261325        if (ownMultipol != null) {
  • trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java

    r6814 r7005  
    4747        Node node = selectedNodes.iterator().next();
    4848
    49         Collection<Command> cmds = new LinkedList<Command>();
     49        Collection<Command> cmds = new LinkedList<>();
    5050
    5151        // If the user has selected some ways, only join the node to these.
     
    5555            List<WaySegment> wss = Main.map.mapView.getNearestWaySegments(
    5656                    Main.map.mapView.getPoint(node), OsmPrimitive.isSelectablePredicate);
    57             HashMap<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>();
     57            HashMap<Way, List<Integer>> insertPoints = new HashMap<>();
    5858            for (WaySegment ws : wss) {
    5959                // Maybe cleaner to pass a "isSelected" predicate to getNearestWaySegments, but this is less invasive.
     
    6666                    is = insertPoints.get(ws.way);
    6767                } else {
    68                     is = new ArrayList<Integer>();
     68                    is = new ArrayList<>();
    6969                    insertPoints.put(ws.way, is);
    7070                }
     
    9898
    9999    private static void pruneSuccsAndReverse(List<Integer> is) {
    100         HashSet<Integer> is2 = new HashSet<Integer>();
     100        HashSet<Integer> is2 = new HashSet<>();
    101101        for (int i : is) {
    102102            if (!is2.contains(i - 1) && !is2.contains(i + 1)) {
  • trunk/src/org/openstreetmap/josm/actions/MapRectifierWMSmenuAction.java

    r6340 r7005  
    6464     * List of available rectifier services. May be extended from the outside
    6565     */
    66     public List<RectifierService> services = new ArrayList<RectifierService>();
     66    public List<RectifierService> services = new ArrayList<>();
    6767
    6868    public MapRectifierWMSmenuAction() {
  • trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java

    r6679 r7005  
    195195     */
    196196    protected static List<Command> fixParentWays(Collection<Node> nodesToDelete, Node targetNode) {
    197         List<Command> cmds = new ArrayList<Command>();
    198         Set<Way> waysToDelete = new HashSet<Way>();
     197        List<Command> cmds = new ArrayList<>();
     198        Set<Way> waysToDelete = new HashSet<>();
    199199
    200200        for (Way w: OsmPrimitive.getFilteredList(OsmPrimitive.getReferrer(nodesToDelete), Way.class)) {
    201             List<Node> newNodes = new ArrayList<Node>(w.getNodesCount());
     201            List<Node> newNodes = new ArrayList<>(w.getNodesCount());
    202202            for (Node n: w.getNodes()) {
    203203                if (! nodesToDelete.contains(n) && n != targetNode) {
     
    264264            return;
    265265        }
    266         Set<Node> allNodes = new HashSet<Node>(nodes);
     266        Set<Node> allNodes = new HashSet<>(nodes);
    267267        allNodes.add(targetLocationNode);
    268268        Node target;
     
    294294            return null;
    295295        }
    296         Set<Node> allNodes = new HashSet<Node>(nodes);
     296        Set<Node> allNodes = new HashSet<>(nodes);
    297297        allNodes.add(targetLocationNode);
    298298        return mergeNodes(layer, nodes, selectTargetNode(allNodes), targetLocationNode);
     
    320320            TagCollection nodeTags = TagCollection.unionOfAllPrimitives(nodes);
    321321            List<Command> resultion = CombinePrimitiveResolverDialog.launchIfNecessary(nodeTags, nodes, Collections.singleton(targetNode));
    322             LinkedList<Command> cmds = new LinkedList<Command>();
     322            LinkedList<Command> cmds = new LinkedList<>();
    323323
    324324            // the nodes we will have to delete
    325325            //
    326             Collection<Node> nodesToDelete = new HashSet<Node>(nodes);
     326            Collection<Node> nodesToDelete = new HashSet<>(nodes);
    327327            nodesToDelete.remove(targetNode);
    328328
    329329            // fix the ways referring to at least one of the merged nodes
    330330            //
    331             Collection<Way> waysToDelete = new HashSet<Way>();
     331            Collection<Way> waysToDelete = new HashSet<>();
    332332            List<Command> wayFixCommands = fixParentWays(
    333333                    nodesToDelete,
  • trunk/src/org/openstreetmap/josm/actions/MirrorAction.java

    r6830 r7005  
    4545    public void actionPerformed(ActionEvent e) {
    4646        Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
    47         HashSet<Node> nodes = new HashSet<Node>();
     47        HashSet<Node> nodes = new HashSet<>();
    4848
    4949        for (OsmPrimitive osm : sel) {
     
    7373        double middle = (minEast + maxEast) / 2;
    7474
    75         Collection<Command> cmds = new LinkedList<Command>();
     75        Collection<Command> cmds = new LinkedList<>();
    7676
    7777        for (Node n : nodes) {
  • trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java

    r6995 r7005  
    9696    public static class OpenFileTask extends PleaseWaitRunnable {
    9797        private List<File> files;
    98         private List<File> successfullyOpenedFiles = new ArrayList<File>();
     98        private List<File> successfullyOpenedFiles = new ArrayList<>();
    9999        private FileFilter fileFilter;
    100100        private boolean canceled;
     
    103103        public OpenFileTask(List<File> files, FileFilter fileFilter, String title) {
    104104            super(title, false /* don't ignore exception */);
    105             this.files = new ArrayList<File>(files);
     105            this.files = new ArrayList<>(files);
    106106            this.fileFilter = fileFilter;
    107107        }
     
    214214            if (chosenImporter != null) {
    215215                // The importer was explicitly chosen, so use it.
    216                 List<File> filesNotMatchingWithImporter = new LinkedList<File>();
    217                 List<File> filesMatchingWithImporter = new LinkedList<File>();
     216                List<File> filesNotMatchingWithImporter = new LinkedList<>();
     217                List<File> filesMatchingWithImporter = new LinkedList<>();
    218218                for (final File f : files) {
    219219                    if (!chosenImporter.acceptFile(f)) {
     
    247247            } else {
    248248                // find appropriate importer
    249                 MultiMap<FileImporter, File> importerMap = new MultiMap<FileImporter, File>();
    250                 List<File> filesWithUnknownImporter = new LinkedList<File>();
    251                 List<File> urlFiles = new LinkedList<File>();
     249                MultiMap<FileImporter, File> importerMap = new MultiMap<>();
     250                List<File> filesWithUnknownImporter = new LinkedList<>();
     251                List<File> urlFiles = new LinkedList<>();
    252252                FILES: for (File f : files) {
    253253                    for (FileImporter importer : ExtensionFileFilter.importers) {
     
    266266                    alertFilesWithUnknownImporter(filesWithUnknownImporter);
    267267                }
    268                 List<FileImporter> importers = new ArrayList<FileImporter>(importerMap.keySet());
     268                List<FileImporter> importers = new ArrayList<>(importerMap.keySet());
    269269                Collections.sort(importers);
    270270                Collections.reverse(importers);
    271271
    272                 Set<String> fileHistory = new LinkedHashSet<String>();
    273                 Set<String> failedAll = new HashSet<String>();
     272                Set<String> fileHistory = new LinkedHashSet<>();
     273                Set<String> failedAll = new HashSet<>();
    274274
    275275                for (FileImporter importer : importers) {
    276                     List<File> files = new ArrayList<File>(importerMap.get(importer));
     276                    List<File> files = new ArrayList<>(importerMap.get(importer));
    277277                    importData(importer, files);
    278278                    // suppose all files will fail to load
    279                     List<File> failedFiles = new ArrayList<File>(files);
     279                    List<File> failedFiles = new ArrayList<>(files);
    280280
    281281                    if (recordHistory && !importer.isBatchImporter()) {
  • trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java

    r6890 r7005  
    5656                Shortcut.registerShortcut("system:open_location", tr("File: {0}", tr("Open Location...")), KeyEvent.VK_L, Shortcut.CTRL), true);
    5757        putValue("help", ht("/Action/OpenLocation"));
    58         this.downloadTasks = new ArrayList<Class<? extends DownloadTask>>();
     58        this.downloadTasks = new ArrayList<>();
    5959        addDownloadTaskClass(DownloadOsmTask.class);
    6060        addDownloadTaskClass(DownloadGpsTask.class);
     
    7272     */
    7373    protected void restoreUploadAddressHistory(HistoryComboBox cbHistory) {
    74         List<String> cmtHistory = new LinkedList<String>(Main.pref.getCollection(getClass().getName() + ".uploadAddressHistory", new LinkedList<String>()));
     74        List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(getClass().getName() + ".uploadAddressHistory", new LinkedList<String>()));
    7575        // we have to reverse the history, because ComboBoxHistory will reverse it again
    7676        // in addElement()
     
    134134     */
    135135    public Collection<DownloadTask> findDownloadTasks(final String url) {
    136         List<DownloadTask> result = new ArrayList<DownloadTask>();
     136        List<DownloadTask> result = new ArrayList<>();
    137137        for (Class<? extends DownloadTask> taskClass : downloadTasks) {
    138138            if (taskClass != null) {
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r6987 r7005  
    7272     * Remember movements, so the user can later undo it for certain nodes
    7373     */
    74     private static final Map<Node, EastNorth> rememberMovements = new HashMap<Node, EastNorth>();
     74    private static final Map<Node, EastNorth> rememberMovements = new HashMap<>();
    7575
    7676    /**
     
    9898            if (!isEnabled())
    9999                return;
    100             final Collection<Command> commands = new LinkedList<Command>();
     100            final Collection<Command> commands = new LinkedList<>();
    101101            final Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
    102102            try {
     
    145145        }
    146146
    147         final List<Node> nodeList = new ArrayList<Node>();
    148         final List<WayData> wayDataList = new ArrayList<WayData>();
     147        final List<Node> nodeList = new ArrayList<>();
     148        final List<WayData> wayDataList = new ArrayList<>();
    149149        final Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
    150150
     
    165165                if (nodeList.size() == 2 || nodeList.isEmpty()) {
    166166                    OrthogonalizeAction.rememberMovements.clear();
    167                     final Collection<Command> commands = new LinkedList<Command>();
     167                    final Collection<Command> commands = new LinkedList<>();
    168168
    169169                    if (nodeList.size() == 2) {  // fixed direction
     
    202202     */
    203203    private static List<List<WayData>> buildGroups(List<WayData> wayDataList) {
    204         List<List<WayData>> groups = new ArrayList<List<WayData>>();
    205         Set<WayData> remaining = new HashSet<WayData>(wayDataList);
     204        List<List<WayData>> groups = new ArrayList<>();
     205        Set<WayData> remaining = new HashSet<>(wayDataList);
    206206        while (!remaining.isEmpty()) {
    207             List<WayData> group = new ArrayList<WayData>();
     207            List<WayData> group = new ArrayList<>();
    208208            groups.add(group);
    209209            Iterator<WayData> it = remaining.iterator();
    210210            WayData next = it.next();
    211211            it.remove();
    212             extendGroupRec(group, next, new ArrayList<WayData>(remaining));
     212            extendGroupRec(group, next, new ArrayList<>(remaining));
    213213            remaining.removeAll(group);
    214214        }
     
    283283
    284284        // put the nodes of all ways in a set
    285         final HashSet<Node> allNodes = new HashSet<Node>();
     285        final HashSet<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<Node, Double>();
    294         final HashMap<Node, Double> nY = new HashMap<Node, Double>();
     293        final HashMap<Node, Double> nX = new HashMap<>();
     294        final HashMap<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<Node>(allNodes);
     316            final HashSet<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<Node>(); // will contain each node that can be reached from dummy_n
     324                final HashSet<Node> cs = new HashSet<>(); // will contain each node that can be reached from dummy_n
    325325                cs.add(dummy_n);                              // walking only on horizontal / vertical segments
    326326
     
    381381
    382382        // rotate back and log the change
    383         final Collection<Command> commands = new LinkedList<Command>();
     383        final Collection<Command> commands = new LinkedList<>();
    384384        for (Node n: allNodes) {
    385385            EastNorth tmp = new EastNorth(nX.get(n), nY.get(n));
  • trunk/src/org/openstreetmap/josm/actions/ParameterizedActionDecorator.java

    r6084 r7005  
    1616    public ParameterizedActionDecorator(ParameterizedAction action, Map<String, Object> parameters) {
    1717        this.action = action;
    18         this.parameters = new HashMap<String, Object>(parameters);
     18        this.parameters = new HashMap<>(parameters);
    1919    }
    2020
  • trunk/src/org/openstreetmap/josm/actions/PasteAction.java

    r6920 r7005  
    106106
    107107        // Make a copy of pasteBuffer and map from old id to copied data id
    108         List<PrimitiveData> bufferCopy = new ArrayList<PrimitiveData>();
    109         List<PrimitiveData> toSelect = new ArrayList<PrimitiveData>();
    110         Map<Long, Long> newNodeIds = new HashMap<Long, Long>();
    111         Map<Long, Long> newWayIds = new HashMap<Long, Long>();
    112         Map<Long, Long> newRelationIds = new HashMap<Long, Long>();
     108        List<PrimitiveData> bufferCopy = new ArrayList<>();
     109        List<PrimitiveData> toSelect = new ArrayList<>();
     110        Map<Long, Long> newNodeIds = new HashMap<>();
     111        Map<Long, Long> newWayIds = new HashMap<>();
     112        Map<Long, Long> newRelationIds = new HashMap<>();
    113113        for (PrimitiveData data: pasteBuffer.getAll()) {
    114114            if (data.isIncomplete()) {
     
    138138                }
    139139            } else if (data instanceof WayData) {
    140                 List<Long> newNodes = new ArrayList<Long>();
     140                List<Long> newNodes = new ArrayList<>();
    141141                for (Long oldNodeId: ((WayData)data).getNodes()) {
    142142                    Long newNodeId = newNodeIds.get(oldNodeId);
     
    147147                ((WayData)data).setNodes(newNodes);
    148148            } else if (data instanceof RelationData) {
    149                 List<RelationMemberData> newMembers = new ArrayList<RelationMemberData>();
     149                List<RelationMemberData> newMembers = new ArrayList<>();
    150150                for (RelationMemberData member: ((RelationData)data).getMembers()) {
    151151                    OsmPrimitiveType memberType = member.getMemberType();
  • trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java

    r6380 r7005  
    5656        private final Collection<PrimitiveData> source;
    5757        private final Collection<OsmPrimitive> target;
    58         private final List<Tag> commands = new ArrayList<Tag>();
     58        private final List<Tag> commands = new ArrayList<>();
    5959
    6060        public TagPaster(Collection<PrimitiveData> source, Collection<OsmPrimitive> target) {
     
    119119
    120120        protected Map<OsmPrimitiveType, Integer> getSourceStatistics() {
    121             HashMap<OsmPrimitiveType, Integer> ret = new HashMap<OsmPrimitiveType, Integer>();
     121            HashMap<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<OsmPrimitiveType, Integer>();
     131            HashMap<OsmPrimitiveType, Integer> ret = new HashMap<>();
    132132            for (OsmPrimitiveType type: OsmPrimitiveType.dataValues()) {
    133133                int count = OsmPrimitive.getFilteredList(target, type.getOsmClass()).size();
     
    273273        if (!TextTagParser.validateTags(tags)) return false;
    274274
    275         List<Command> commands = new ArrayList<Command>(tags.size());
     275        List<Command> commands = new ArrayList<>(tags.size());
    276276        for (Entry<String, String> entry: tags.entrySet()) {
    277277            String v = entry.getValue();
     
    291291
    292292        PasteTagsAction.TagPaster tagPaster = new PasteTagsAction.TagPaster(directlyAdded, selection);
    293         List<Command> commands = new ArrayList<Command>();
     293        List<Command> commands = new ArrayList<>();
    294294        for (Tag tag : tagPaster.execute()) {
    295295            commands.add(new ChangePropertyCommand(selection, tag.getKey(), "".equals(tag.getValue()) ? null : tag.getValue()));
  • trunk/src/org/openstreetmap/josm/actions/PurgeAction.java

    r7001 r7005  
    9595        layer = Main.main.getEditLayer();
    9696
    97         toPurge = new HashSet<OsmPrimitive>(sel);
    98         toPurgeAdditionally = new ArrayList<OsmPrimitive>();
    99         toPurgeChecked = new HashSet<OsmPrimitive>();
     97        toPurge = new HashSet<>(sel);
     98        toPurgeAdditionally = new ArrayList<>();
     99        toPurgeChecked = new HashSet<>();
    100100
    101101        // Add referrer, unless the object to purge is not new
    102102        // and the parent is a relation
    103         HashSet<OsmPrimitive> toPurgeRecursive = new HashSet<OsmPrimitive>();
     103        HashSet<OsmPrimitive> toPurgeRecursive = new HashSet<>();
    104104        while (!toPurge.isEmpty()) {
    105105
     
    117117            }
    118118            toPurge = toPurgeRecursive;
    119             toPurgeRecursive = new HashSet<OsmPrimitive>();
    120         }
    121 
    122         makeIncomplete = new HashSet<OsmPrimitive>();
     119            toPurgeRecursive = new HashSet<>();
     120        }
     121
     122        makeIncomplete = new HashSet<>();
    123123
    124124        // Find the objects that will be incomplete after purging.
     
    143143        // referrers not yet to-be-purged.
    144144        if (Main.pref.getBoolean("purge.add_untagged_waynodes", true)) {
    145             Set<OsmPrimitive> wayNodes = new HashSet<OsmPrimitive>();
     145            Set<OsmPrimitive> wayNodes = new HashSet<>();
    146146            for (OsmPrimitive osm : toPurgeChecked) {
    147147                if (osm instanceof Way) {
     
    166166
    167167        if (Main.pref.getBoolean("purge.add_relations_with_only_incomplete_members", true)) {
    168             Set<Relation> relSet = new HashSet<Relation>();
     168            Set<Relation> relSet = new HashSet<>();
    169169            for (OsmPrimitive osm : toPurgeChecked) {
    170170                for (OsmPrimitive parent : osm.getReferrers()) {
     
    180180             * Add higher level relations (list gets extended while looping over it)
    181181             */
    182             List<Relation> relLst = new ArrayList<Relation>(relSet);
     182            List<Relation> relLst = new ArrayList<>(relSet);
    183183            for (int i=0; i<relLst.size(); ++i) {
    184184                for (OsmPrimitive parent : relLst.get(i).getReferrers()) {
     
    189189                }
    190190            }
    191             relSet = new HashSet<Relation>(relLst);
     191            relSet = new HashSet<>(relLst);
    192192            toPurgeChecked.addAll(relSet);
    193193            toPurgeAdditionally.addAll(relSet);
     
    248248                }
    249249            });
    250             JList<OsmPrimitive> list = new JList<OsmPrimitive>(toPurgeAdditionally.toArray(new OsmPrimitive[toPurgeAdditionally.size()]));
     250            JList<OsmPrimitive> list = new JList<>(toPurgeAdditionally.toArray(new OsmPrimitive[toPurgeAdditionally.size()]));
    251251            /* force selection to be active for all entries */
    252252            list.setCellRenderer(new OsmPrimitivRenderer() {
  • trunk/src/org/openstreetmap/josm/actions/RestartAction.java

    r6830 r7005  
    8080                throw new IOException("Unable to find suitable java runtime at "+java);
    8181            }
    82             final List<String> cmd = new ArrayList<String>(Collections.singleton(java));
     82            final List<String> cmd = new ArrayList<>(Collections.singleton(java));
    8383            // vm arguments
    8484            for (String arg : ManagementFactory.getRuntimeMXBean().getInputArguments()) {
  • trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java

    r6380 r7005  
    4747
    4848        public Collection<Command> getCommands() {
    49             List<Command> c = new ArrayList<Command>();
     49            List<Command> c = new ArrayList<>();
    5050            c.addAll(tagCorrectionCommands);
    5151            c.add(reverseCommand);
     
    9090
    9191        boolean propertiesUpdated = false;
    92         Collection<Command> c = new LinkedList<Command>();
     92        Collection<Command> c = new LinkedList<>();
    9393        for (Way w : sel) {
    9494            ReverseWayResult revResult;
  • trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java

    r6830 r7005  
    200200        int maxsize = Math.max(0, Main.pref.getInteger("file-open.history.max-size", 15));
    201201        Collection<String> oldHistory = Main.pref.getCollection("file-open.history");
    202         List<String> history = new LinkedList<String>(oldHistory);
     202        List<String> history = new LinkedList<>(oldHistory);
    203203        history.remove(filepath);
    204204        history.add(0, filepath);
  • trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java

    r6830 r7005  
    3838            nodes = null;
    3939        } else {
    40             nodes = new TreeSet<Node>();
    41             outerNodes = new TreeSet<Node>();
     40            nodes = new TreeSet<>();
     41            outerNodes = new TreeSet<>();
    4242
    4343            for (Way way : ways)
     
    149149            return;
    150150
    151         selection = new LinkedList<OsmPrimitive>();
     151        selection = new LinkedList<>();
    152152        for (OsmPrimitive primitive : currentSelection)
    153153            selection.add(primitive);
  • trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java

    r6981 r7005  
    117117        }
    118118
    119         List<Layer> layersOut = new ArrayList<Layer>();
     119        List<Layer> layersOut = new ArrayList<>();
    120120        for (Layer layer : layers) {
    121121            if (exporters.get(layer) == null || !exporters.get(layer).shallExport()) continue;
     
    167167         */
    168168        public final void initialize() {
    169             layers = new ArrayList<Layer>(Main.map.mapView.getAllLayersAsList());
    170             exporters = new HashMap<Layer, SessionLayerExporter>();
    171             dependencies = new MultiMap<Layer, Layer>();
    172 
    173             Set<Layer> noExporter = new HashSet<Layer>();
     169            layers = new ArrayList<>(Main.map.mapView.getAllLayersAsList());
     170            exporters = new HashMap<>();
     171            dependencies = new MultiMap<>();
     172
     173            Set<Layer> noExporter = new HashSet<>();
    174174
    175175            for (Layer layer : layers) {
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r6981 r7005  
    109109            final String propJavaHomeAlt = "<java.home>";
    110110            // Build a new list of VM parameters to modify it below if needed (default implementation returns an UnmodifiableList instance)
    111             List<String> vmArguments = new ArrayList<String>(ManagementFactory.getRuntimeMXBean().getInputArguments());
     111            List<String> vmArguments = new ArrayList<>(ManagementFactory.getRuntimeMXBean().getInputArguments());
    112112            for (ListIterator<String> it = vmArguments.listIterator(); it.hasNext(); ) {
    113113                String value = it.next();
     
    164164            settings.remove("oauth.access-token.key");
    165165            settings.remove("oauth.access-token.secret");
    166             Set<String> keys = new HashSet<String>(settings.keySet());
     166            Set<String> keys = new HashSet<>(settings.keySet());
    167167            for (String key : keys) {
    168168                if (key.startsWith("marker.show")) {
  • trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java

    r6981 r7005  
    107107            }
    108108
    109             Collection<Command> allCommands = new LinkedList<Command>();
     109            Collection<Command> allCommands = new LinkedList<>();
    110110            for (Way way: ways) {
    111111                SequenceCommand simplifyCommand = simplifyWay(way);
     
    139139        boolean isRequired =  Collections.frequency(way.getNodes(), node) > 1;
    140140        if (! isRequired) {
    141             List<OsmPrimitive> parents = new LinkedList<OsmPrimitive>();
     141            List<OsmPrimitive> parents = new LinkedList<>();
    142142            parents.addAll(node.getReferrers());
    143143            parents.remove(way);
     
    171171        int lower = 0;
    172172        int i = 0;
    173         List<Node> newNodes = new ArrayList<Node>(w.getNodesCount());
     173        List<Node> newNodes = new ArrayList<>(w.getNodesCount());
    174174        while(i < w.getNodesCount()){
    175175            if (isRequiredNode(w,w.getNode(i))) {
     
    191191        }
    192192
    193         HashSet<Node> delNodes = new HashSet<Node>();
     193        HashSet<Node> delNodes = new HashSet<>();
    194194        delNodes.addAll(w.getNodes());
    195195        delNodes.removeAll(newNodes);
     
    197197        if (delNodes.isEmpty()) return null;
    198198
    199         Collection<Command> cmds = new LinkedList<Command>();
     199        Collection<Command> cmds = new LinkedList<>();
    200200        Way newWay = new Way(w);
    201201        newWay.setNodes(newNodes);
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r6889 r7005  
    179179        List<List<Node>> wayChunks = buildSplitChunks(selectedWay, selectedNodes);
    180180        if (wayChunks != null) {
    181             List<OsmPrimitive> sel = new ArrayList<OsmPrimitive>(selectedWays.size() + selectedRelations.size());
     181            List<OsmPrimitive> sel = new ArrayList<>(selectedWays.size() + selectedRelations.size());
    182182            sel.addAll(selectedWays);
    183183            sel.addAll(selectedRelations);
     
    216216
    217217        // List of ways shared by all nodes
    218         List<Way> result = new ArrayList<Way>(OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class));
     218        List<Way> result = new ArrayList<>(OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class));
    219219        for (int i=1; i<selectedNodes.size(); i++) {
    220220            List<OsmPrimitive> ref = selectedNodes.get(i).getReferrers();
     
    263263        CheckParameterUtil.ensureParameterNotNull(splitPoints, "splitPoints");
    264264
    265         Set<Node> nodeSet = new HashSet<Node>(splitPoints);
    266         List<List<Node>> wayChunks = new LinkedList<List<Node>>();
    267         List<Node> currentWayChunk = new ArrayList<Node>();
     265        Set<Node> nodeSet = new HashSet<>(splitPoints);
     266        List<List<Node>> wayChunks = new LinkedList<>();
     267        List<Node> currentWayChunk = new ArrayList<>();
    268268        wayChunks.add(currentWayChunk);
    269269
     
    274274            currentWayChunk.add(currentNode);
    275275            if (nodeSet.contains(currentNode) && !atEndOfWay) {
    276                 currentWayChunk = new ArrayList<Node>();
     276                currentWayChunk = new ArrayList<>();
    277277                currentWayChunk.add(currentNode);
    278278                wayChunks.add(currentWayChunk);
     
    335335    public static SplitWayResult splitWay(OsmDataLayer layer, Way way, List<List<Node>> wayChunks, Collection<? extends OsmPrimitive> selection) {
    336336        // build a list of commands, and also a new selection list
    337         Collection<Command> commandList = new ArrayList<Command>(wayChunks.size());
    338         List<OsmPrimitive> newSelection = new ArrayList<OsmPrimitive>(selection.size() + wayChunks.size());
     337        Collection<Command> commandList = new ArrayList<>(wayChunks.size());
     338        List<OsmPrimitive> newSelection = new ArrayList<>(selection.size() + wayChunks.size());
    339339        newSelection.addAll(selection);
    340340
     
    351351        }
    352352
    353         List<Way> newWays = new ArrayList<Way>();
     353        List<Way> newWays = new ArrayList<>();
    354354        // Second, create new ways
    355355        while (chunkIt.hasNext()) {
     
    393393                                }
    394394                            }
    395                             List<Node> nodes = new ArrayList<Node>();
     395                            List<Node> nodes = new ArrayList<>();
    396396                            if(via != null) {
    397397                                if(via instanceof Node) {
  • trunk/src/org/openstreetmap/josm/actions/ToggleAction.java

    r6338 r7005  
    2323public abstract class ToggleAction extends JosmAction {
    2424
    25     private final List<ButtonModel> buttonModels = new ArrayList<ButtonModel>();
     25    private final List<ButtonModel> buttonModels = new ArrayList<>();
    2626
    2727    /**
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r6981 r7005  
    106106                return;
    107107            }
    108             Set<Node> tmpNodes = new HashSet<Node>();
     108            Set<Node> tmpNodes = new HashSet<>();
    109109            for (Node n : selectedNodes) {
    110110                int count = 0;
     
    165165     */
    166166    private void unglueNode(ActionEvent e) {
    167         LinkedList<Command> cmds = new LinkedList<Command>();
     167        LinkedList<Command> cmds = new LinkedList<>();
    168168
    169169        Node c = new Node(selectedNode);
     
    274274            return false;
    275275
    276         selectedNodes = new HashSet<Node>();
     276        selectedNodes = new HashSet<>();
    277277        for (OsmPrimitive p : selection) {
    278278            if (p instanceof Node) {
     
    307307        cmds.add(new AddCommand(newNode));
    308308
    309         List<Node> nn = new ArrayList<Node>();
     309        List<Node> nn = new ArrayList<>();
    310310        for (Node pushNode : w.getNodes()) {
    311311            if (originalNode == pushNode) {
     
    337337                    if (newRel == null) {
    338338                        newRel = new Relation(r);
    339                         rolesToReAdd = new HashSet<String>();
     339                        rolesToReAdd = new HashSet<>();
    340340                    }
    341341                    rolesToReAdd.add(rm.getRole());
     
    359359     */
    360360    private void unglueWays() {
    361         LinkedList<Command> cmds = new LinkedList<Command>();
    362         LinkedList<Node> newNodes = new LinkedList<Node>();
     361        LinkedList<Command> cmds = new LinkedList<>();
     362        LinkedList<Node> newNodes = new LinkedList<>();
    363363
    364364        if (selectedWay == null) {
    365365            Way wayWithSelectedNode = null;
    366             LinkedList<Way> parentWays = new LinkedList<Way>();
     366            LinkedList<Way> parentWays = new LinkedList<>();
    367367            for (OsmPrimitive osm : selectedNode.getReferrers()) {
    368368                if (osm.isUsable() && osm instanceof Way) {
     
    407407    private boolean unglueSelfCrossingWay() {
    408408        // According to previous check, only one valid way through that node
    409         LinkedList<Command> cmds = new LinkedList<Command>();
     409        LinkedList<Command> cmds = new LinkedList<>();
    410410        Way way = null;
    411411        for (Way w: OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class))
     
    414414            }
    415415        List<Node> oldNodes = way.getNodes();
    416         ArrayList<Node> newNodes = new ArrayList<Node>(oldNodes.size());
    417         ArrayList<Node> addNodes = new ArrayList<Node>();
     416        ArrayList<Node> newNodes = new ArrayList<>(oldNodes.size());
     417        ArrayList<Node> addNodes = new ArrayList<>();
    418418        boolean seen = false;
    419419        for (Node n: oldNodes) {
     
    449449     */
    450450    private void unglueWays2() {
    451         LinkedList<Command> cmds = new LinkedList<Command>();
    452         List<Node> allNewNodes = new LinkedList<Node>();
     451        LinkedList<Command> cmds = new LinkedList<>();
     452        List<Node> allNewNodes = new LinkedList<>();
    453453        Way tmpWay = selectedWay;
    454454
    455455        for (Node n : selectedNodes) {
    456             List<Node> newNodes = new LinkedList<Node>();
     456            List<Node> newNodes = new LinkedList<>();
    457457            tmpWay = modifyWay(n, tmpWay, cmds, newNodes);
    458458            fixRelations(n, cmds, newNodes);
     
    481481
    482482    protected boolean checkAndConfirmOutlyingUnglue() {
    483         List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>(2 + (selectedNodes == null ? 0 : selectedNodes.size()));
     483        List<OsmPrimitive> primitives = new ArrayList<>(2 + (selectedNodes == null ? 0 : selectedNodes.size()));
    484484        if (selectedNodes != null)
    485485            primitives.addAll(selectedNodes);
  • trunk/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java

    r6986 r7005  
    9999
    100100        // List of ways shared by all nodes
    101         List<Way> result = new ArrayList<Way>(OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class));
     101        List<Way> result = new ArrayList<>(OsmPrimitive.getFilteredList(selectedNodes.get(0).getReferrers(), Way.class));
    102102        for (int i=1; i<selectedNodes.size(); i++) {
    103103            List<OsmPrimitive> ref = selectedNodes.get(i).getReferrers();
  • trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java

    r6643 r7005  
    5151            return;
    5252
    53         List<Area> areas = new ArrayList<Area>();
     53        List<Area> areas = new ArrayList<>();
    5454        for(DataSource ds : getEditLayer().data.dataSources) {
    5555            areas.add(new Area(ds.bounds.asRect()));
     
    7272        }
    7373
    74         List<Area> areasToDownload = new ArrayList<Area>();
     74        List<Area> areasToDownload = new ArrayList<>();
    7575        for(Area a : areas) {
    7676            if(a.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/actions/UploadAction.java

    r6654 r7005  
    5353     * however, a plugin might also want to insert something after that.
    5454     */
    55     private static final List<UploadHook> uploadHooks = new LinkedList<UploadHook>();
    56     private static final List<UploadHook> lateUploadHooks = new LinkedList<UploadHook>();
     55    private static final List<UploadHook> uploadHooks = new LinkedList<>();
     56    private static final List<UploadHook> lateUploadHooks = new LinkedList<>();
    5757    static {
    5858        /**
     
    232232            @Override
    233233            public void run() {
    234                 final HashMap<String, String> tags = new HashMap<String, String>(layer.data.getChangeSetTags());
     234                final HashMap<String, String> tags = new HashMap<>(layer.data.getChangeSetTags());
    235235                if (!tags.containsKey("source")) {
    236236                    tags.put("source", dialog.getLastChangesetSourceFromHistory());
  • trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java

    r6380 r7005  
    6666
    6767    protected Set<OsmPrimitive> getDeletedPrimitives(DataSet ds) {
    68         HashSet<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
     68        HashSet<OsmPrimitive> ret = new HashSet<>();
    6969        for (OsmPrimitive p: ds.allPrimitives()) {
    7070            if (p.isDeleted() && !p.isNew() && p.isVisible() && p.isModified()) {
     
    7676
    7777    protected Set<OsmPrimitive> getModifiedPrimitives(Collection<OsmPrimitive> primitives) {
    78         HashSet<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
     78        HashSet<OsmPrimitive> ret = new HashSet<>();
    7979        for (OsmPrimitive p: primitives) {
    8080            if (p.isNewOrUndeleted()) {
     
    188188
    189189        public UploadHullBuilder(){
    190             hull = new HashSet<OsmPrimitive>();
     190            hull = new HashSet<>();
    191191        }
    192192
     
    243243        public Set<OsmPrimitive> build(Collection<OsmPrimitive> base) throws IllegalArgumentException{
    244244            CheckParameterUtil.ensureParameterNotNull(base, "base");
    245             hull = new HashSet<OsmPrimitive>();
     245            hull = new HashSet<>();
    246246            for (OsmPrimitive p: base) {
    247247                p.accept(this);
     
    303303         */
    304304        protected Set<OsmPrimitive> getPrimitivesToCheckForParents() {
    305             HashSet<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
     305            HashSet<OsmPrimitive> ret = new HashSet<>();
    306306            for (OsmPrimitive p: toUpload) {
    307307                if (p.isDeleted() && !p.isNewOrUndeleted()) {
     
    315315        protected void realRun() throws SAXException, IOException, OsmTransferException {
    316316            try {
    317                 Stack<OsmPrimitive> toCheck = new Stack<OsmPrimitive>();
     317                Stack<OsmPrimitive> toCheck = new Stack<>();
    318318                toCheck.addAll(getPrimitivesToCheckForParents());
    319                 Set<OsmPrimitive> checked = new HashSet<OsmPrimitive>();
     319                Set<OsmPrimitive> checked = new HashSet<>();
    320320                while(!toCheck.isEmpty()) {
    321321                    if (canceled) return;
  • trunk/src/org/openstreetmap/josm/actions/ValidateAction.java

    r6779 r7005  
    160160            if (tests == null || tests.isEmpty())
    161161                return;
    162             errors = new ArrayList<TestError>(200);
     162            errors = new ArrayList<>(200);
    163163            getProgressMonitor().setTicksCount(tests.size() * validatedPrimitives.size());
    164164            int testCounter = 0;
     
    179179                for (TestError error : errors) {
    180180                    if (canceled) return;
    181                     List<String> s = new ArrayList<String>();
     181                    List<String> s = new ArrayList<>();
    182182                    s.add(error.getIgnoreState());
    183183                    s.add(error.getIgnoreGroup());
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java

    r6085 r7005  
    1616
    1717    public AbstractDownloadTask() {
    18         errorMessages = new ArrayList<Object>();
     18        errorMessages = new ArrayList<>();
    1919    }
    2020
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java

    r6920 r7005  
    103103                // A changeset does not contain all referred primitives, this is the map of incomplete ones
    104104                // For each incomplete primitive, we'll have to get its state at date it was referred
    105                 Map<OsmPrimitive, Date> toLoad = new HashMap<OsmPrimitive, Date>();
     105                Map<OsmPrimitive, Date> toLoad = new HashMap<>();
    106106                for (OsmPrimitive p : downloadedData.allNonDeletedPrimitives()) {
    107107                    if (p.isIncomplete()) {
     
    142142        @Override
    143143        public void historyUpdated(HistoryDataSet source, PrimitiveId id) {
    144             Map<OsmPrimitive, Date> toLoadNext = new HashMap<OsmPrimitive, Date>();
     144            Map<OsmPrimitive, Date> toLoadNext = new HashMap<>();
    145145            for (Iterator<OsmPrimitive> it = toLoad.keySet().iterator(); it.hasNext();) {
    146146                OsmPrimitive p = it.next();
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r6920 r7005  
    309309            if (urlString.matches(PATTERN_OSM_API_URL)) {
    310310                // TODO: proper i18n after stabilization
    311                 Collection<String> items = new ArrayList<String>();
     311                Collection<String> items = new ArrayList<>();
    312312                items.add(tr("OSM Server URL:") + " " + url.getHost());
    313313                items.add(tr("Command")+": "+url.getPath());
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTask.java

    r6973 r7005  
    6262        CheckParameterUtil.ensureParameterNotNull(targetLayer, "targetLayer");
    6363        canceled = false;
    64         this.children = new HashMap<Long, OsmPrimitiveType>();
     64        this.children = new HashMap<>();
    6565        if (children != null) {
    6666            for (OsmPrimitive p: children) {
     
    8585        CheckParameterUtil.ensureParameterNotNull(targetLayer, "targetLayer");
    8686        canceled = false;
    87         this.children = new HashMap<Long, OsmPrimitiveType>();
     87        this.children = new HashMap<>();
    8888        if (children != null) {
    8989            for (Entry<Long, OsmPrimitiveType> entry : children.entrySet()) {
     
    115115        CheckParameterUtil.ensureParameterNotNull(type, "type");
    116116        canceled = false;
    117         this.children = new HashMap<Long, OsmPrimitiveType>();
     117        this.children = new HashMap<>();
    118118        this.children.put(id, type);
    119119        this.targetLayer = targetLayer;
     
    151151            throw new IllegalArgumentException(MessageFormat.format("Cannot download referrers for new primitives (ID {0})", primitiveId.getUniqueId()));
    152152        canceled = false;
    153         this.children = new HashMap<Long, OsmPrimitiveType>();
     153        this.children = new HashMap<>();
    154154        this.children.put(primitiveId.getUniqueId(), primitiveId.getType());
    155155        this.targetLayer = targetLayer;
     
    215215        DataSetMerger merger;
    216216        if (!ways.isEmpty()) {
    217             Set<Node> nodes = new HashSet<Node>();
     217            Set<Node> nodes = new HashSet<>();
    218218            for (Way w: ways) {
    219219                // Ensure each node is only listed once
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java

    r6643 r7005  
    4444 */
    4545public class DownloadTaskList {
    46     private List<DownloadTask> tasks = new LinkedList<DownloadTask>();
    47     private List<Future<?>> taskFutures = new LinkedList<Future<?>>();
     46    private List<DownloadTask> tasks = new LinkedList<>();
     47    private List<Future<?>> taskFutures = new LinkedList<>();
    4848    private ProgressMonitor progressMonitor;
    4949
     
    108108        progressMonitor.beginTask(tr("Updating data"));
    109109        try {
    110             List<Rectangle2D> rects = new ArrayList<Rectangle2D>(areas.size());
     110            List<Rectangle2D> rects = new ArrayList<>(areas.size());
    111111            for (Area a : areas) {
    112112                rects.add(a.getBounds2D());
     
    126126     */
    127127    protected Set<OsmPrimitive> getCompletePrimitives(DataSet ds) {
    128         HashSet<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
     128        HashSet<OsmPrimitive> ret = new HashSet<>();
    129129        for (OsmPrimitive primitive : ds.allPrimitives()) {
    130130            if (!primitive.isIncomplete() && !primitive.isNew()) {
     
    142142     */
    143143    protected void updatePotentiallyDeletedPrimitives(Set<OsmPrimitive> potentiallyDeleted) {
    144         final List<OsmPrimitive> toSelect = new ArrayList<OsmPrimitive>();
     144        final List<OsmPrimitive> toSelect = new ArrayList<>();
    145145        for (OsmPrimitive primitive : potentiallyDeleted) {
    146146            if (primitive != null) {
     
    216216     */
    217217    public Set<OsmPrimitive> getDownloadedPrimitives() {
    218         HashSet<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
     218        HashSet<OsmPrimitive> ret = new HashSet<>();
    219219        for (DownloadTask task : tasks) {
    220220            if (task instanceof DownloadOsmTask) {
     
    253253                }
    254254            }
    255             LinkedHashSet<Object> errors = new LinkedHashSet<Object>();
     255            LinkedHashSet<Object> errors = new LinkedHashSet<>();
    256256            for (DownloadTask dt : tasks) {
    257257                errors.addAll(dt.getErrorObjects());
    258258            }
    259259            if (!errors.isEmpty()) {
    260                 final Collection<String> items = new ArrayList<String>();
     260                final Collection<String> items = new ArrayList<>();
    261261                for (Object error : errors) {
    262262                    if (error instanceof String) {
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java

    r6643 r7005  
    2929    public PostDownloadHandler(DownloadTask task, Future<?> future) {
    3030        this.task = task;
    31         this.futures = new ArrayList<Future<?>>();
     31        this.futures = new ArrayList<>();
    3232        if (future != null) {
    3333            this.futures.add(future);
     
    4242    public PostDownloadHandler(DownloadTask task, Future<?> ... futures) {
    4343        this.task = task;
    44         this.futures = new ArrayList<Future<?>>();
     44        this.futures = new ArrayList<>();
    4545        if (futures == null) return;
    4646        for (Future<?> future: futures) {
     
    5656    public PostDownloadHandler(DownloadTask task, List<Future<?>> futures) {
    5757        this.task = task;
    58         this.futures = new ArrayList<Future<?>>();
     58        this.futures = new ArrayList<>();
    5959        if (futures == null) return;
    6060        this.futures.addAll(futures);
     
    7777        // make sure errors are reported only once
    7878        //
    79         LinkedHashSet<Object> errors = new LinkedHashSet<Object>();
     79        LinkedHashSet<Object> errors = new LinkedHashSet<>();
    8080        errors.addAll(task.getErrorObjects());
    8181        if (errors.isEmpty())
     
    106106        //
    107107        if (!errors.isEmpty()) {
    108             final Collection<String> items = new ArrayList<String>();
     108            final Collection<String> items = new ArrayList<>();
    109109            for (Object error:errors) {
    110110                if (error instanceof String) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java

    r6889 r7005  
    194194            return;
    195195
    196         Set<OsmPrimitive> newHighlights = new HashSet<OsmPrimitive>();
     196        Set<OsmPrimitive> newHighlights = new HashSet<>();
    197197        DeleteParameters parameters = getDeleteParameters(e, modifiers);
    198198
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r6920 r7005  
    9090
    9191    private Node mouseOnExistingNode;
    92     private Set<Way> mouseOnExistingWays = new HashSet<Way>();
     92    private Set<Way> mouseOnExistingWays = new HashSet<>();
    9393    // old highlights store which primitives are currently highlighted. This
    9494    // is true, even if target highlighting is disabled since the status bar
    9595    // derives its information from this list as well.
    96     private Set<OsmPrimitive> oldHighlights = new HashSet<OsmPrimitive>();
     96    private Set<OsmPrimitive> oldHighlights = new HashSet<>();
    9797    // new highlights contains a list of primitives that should be highlighted
    9898    // but haven’t been so far. The idea is to compare old and new and only
    9999    // repaint if there are changes.
    100     private Set<OsmPrimitive> newHighlights = new HashSet<OsmPrimitive>();
     100    private Set<OsmPrimitive> newHighlights = new HashSet<>();
    101101    private boolean drawHelperLine;
    102102    private boolean wayIsFinished = false;
     
    306306
    307307    // events for crossplatform key holding processing
    308     private final Set<Integer> set = new TreeSet<Integer>();
     308    private final Set<Integer> set = new TreeSet<>();
    309309    private KeyEvent releaseEvent;
    310310    private Timer timer;
     
    425425
    426426        DataSet ds = getCurrentDataSet();
    427         Collection<OsmPrimitive> selection = new ArrayList<OsmPrimitive>(ds.getSelected());
    428         Collection<Command> cmds = new LinkedList<Command>();
    429         Collection<OsmPrimitive> newSelection = new LinkedList<OsmPrimitive>(ds.getSelected());
    430 
    431         List<Way> reuseWays = new ArrayList<Way>(),
    432                 replacedWays = new ArrayList<Way>();
     427        Collection<OsmPrimitive> selection = new ArrayList<>(ds.getSelected());
     428        Collection<Command> cmds = new LinkedList<>();
     429        Collection<OsmPrimitive> newSelection = new LinkedList<>(ds.getSelected());
     430
     431        List<Way> reuseWays = new ArrayList<>(),
     432                replacedWays = new ArrayList<>();
    433433        boolean newNode = false;
    434434        Node n = null;
     
    658658
    659659    private void insertNodeIntoAllNearbySegments(List<WaySegment> wss, Node n, Collection<OsmPrimitive> newSelection, Collection<Command> cmds, List<Way> replacedWays, List<Way> reuseWays) {
    660         Map<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>();
     660        Map<Way, List<Integer>> insertPoints = new HashMap<>();
    661661        for (WaySegment ws : wss) {
    662662            List<Integer> is;
     
    664664                is = insertPoints.get(ws.way);
    665665            } else {
    666                 is = new ArrayList<Integer>();
     666                is = new ArrayList<>();
    667667                insertPoints.put(ws.way, is);
    668668            }
     
    671671        }
    672672
    673         Set<Pair<Node,Node>> segSet = new HashSet<Pair<Node,Node>>();
     673        Set<Pair<Node,Node>> segSet = new HashSet<>();
    674674
    675675        for (Map.Entry<Way, List<Integer>> insertPoint : insertPoints.entrySet()) {
     
    681681            pruneSuccsAndReverse(is);
    682682            for (int i : is) {
    683                 segSet.add(Pair.sort(new Pair<Node,Node>(w.getNode(i), w.getNode(i+1))));
     683                segSet.add(Pair.sort(new Pair<>(w.getNode(i), w.getNode(i+1))));
    684684            }
    685685            for (int i : is) {
     
    814814        Node currentMouseNode = null;
    815815        mouseOnExistingNode = null;
    816         mouseOnExistingWays = new HashSet<Way>();
     816        mouseOnExistingWays = new HashSet<>();
    817817
    818818        showStatusInfo(-1, -1, -1, snapHelper.isSnapOn());
     
    980980
    981981    private static void pruneSuccsAndReverse(List<Integer> is) {
    982         HashSet<Integer> is2 = new HashSet<Integer>();
     982        HashSet<Integer> is2 = new HashSet<>();
    983983        for (int i : is) {
    984984            if (!is2.contains(i - 1) && !is2.contains(i + 1)) {
     
    10931093     */
    10941094    private void addHighlighting() {
    1095         newHighlights = new HashSet<OsmPrimitive>();
     1095        newHighlights = new HashSet<>();
    10961096
    10971097        // if ctrl key is held ("no join"), don't highlight anything
     
    11321132     */
    11331133    private boolean removeHighlighting() {
    1134         newHighlights = new HashSet<OsmPrimitive>();
     1134        newHighlights = new HashSet<>();
    11351135        return redrawIfRequired();
    11361136    }
     
    15701570                if (selectedWays.size()==1) {
    15711571                    Way w = selectedWays.iterator().next();
    1572                     Collection <EastNorth> pointsToProject = new ArrayList<EastNorth>();
     1572                    Collection <EastNorth> pointsToProject = new ArrayList<>();
    15731573                    if (w.getNodesCount()<1000) {
    15741574                        for (Node n: w.getNodes()) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r6889 r7005  
    257257        if (selectedNode != null) {
    258258            if (ctrl || nodeDragWithoutCtrl) {
    259                 movingNodeList = new ArrayList<OsmPrimitive>();
     259                movingNodeList = new ArrayList<>();
    260260                movingNodeList.add(selectedNode);
    261261                calculatePossibleDirectionsByNode();
     
    270270            if (ctrl) {
    271271                mode = Mode.translate;
    272                 movingNodeList = new ArrayList<OsmPrimitive>();
     272                movingNodeList = new ArrayList<>();
    273273                movingNodeList.add(selectedSegment.getFirstNode());
    274274                movingNodeList.add(selectedSegment.getSecondNode());
     
    417417        if (selectedSegment == null) return;
    418418        // crete a new rectangle
    419         Collection<Command> cmds = new LinkedList<Command>();
     419        Collection<Command> cmds = new LinkedList<>();
    420420        Node third = new Node(newN2en);
    421421        Node fourth = new Node(newN1en);
     
    441441    private void performExtrusion() {
    442442        // create extrusion
    443         Collection<Command> cmds = new LinkedList<Command>();
     443        Collection<Command> cmds = new LinkedList<>();
    444444        Way wnew = new Way(selectedSegment.way);
    445445        boolean wayWasModified = false;
     
    593593
    594594        //add direction perpendicular to the selected segment
    595         possibleMoveDirections = new ArrayList<ReferenceSegment>();
     595        possibleMoveDirections = new ArrayList<>();
    596596        possibleMoveDirections.add(new ReferenceSegment(new EastNorth(
    597597                initialN1en.getY() - initialN2en.getY(),
     
    627627        initialN1en = selectedNode.getEastNorth();
    628628        initialN2en = initialN1en;
    629         possibleMoveDirections = new ArrayList<ReferenceSegment>();
     629        possibleMoveDirections = new ArrayList<>();
    630630        for (OsmPrimitive p: selectedNode.getReferrers()) {
    631631            if (p instanceof Way  && p.isUsable()) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java

    r6889 r7005  
    389389                // Important: If there are other ways containing the same
    390390                // segment, a node must added to all of that ways.
    391                 Collection<Command> virtualCmds = new LinkedList<Command>();
     391                Collection<Command> virtualCmds = new LinkedList<>();
    392392
    393393                // Creating a new node
     
    406406                        Way.class);
    407407
    408                 Collection<WaySegment> virtualSegments = new LinkedList<WaySegment>();
     408                Collection<WaySegment> virtualSegments = new LinkedList<>();
    409409                for (Way w : firstNodeWays) {
    410410                    List<Pair<Node, Node>> wpps = w.getNodePairs(true);
     
    456456                            tr("Error"), JOptionPane.ERROR_MESSAGE);
    457457                } else {
    458                     List<Node> nodeList = new ArrayList<Node>();
     458                    List<Node> nodeList = new ArrayList<>();
    459459                    nodeList.add(candidateNode);
    460460                    Command deleteCmd = DeleteCommand.delete(getEditLayer(), nodeList, true);
     
    600600     */
    601601    private void updateStateByCurrentSelection() {
    602         final List<Node> nodeList = new ArrayList<Node>();
    603         final List<Way> wayList = new ArrayList<Way>();
     602        final List<Node> nodeList = new ArrayList<>();
     603        final List<Way> wayList = new ArrayList<>();
    604604        final Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected();
    605605
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java

    r6992 r7005  
    166166            Main.warn(ex);
    167167        }
    168         sourceWays = new LinkedHashSet<Way>(getCurrentDataSet().getSelectedWays());
     168        sourceWays = new LinkedHashSet<>(getCurrentDataSet().getSelectedWays());
    169169        for (Way w : sourceWays) {
    170170            w.setHighlighted(true);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java

    r6889 r7005  
    4040        // Make a deep copy of the ways, keeping the copied ways connected
    4141        // TODO: This assumes the first/last nodes of the ways are the only possible shared nodes.
    42         HashMap<Node, Node> splitNodeMap = new HashMap<Node, Node>(sourceWays.size());
     42        HashMap<Node, Node> splitNodeMap = new HashMap<>(sourceWays.size());
    4343        for (Way w : sourceWays) {
    4444            if (!splitNodeMap.containsKey(w.firstNode())) {
     
    4949            }
    5050        }
    51         ways = new ArrayList<Way>(sourceWays.size());
     51        ways = new ArrayList<>(sourceWays.size());
    5252        for (Way w : sourceWays) {
    5353            Way wCopy = new Way();
     
    7171
    7272        // Fix #8631 - Remove duplicated nodes from graph to be robust with self-intersecting ways
    73         Set<Node> removedNodes = new HashSet<Node>();
    74         sortedNodes = new ArrayList<Node>();
     73        Set<Node> removedNodes = new HashSet<>();
     74        sortedNodes = new ArrayList<>();
    7575        for (int i = 0; i < sortedNodesPath.size(); i++) {
    7676            Node n = sortedNodesPath.get(i);
     
    178178
    179179    private List<Command> makeAddWayAndNodesCommandList() {
    180         List<Command> commands = new ArrayList<Command>(sortedNodes.size() + ways.size());
     180        List<Command> commands = new ArrayList<>(sortedNodes.size() + ways.size());
    181181        for (int i = 0; i < sortedNodes.size() - (isClosedPath() ? 1 : 0); i++) {
    182182            commands.add(new AddCommand(sortedNodes.get(i)));
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r7000 r7005  
    160160     * set would have to be checked.
    161161     */
    162     private Set<OsmPrimitive> oldHighlights = new HashSet<OsmPrimitive>();
     162    private Set<OsmPrimitive> oldHighlights = new HashSet<>();
    163163
    164164    /**
     
    254254        determineMapMode(!c.isEmpty());
    255255
    256         HashSet<OsmPrimitive> newHighlights = new HashSet<OsmPrimitive>();
     256        HashSet<OsmPrimitive> newHighlights = new HashSet<>();
    257257
    258258        virtualManager.clear();
     
    362362            prim.setHighlighted(false);
    363363        }
    364         oldHighlights = new HashSet<OsmPrimitive>();
     364        oldHighlights = new HashSet<>();
    365365        return true;
    366366    }
     
    846846            return;
    847847
    848         Collection<Node> nodesToMerge = new LinkedList<Node>(selNodes);
     848        Collection<Node> nodesToMerge = new LinkedList<>(selNodes);
    849849        nodesToMerge.add(target);
    850850        MergeNodesAction.doMergeNodes(Main.main.getEditLayer(), nodesToMerge, target);
     
    10741074
    10751075        private Node virtualNode = null;
    1076         private Collection<WaySegment> virtualWays = new LinkedList<WaySegment>();
     1076        private Collection<WaySegment> virtualWays = new LinkedList<>();
    10771077        private int nodeVirtualSize;
    10781078        private int virtualSnapDistSq2;
     
    11001100            if (nodeVirtualSize > 0) {
    11011101
    1102                 Collection<WaySegment> selVirtualWays = new LinkedList<WaySegment>();
    1103                 Pair<Node, Node> vnp = null, wnp = new Pair<Node, Node>(null, null);
     1102                Collection<WaySegment> selVirtualWays = new LinkedList<>();
     1103                Pair<Node, Node> vnp = null, wnp = new Pair<>(null, null);
    11041104
    11051105                Way w = null;
     
    11171117                            Pair.sort(wnp);
    11181118                            if (vnp == null) {
    1119                                 vnp = new Pair<Node, Node>(wnp.a, wnp.b);
     1119                                vnp = new Pair<>(wnp.a, wnp.b);
    11201120                                virtualNode = new Node(mv.getLatLon(pc.getX(), pc.getY()));
    11211121                            }
     
    11391139
    11401140        private void createMiddleNodeFromVirtual(EastNorth currentEN) {
    1141             Collection<Command> virtualCmds = new LinkedList<Command>();
     1141            Collection<Command> virtualCmds = new LinkedList<>();
    11421142            virtualCmds.add(new AddCommand(virtualNode));
    11431143            for (WaySegment virtualWay : virtualWays) {
  • trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java

    r5821 r7005  
    2424            return Collections.<Relation>emptySet();
    2525        } else {
    26             return new SubclassFilteredCollection<OsmPrimitive, Relation>(
     26            return new SubclassFilteredCollection<>(
    2727                    primitives, OsmPrimitive.relationPredicate);
    2828        }
    2929    }
    3030   
    31     /* (non-Javadoc)
    32      * @see org.openstreetmap.josm.actions.relation.RelationAction#setPrimitives
    33      */
    3431    @Override
    3532    public void setPrimitives(Collection<? extends OsmPrimitive> primitives) {
  • trunk/src/org/openstreetmap/josm/actions/relation/AddSelectionToRelations.java

    r5799 r7005  
    3131    @Override
    3232    public void actionPerformed(ActionEvent e) {
    33         Collection<Command> cmds = new LinkedList<Command>();
     33        Collection<Command> cmds = new LinkedList<>();
    3434        for (Relation orig : relations) {
    3535            Command c = GenericRelationEditor.addPrimitivesToRelation(orig, Main.main.getCurrentDataSet().getSelected());
  • trunk/src/org/openstreetmap/josm/actions/relation/DownloadSelectedIncompleteMembersAction.java

    r6336 r7005  
    3838     */
    3939    public Set<OsmPrimitive> buildSetOfIncompleteMembers(Collection<Relation> rels) {
    40         Set<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
     40        Set<OsmPrimitive> ret = new HashSet<>();
    4141        for (Relation r : rels) {
    4242            ret.addAll(r.getIncompleteMembers());
  • trunk/src/org/openstreetmap/josm/actions/relation/EditRelationAction.java

    r6806 r7005  
    4141     */
    4242    public static Set<RelationMember> getMembersForCurrentSelection(Relation r) {
    43         Set<RelationMember> members = new HashSet<RelationMember>();
     43        Set<RelationMember> members = new HashSet<>();
    4444        if (Main.isDisplayingMapView()) {
    4545            OsmDataLayer editLayer = Main.main.getEditLayer();
  • trunk/src/org/openstreetmap/josm/actions/relation/SelectMembersAction.java

    r6986 r7005  
    3636        if (!isEnabled() || relations.isEmpty() || !Main.isDisplayingMapView()) return;
    3737       
    38         HashSet<OsmPrimitive> members = new HashSet<OsmPrimitive>();
     38        HashSet<OsmPrimitive> members = new HashSet<>();
    3939        for (Relation r: relations) {
    4040            members.addAll(r.getMemberPrimitives());
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r6844 r7005  
    8484    }
    8585
    86     private static final LinkedList<SearchSetting> searchHistory = new LinkedList<SearchSetting>();
     86    private static final LinkedList<SearchSetting> searchHistory = new LinkedList<>();
    8787    static {
    8888        for (String s: Main.pref.getCollection("search.history", Collections.<String>emptyList())) {
     
    110110            searchHistory.removeLast();
    111111        }
    112         LinkedHashSet<String> savedHistory = new LinkedHashSet<String>(searchHistory.size());
     112        LinkedHashSet<String> savedHistory = new LinkedHashSet<>(searchHistory.size());
    113113        for (SearchSetting item: searchHistory) {
    114114            savedHistory.add(item.writeToString());
     
    118118
    119119    public static List<String> getSearchExpressionHistory() {
    120         List<String> ret = new ArrayList<String>(getSearchHistory().size());
     120        List<String> ret = new ArrayList<>(getSearchHistory().size());
    121121        for (SearchSetting ss: getSearchHistory()) {
    122122            ret.add(ss.text);
     
    582582
    583583        final DataSet ds = Main.main.getCurrentDataSet();
    584         Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>(ds.getAllSelected());
     584        Collection<OsmPrimitive> sel = new HashSet<>(ds.getAllSelected());
    585585        int foundMatches = getSelection(s, sel, new Predicate<OsmPrimitive>(){
    586586            @Override
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r6990 r7005  
    5959    private static String  rxErrorMsgNoPos = marktr("The regex \"{0}\" had a parse error, full error:\n\n{1}");
    6060    private PushbackTokenizer tokenizer;
    61     private static Map<String, SimpleMatchFactory> simpleMatchFactoryMap = new HashMap<String, SimpleMatchFactory>();
    62     private static Map<String, UnaryMatchFactory> unaryMatchFactoryMap = new HashMap<String, UnaryMatchFactory>();
    63     private static Map<String, BinaryMatchFactory> binaryMatchFactoryMap = new HashMap<String, BinaryMatchFactory>();
     61    private static Map<String, SimpleMatchFactory> simpleMatchFactoryMap = new HashMap<>();
     62    private static Map<String, UnaryMatchFactory> unaryMatchFactoryMap = new HashMap<>();
     63    private static Map<String, BinaryMatchFactory> binaryMatchFactoryMap = new HashMap<>();
    6464
    6565    public SearchCompiler(boolean caseSensitive, boolean regexSearch, PushbackTokenizer tokenizer) {
  • trunk/src/org/openstreetmap/josm/actions/upload/CyclicUploadDependencyException.java

    r6987 r7005  
    4545
    4646    public List<Relation> getCyclicUploadDependency() {
    47         return new ArrayList<Relation>(cycle);
     47        return new ArrayList<>(cycle);
    4848    }
    4949}
  • trunk/src/org/openstreetmap/josm/actions/upload/DiscardTagsHook.java

    r5608 r7005  
    2424    public boolean checkUpload(APIDataSet apiDataSet) {
    2525        List<OsmPrimitive> objectsToUpload = apiDataSet.getPrimitives();
    26         Collection<String> discardableKeys = new HashSet<String>(OsmPrimitive.getDiscardableKeys());
     26        Collection<String> discardableKeys = new HashSet<>(OsmPrimitive.getDiscardableKeys());
    2727
    2828        boolean needsChange = false;
     
    3737
    3838        if (needsChange) {
    39             AbstractMap<String, String> map = new HashMap<String, String>();
     39            AbstractMap<String, String> map = new HashMap<>();
    4040            for (String key : discardableKeys) {
    4141                map.put(key, null);
  • trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java

    r6922 r7005  
    3030     * List of checks to run on data
    3131     */
    32     private List<FixData> deprecated = new LinkedList<FixData>();
     32    private List<FixData> deprecated = new LinkedList<>();
    3333
    3434    /**
     
    7676        @Override
    7777        public boolean fixKeys(Map<String, String> keys, OsmPrimitive osm) {
    78             Map<String, String> newKeys = new HashMap<String, String>(keys);
     78            Map<String, String> newKeys = new HashMap<>(keys);
    7979            for (Entry<String, String> e : keys.entrySet()) {
    8080                String v = Tag.removeWhiteSpaces(e.getValue());
     
    184184
    185185        List<OsmPrimitive> objectsToUpload = apiDataSet.getPrimitives();
    186         Collection<Command> cmds = new LinkedList<Command>();
     186        Collection<Command> cmds = new LinkedList<>();
    187187
    188188        for (OsmPrimitive osm : objectsToUpload) {
     
    195195                }
    196196                if(modified)
    197                     cmds.add(new ChangePropertyCommand(Collections.singleton(osm), new HashMap<String, String>(keys)));
     197                    cmds.add(new ChangePropertyCommand(Collections.singleton(osm), new HashMap<>(keys)));
    198198            }
    199199        }
  • trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java

    r6786 r7005  
    5454        Collection<OsmPrimitive> selection = v.visit(apiDataSet.getPrimitivesToUpdate());
    5555
    56         List<TestError> errors = new ArrayList<TestError>(30);
     56        List<TestError> errors = new ArrayList<>(30);
    5757        for (Test test : tests) {
    5858            test.setBeforeUpload(true);
     
    8383            int nume = 0;
    8484            for (TestError error : errors) {
    85                 List<String> s = new ArrayList<String>();
     85                List<String> s = new ArrayList<>();
    8686                s.add(error.getIgnoreState());
    8787                s.add(error.getIgnoreGroup());
Note: See TracChangeset for help on using the changeset viewer.