Ignore:
Timestamp:
2014-10-18T23:07:52+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix Java 7 / unused code warnings

Location:
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AddIntersectionsAction.java

    r30177 r30737  
    4747        }
    4848
    49         LinkedList<Command> cmds = new LinkedList<Command>();
     49        LinkedList<Command> cmds = new LinkedList<>();
    5050        Geometry.addIntersections(ways, false, cmds);
    5151        if (!cmds.isEmpty()) {
    5252            Main.main.undoRedo.add(new SequenceCommand(tr("Add nodes at intersections"),cmds));
    53             Set<Node> nodes = new HashSet<Node>(10);
     53            Set<Node> nodes = new HashSet<>(10);
    5454            // find and select newly added nodes
    5555            for (Command cmd: cmds) if (cmd instanceof AddCommand){
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AlignWayNodesAction.java

    r30177 r30737  
    4545        int firstNodePos = findFirstNode(way, selectedNodes);
    4646        int lastNodePos = way.isClosed() ? firstNodePos : way.getNodesCount();
    47         List<Node> nodes = new ArrayList<Node>();
     47        List<Node> nodes = new ArrayList<>();
    4848        int i = firstNodePos;
    4949        boolean iterated = false;
     
    7575        // Now, we have an ordered list of nodes, of which idx 0 and N-1 serve as guides
    7676        // and 1..N-2 should be aligned with them
    77         List<Command> commands = new ArrayList<Command>();
     77        List<Command> commands = new ArrayList<>();
    7878        double ax = nodes.get(0).getEastNorth().east();
    7979        double ay = nodes.get(0).getEastNorth().north();
     
    134134            List<Way> referrers = OsmPrimitive.getFilteredList(n.getReferrers(), Way.class);
    135135            if( ways == null )
    136                 ways = new HashSet<Way>(referrers);
     136                ways = new HashSet<>(referrers);
    137137            else {
    138138                ways.retainAll(referrers);
     
    143143
    144144    private Set<Node> filterNodes( Collection<? extends OsmPrimitive> selection ) {
    145         Set<Node> result = new HashSet<Node>();
     145        Set<Node> result = new HashSet<>();
    146146        if( selection != null ) {
    147147            for( OsmPrimitive p : selection )
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/ExtractPointAction.java

    r30177 r30737  
    4949        Node nd = selectedNodes.get(0);
    5050        Node ndCopy = new Node(nd.getCoor());
    51         List<Command> cmds = new LinkedList<Command>();
     51        List<Command> cmds = new LinkedList<>();
    5252       
    5353        Point p = Main.map.mapView.getMousePosition();
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/PasteRelationsAction.java

    r30391 r30737  
    3030            return;
    3131
    32         Map<Relation, String> relations = new HashMap<Relation, String>();
     32        Map<Relation, String> relations = new HashMap<>();
    3333        for( PrimitiveData pdata : Main.pasteBuffer.getDirectlyAdded() ) {
    3434            OsmPrimitive p = getCurrentDataSet().getPrimitiveById(pdata.getUniqueId(), pdata.getType());
     
    5050        }
    5151
    52         List<Command> commands = new ArrayList<Command>();
     52        List<Command> commands = new ArrayList<>();
    5353        for( Relation rel : relations.keySet() ) {
    5454            Relation r = new Relation(rel);
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java

    r30177 r30737  
    9292        // is exactly one way that all nodes are part of.
    9393        if (selectedWay == null && !selectedNodes.isEmpty()) {
    94             Map<Way, Integer> wayOccurenceCounter = new HashMap<Way, Integer>();
     94            Map<Way, Integer> wayOccurenceCounter = new HashMap<>();
    9595            for (Node n : selectedNodes) {
    9696                for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) {
     
    148148                return;
    149149            }
    150             HashSet<Node> nds = new HashSet<Node>(selectedNodes);
     150            HashSet<Node> nds = new HashSet<>(selectedNodes);
    151151            nds.removeAll(selectedWay.getNodes());
    152152            if (!nds.isEmpty()) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitOnIntersectionsAction.java

    r30177 r30737  
    3333    @Override
    3434    public void actionPerformed( ActionEvent e ) {
    35         List<Command> list = new ArrayList<Command>();
     35        List<Command> list = new ArrayList<>();
    3636        List<Way> selectedWays = OsmPrimitive.getFilteredList(getCurrentDataSet().getSelected(), Way.class);
    37         Map<Way, List<Node>> splitWays = new HashMap<Way, List<Node>>();
     37        Map<Way, List<Node>> splitWays = new HashMap<>();
    3838
    3939        for( Way way : selectedWays ) {
     
    6161                        splitWays.get(refs.get(0)).add(node);
    6262                    else {
    63                         List<Node> nodes = new ArrayList<Node>(1);
     63                        List<Node> nodes = new ArrayList<>(1);
    6464                        nodes.add(node);
    6565                        splitWays.put(refs.get(0), nodes);
     
    7777            List<List<Node>> wayChunks = SplitWayAction.buildSplitChunks(splitWay, splitWays.get(splitWay));
    7878            if( wayChunks != null ) {
    79                 List<OsmPrimitive> sel = new ArrayList<OsmPrimitive>(selectedWays.size());
     79                List<OsmPrimitive> sel = new ArrayList<>(selectedWays.size());
    8080                sel.addAll(selectedWays);
    8181                SplitWayAction.SplitWayResult result = SplitWayAction.splitWay(getEditLayer(), splitWay, wayChunks, sel);
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SymmetryAction.java

    r30177 r30737  
    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        EastNorth p1=null,p2=null;
    4949       
     
    7474        ne /= l; nn /= l; // normal unit vector
    7575       
    76         Collection<Command> cmds = new LinkedList<Command>();
     76        Collection<Command> cmds = new LinkedList<>();
    7777
    7878        for (Node n : nodes) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java

    r29769 r30737  
    1818public class TagBufferAction extends JosmAction {
    1919    private static final String TITLE = tr("Copy tags from previous selection");
    20     private Map<String, String> tags = new HashMap<String, String>();
    21     private Map<String, String> currentTags = new HashMap<String, String>();
    22     private Set<OsmPrimitive> selectionBuf = new HashSet<OsmPrimitive>();
     20    private Map<String, String> tags = new HashMap<>();
     21    private Map<String, String> currentTags = new HashMap<>();
     22    private Set<OsmPrimitive> selectionBuf = new HashSet<>();
    2323
    2424    public TagBufferAction() {
     
    3434            return;
    3535
    36         List<Command> commands = new ArrayList<Command>();
     36        List<Command> commands = new ArrayList<>();
    3737        for( String key : tags.keySet() ) {
    3838            String value = tags.get(key);
     
    9292    private void rememberSelectionTags() {
    9393        // Fix #8350 - only care about tagged objects
    94         Collection<OsmPrimitive> selectedTaggedObjects = new ArrayList<OsmPrimitive>(getCurrentDataSet().getSelected());
     94        Collection<OsmPrimitive> selectedTaggedObjects = new ArrayList<>(getCurrentDataSet().getSelected());
    9595        for (Iterator<OsmPrimitive> it = selectedTaggedObjects.iterator(); it.hasNext(); ) {
    9696            if (!it.next().isTagged()) {
     
    100100        if( !selectedTaggedObjects.isEmpty() ) {
    101101            currentTags.clear();
    102             Set<String> bad = new HashSet<String>();
     102            Set<String> bad = new HashSet<>();
    103103            for( OsmPrimitive p : selectedTaggedObjects ) {
    104104                if( currentTags.isEmpty() ) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagSourceAction.java

    r29769 r30737  
    1919    private static final String TITLE = tr("Add Source Tag");
    2020    private String source;
    21     private Set<OsmPrimitive> selectionBuf = new HashSet<OsmPrimitive>();
     21    private Set<OsmPrimitive> selectionBuf = new HashSet<>();
    2222    private boolean clickedTwice = false;
    2323
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/UnGlueRelationAction.java

    r29769 r30737  
    4949    public void actionPerformed(ActionEvent e) {
    5050
    51         LinkedList<Command> cmds = new LinkedList<Command>();
    52         List<OsmPrimitive> newPrimitives = new LinkedList<OsmPrimitive>();
     51        LinkedList<Command> cmds = new LinkedList<>();
     52        List<OsmPrimitive> newPrimitives = new LinkedList<>();
    5353        Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected();
    5454
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/command/ChangeRelationMemberCommand.java

    r29391 r30737  
    3434            return;
    3535        }
    36         LinkedList<RelationMember> newrms = new LinkedList<RelationMember>();
     36        LinkedList<RelationMember> newrms = new LinkedList<>();
    3737        for (RelationMember rm : relation.getMembers()) {
    3838            if (rm.getMember() == oldP) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CircleArcMaker.java

    r30701 r30737  
    2323public class CircleArcMaker {
    2424    public static Collection<Command> doCircleArc(List<Node> selectedNodes, List<Way> selectedWays, int angleSeparation) {
    25         Collection<Command> cmds = new LinkedList<Command>();
     25        Collection<Command> cmds = new LinkedList<>();
    2626
    2727        //// Decides which nodes to use as anchors based on selection
     
    6161        }
    6262
    63         Set<Way> targetWays = new HashSet<Way>();
     63        Set<Way> targetWays = new HashSet<>();
    6464
    6565        boolean nodesHaveBeenChoosen = false;
     
    127127
    128128        // // Calculate the new points in the arc
    129         ReturnValue<Integer> p2Index = new ReturnValue<Integer>();
     129        ReturnValue<Integer> p2Index = new ReturnValue<>();
    130130        List<EastNorth> points = circleArcPoints(p1, p2, p3, angleSeparation, false, p2Index);
    131131
    132132        //// Create the new arc nodes. Insert anchor nodes at correct positions.
    133         List<Node> arcNodes = new ArrayList<Node>(points.size());
     133        List<Node> arcNodes = new ArrayList<>(points.size());
    134134        arcNodes.add(n1);
    135135        {
     
    269269        int numberOfNodesInArc = Math.max((int) Math.ceil((radialLength / Math.PI) * 180 / angleSeparation)+1,
    270270                3);
    271         List<EastNorth> points = new ArrayList<EastNorth>(numberOfNodesInArc);
     271        List<EastNorth> points = new ArrayList<>(numberOfNodesInArc);
    272272
    273273        // Calculate the circle points in order
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CurveAction.java

    r28028 r30737  
    5353        updatePreferences();
    5454
    55         List<Node> selectedNodes = new ArrayList<Node>(getCurrentDataSet().getSelectedNodes());
    56         List<Way> selectedWays = new ArrayList<Way>(getCurrentDataSet().getSelectedWays());
     55        List<Node> selectedNodes = new ArrayList<>(getCurrentDataSet().getSelectedNodes());
     56        List<Way> selectedWays = new ArrayList<>(getCurrentDataSet().getSelectedWays());
    5757
    5858        // Collection<Command> cmds = doSpline(selectedNodes, selectedWays);
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/URLList.java

    r30343 r30737  
    2323    }   
    2424    public static List<String> resetURLList() {
    25         List<String> items=new ArrayList<String>();
     25        List<String> items=new ArrayList<>();
    2626        items.add("Wikipedia");
    2727        items.add("https://en.wikipedia.org/w/index.php?search={name}&fulltext=Search");
     
    6060   
    6161    public static  List<String> loadURLList() {
    62         ArrayList<String> items=new ArrayList<String>();
     62        ArrayList<String> items=new ArrayList<>();
    6363        BufferedReader fr=null;
    6464        try {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/UtilsPluginPreferences.java

    r30459 r30737  
    134134        TableModel model = (table.getModel());
    135135        String v;
    136         ArrayList<String> lst=new ArrayList<String>();
     136        ArrayList<String> lst=new ArrayList<>();
    137137        int n=model.getRowCount();
    138138        for (int i=0;i<n;i++) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonAction.java

    r29769 r30737  
    5959
    6060        // we create a list of commands that will modify the map in the way we want.
    61         Collection<Command> cmds = new LinkedList<Command>();
     61        Collection<Command> cmds = new LinkedList<>();
    6262        // first we create all the nodes, then we do extra stuff based on what geometry type we need.
    63         LinkedList<Node> nodes = new LinkedList<Node>();
     63        LinkedList<Node> nodes = new LinkedList<>();
    6464
    6565        for (LatLon ll : coordinates) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonDialog.java

    r30002 r30737  
    309309    private static LatLon[] parseLatLons(final String text) {
    310310        String lines[] = text.split("\\r?\\n");
    311         List<LatLon> latLons = new ArrayList<LatLon>();
     311        List<LatLon> latLons = new ArrayList<>();
    312312        for (String line : lines) {
    313313            latLons.add(parseLatLon(line));
     
    320320
    321321        final StringBuilder sb = new StringBuilder();
    322         final List<Object> list = new ArrayList<Object>();
     322        final List<Object> list = new ArrayList<>();
    323323
    324324        while (m.find()) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java

    r30701 r30737  
    145145
    146146    private void loadHistory() {
    147         List<String> cmtHistory = new LinkedList<String>(
     147        List<String> cmtHistory = new LinkedList<>(
    148148                Main.pref.getCollection(HISTORY_KEY, Arrays.asList(defaultHistory)));
    149149        Collections.reverse(cmtHistory);
     
    197197   
    198198    public List<OsmPrimitive> getSelectedPrimitives() {
    199         ArrayList<OsmPrimitive> sel = new ArrayList<OsmPrimitive>(100);
     199        ArrayList<OsmPrimitive> sel = new ArrayList<>(100);
    200200        for (int idx: tbl.getSelectedRows()) {
    201201            sel.add(tableModel.getPrimitiveAt(tbl.convertRowIndexToModel(idx)));
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTaggerTableModel.java

    r30701 r30737  
    2929public class MultiTaggerTableModel extends AbstractTableModel implements SelectionChangedListener {
    3030
    31     ArrayList<OsmPrimitive> list = new ArrayList<OsmPrimitive>(50);
     31    ArrayList<OsmPrimitive> list = new ArrayList<>(50);
    3232    String mainTags[] = new String[]{};
    3333    boolean isSpecialTag[] = new boolean[]{};
    34     Set<OsmPrimitiveType> shownTypes = new HashSet<OsmPrimitiveType>();
     34    Set<OsmPrimitiveType> shownTypes = new HashSet<>();
    3535    private boolean autoCommit = true;
    36     List<Command> cmds = new ArrayList<Command>();
     36    List<Command> cmds = new ArrayList<>();
    3737    private boolean watchSelection = true;
    3838    private JTable table;
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryAction.java

    r30177 r30737  
    3535
    3636        // There must be two ways selected: one with id > 0 and one new.
    37         List<OsmPrimitive> selection = new ArrayList<OsmPrimitive>(getCurrentDataSet().getSelected());
     37        List<OsmPrimitive> selection = new ArrayList<>(getCurrentDataSet().getSelected());
    3838        if (selection.size() != 2) {
    3939            new Notification(
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java

    r30532 r30737  
    116116        }
    117117        // FIXME: handle different layers
    118         List<Command> commands = new ArrayList<Command>();
     118        List<Command> commands = new ArrayList<>();
    119119        commands.add(MergeNodesAction.mergeNodes(Main.main.getEditLayer(), Arrays.asList(subjectNode, referenceNode), referenceNode));
    120120
     
    143143        if (!subjectNode.isNew()) {
    144144            // Prepare a list of nodes that are not important
    145             Collection<Node> nodePool = new HashSet<Node>();
     145            Collection<Node> nodePool = new HashSet<>();
    146146            if (referenceObject instanceof Way) {
    147147                nodePool.addAll(getUnimportantNodes((Way) referenceObject));
     
    161161        }
    162162
    163         List<Command> commands = new ArrayList<Command>();
     163        List<Command> commands = new ArrayList<>();
    164164        AbstractMap<String, String> nodeTags = (AbstractMap<String, String>) subjectNode.getKeys();
    165165
     
    248248        }
    249249
    250         List<Command> commands = new ArrayList<Command>();
     250        List<Command> commands = new ArrayList<>();
    251251               
    252252        // merge tags
     
    262262
    263263        // And the same for geometry, list nodes that can be freely deleted
    264         List<Node> geometryPool = new LinkedList<Node>();
     264        List<Node> geometryPool = new LinkedList<>();
    265265        for( Node node : referenceWay.getNodes() ) {
    266266            List<OsmPrimitive> referrers = node.getReferrers();
     
    275275        // Find new nodes that are closest to the old ones, remove matching old ones from the pool
    276276        // Assign node moves with least overall distance moved
    277         Map<Node, Node> nodeAssoc = new HashMap<Node, Node>();
     277        Map<Node, Node> nodeAssoc = new HashMap<>();
    278278        if (geometryPool.size() > 0 && nodePool.size() > 0) {
    279279            if (useRobust) {  // use robust, but slower assignment
     
    319319                        tr("Exceeded iteration limit for robust method, using simpler method.")
    320320                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();     
    321                     nodeAssoc = new HashMap<Node, Node>();
     321                    nodeAssoc = new HashMap<>();
    322322                }
    323323            }
     
    375375     */
    376376    protected static List<Node> getUnimportantNodes(Way way) {
    377         List<Node> nodePool = new LinkedList<Node>();
     377        List<Node> nodePool = new LinkedList<>();
    378378        for (Node n : way.getNodes()) {
    379379            List<OsmPrimitive> referrers = n.getReferrers();
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ConnectedMatch.java

    r30202 r30737  
    2929     */
    3030    private void init(boolean all) {
    31         Collection<Way> matchedWays = new HashSet<Way>();
    32         Set<Node> matchedNodes = new HashSet<Node>();
     31        Collection<Way> matchedWays = new HashSet<>();
     32        Set<Node> matchedNodes = new HashSet<>();
    3333        // find all ways that match the expression
    3434        Collection<Way> allWays = Main.main.getCurrentDataSet().getWays();
     
    4545            }
    4646        }
    47         Set<Way> newWays = new HashSet<Way>();
     47        Set<Way> newWays = new HashSet<>();
    4848        if (all) {
    4949            NodeWayUtils.addWaysConnectedToNodes(matchedNodes, newWays);
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/InsideMatch.java

    r30202 r30737  
    3030     */
    3131    private void init() {
    32         Collection<OsmPrimitive> matchedAreas = new HashSet<OsmPrimitive>();
     32        Collection<OsmPrimitive> matchedAreas = new HashSet<>();
    3333        // find all ways that match the expression
    3434        Collection<Way> ways = Main.main.getCurrentDataSet().getWays();
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/IntersectingMatch.java

    r30202 r30737  
    2828     */
    2929    private void init(boolean all) {
    30         Collection<Way> matchedWays = new HashSet<Way>();
     30        Collection<Way> matchedWays = new HashSet<>();
    3131        // find all ways that match the expression
    3232        Collection<Way> allWays = Main.main.getCurrentDataSet().getWays();
     
    3636            }
    3737        }
    38         Set<Way> newWays = new HashSet<Way>();
     38        Set<Way> newWays = new HashSet<>();
    3939        if (all) {
    4040            NodeWayUtils.addWaysIntersectingWaysRecursively(allWays, matchedWays, newWays);
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentNodesAction.java

    r29769 r30737  
    2929    }
    3030
    31     private  Set<Way> activeWays = new HashSet<Way>();
     31    private  Set<Way> activeWays = new HashSet<>();
    3232
    3333    @Override
     
    5858        // selecting nodes of selected ways
    5959        if(selectedNodes.isEmpty()) {
    60             HashSet<Node> newNodes = new HashSet<Node>();
     60            HashSet<Node> newNodes = new HashSet<>();
    6161            NodeWayUtils.addNodesConnectedToWays(selectedWays, newNodes);
    6262            activeWays.clear();
     
    6969        }
    7070
    71         Set<Node> newNodes = new HashSet <Node>();
     71        Set<Node> newNodes = new HashSet <>();
    7272        for (Node node: selectedNodes) {
    7373            for (Way w: activeWays) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentWaysAction.java

    r29769 r30737  
    3838
    3939        // select ways attached to already selected ways
    40         Set<Way> newWays = new HashSet<Way>();
     40        Set<Way> newWays = new HashSet<>();
    4141        NodeWayUtils.addWaysConnectedToWays(selectedWays, newWays);
    4242        newWays.addAll(selectedWays);
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/ConnectedWaysAction.java

    r29769 r30737  
    3333        Set<Way> selectedWays = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Way.class);
    3434
    35         Set<Way> newWays = new HashSet<Way>();
     35        Set<Way> newWays = new HashSet<>();
    3636
    3737        // selecting ways attached to selected nodes
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysAction.java

    r30701 r30737  
    3737        // select ways attached to already selected ways
    3838        if (!selectedWays.isEmpty()) {
    39             Set<Way> newWays = new HashSet<Way>();
     39            Set<Way> newWays = new HashSet<>();
    4040            NodeWayUtils.addWaysIntersectingWays(
    4141                    getCurrentDataSet().getWays(),
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysRecursiveAction.java

    r30701 r30737  
    3838
    3939        if (!selectedWays.isEmpty()) {
    40             Set<Way> newWays = new HashSet<Way>();
     40            Set<Way> newWays = new HashSet<>();
    4141            NodeWayUtils.addWaysIntersectingWaysRecursively(
    4242                    getCurrentDataSet().getWays(),
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/MiddleNodesAction.java

    r30701 r30737  
    4646        }
    4747
    48         Set<Node> newNodes = new HashSet <Node>();
     48        Set<Node> newNodes = new HashSet <>();
    4949        NodeWayUtils.addMiddle(selectedNodes, newNodes);
    5050       
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java

    r30421 r30737  
    187187    public static void addWaysIntersectingWaysRecursively
    188188        (Collection<Way> allWays, Collection<Way> initWays, Set<Way> newWays) {
    189         Set<Way> foundWays = new HashSet<Way>();
     189        Set<Way> foundWays = new HashSet<>();
    190190        foundWays.addAll(initWays);
    191191        newWays.addAll(initWays);
     
    195195        do {
    196196             c=0;
    197              newFoundWays = new HashSet<Way>();
     197             newFoundWays = new HashSet<>();
    198198             for (Way w : foundWays){
    199199                  c+=addWaysIntersectingWay(allWays, w, newFoundWays,newWays);
     
    220220        do {
    221221             c=0;
    222              Set<Way> foundWays = new HashSet<Way>();
     222             Set<Way> foundWays = new HashSet<>();
    223223             foundWays.addAll(newWays);
    224224             for (Way w : foundWays){
     
    241241        Node n1 = it.next();
    242242        Node n2 = it.next();
    243         Set<Way> ways=new HashSet<Way>();
     243        Set<Way> ways=new HashSet<>();
    244244        ways.addAll(OsmPrimitive.getFilteredList(n1.getReferrers(), Way.class));
    245245        for (Way w: ways) {
     
    280280        Node curNode = w.lastNode();
    281281        Node prevNode = w.getNode(w.getNodes().size()-2);
    282         Set<Way> newestWays = new HashSet<Way>();
     282        Set<Way> newestWays = new HashSet<>();
    283283        while(true) {
    284284
     
    361361       
    362362        List<Node> searchNodes = data.searchNodes(box);
    363         Set<Node> newestNodes = new HashSet<Node>();
    364         Set<Way> newestWays = new HashSet<Way>();
     363        Set<Node> newestNodes = new HashSet<>();
     364        Set<Way> newestWays = new HashSet<>();
    365365        for (Node n : searchNodes) {
    366366            //if (Geometry.nodeInsidePolygon(n, polyNodes)) {
     
    391391       
    392392        List<Node> searchNodes = data.searchNodes(box);
    393         Set<Node> newestNodes = new HashSet<Node>();
    394         Set<Way> newestWays = new HashSet<Way>();
     393        Set<Node> newestNodes = new HashSet<>();
     394        Set<Way> newestWays = new HashSet<>();
    395395        for (Node n : searchNodes) {
    396396            //if (Geometry.nodeInsidePolygon(n, polyNodes)) {
     
    483483        }
    484484
    485         Set<Way> newWays = new HashSet<Way>();
    486         Set<Node> newNodes = new HashSet<Node>();
     485        Set<Way> newWays = new HashSet<>();
     486        Set<Node> newNodes = new HashSet<>();
    487487        // select nodes and ways inside slexcted ways and multipolygons
    488488        if (!selectedWays.isEmpty()) {
     
    503503        }
    504504       
    505         Set<OsmPrimitive> insideSelection = new HashSet<OsmPrimitive>();
     505        Set<OsmPrimitive> insideSelection = new HashSet<>();
    506506        if (!newWays.isEmpty() || !newNodes.isEmpty()) {
    507507            insideSelection.addAll(newWays);
     
    512512
    513513    private static List<EastNorth> buildPointList(Iterable<Way> ways) {
    514         ArrayList<EastNorth> points = new ArrayList<EastNorth>(1000);
     514        ArrayList<EastNorth> points = new ArrayList<>(1000);
    515515        for (Way way: ways) {
    516516            for (EastNorth en: getWayPoints(way)) {
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectHighwayAction.java

    r30701 r30737  
    5454
    5555    private Set<Way> selectNamedRoad( Way firstWay ) {
    56         Set<Way> newWays = new HashSet<Way>();
     56        Set<Way> newWays = new HashSet<>();
    5757        String key = firstWay.hasKey("name") ? "name" : "ref";
    5858        if( firstWay.hasKey(key) ) {
    5959            String value = firstWay.get(key);
    60             Queue<Node> nodeQueue = new LinkedList<Node>();
     60            Queue<Node> nodeQueue = new LinkedList<>();
    6161            nodeQueue.add(firstWay.firstNode());
    6262            while( !nodeQueue.isEmpty() ) {
     
    8383            intersection = firstTree.getIntersection(secondTree);
    8484        }
    85         Set<Way> newWays = new HashSet<Way>();
     85        Set<Way> newWays = new HashSet<>();
    8686        newWays.addAll(firstTree.getPath(intersection));
    8787        newWays.addAll(secondTree.getPath(intersection));
     
    142142
    143143        public HighwayTree( Way from, int minHighwayRank ) {
    144             tree = new ArrayList<Way>(1);
    145             refs = new ArrayList<Integer>(1);
     144            tree = new ArrayList<>(1);
     145            refs = new ArrayList<>(1);
    146146            tree.add(from);
    147147            refs.add(Integer.valueOf(-1));
    148148            this.minHighwayRank = minHighwayRank;
    149             nodesToCheck = new ArrayList<Node>(2);
    150             nodeRefs = new ArrayList<Integer>(2);
     149            nodesToCheck = new ArrayList<>(2);
     150            nodeRefs = new ArrayList<>(2);
    151151            nodesToCheck.add(from.firstNode());
    152152            nodesToCheck.add(from.lastNode());
     
    156156       
    157157        public void processNextLevel() {
    158             List<Node> newNodes = new ArrayList<Node>();
    159             List<Integer> newIdx = new ArrayList<Integer>();
     158            List<Node> newNodes = new ArrayList<>();
     159            List<Integer> newIdx = new ArrayList<>();
    160160            for( int i = 0; i < nodesToCheck.size(); i++ ) {
    161161                Node node = nodesToCheck.get(i);
     
    197197            if( pos < 0 )
    198198                throw new ArrayIndexOutOfBoundsException("Way " + to + " is not in the tree.");
    199             List<Way> result = new ArrayList<Way>(1);
     199            List<Way> result = new ArrayList<>(1);
    200200            while( pos >= 0 ) {
    201201                result.add(tree.get(pos));
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModNodesAction.java

    r29769 r30737  
    5252        }
    5353
    54         Set<Node> nodes = new HashSet<Node>(10);
     54        Set<Node> nodes = new HashSet<>(10);
    5555        do {  //  select next history element
    5656            if (idx>0) idx--; else idx=num-1;
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModWaysAction.java

    r29769 r30737  
    5252        }
    5353
    54         Set<Way> ways = new HashSet<Way>(10);
     54        Set<Way> ways = new HashSet<>(10);
    5555        do {  //  select next history element
    5656            if (idx>0) idx--; else idx=num-1;
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectWayNodesAction.java

    r30002 r30737  
    5454                Node n = (Node) p;
    5555                if (selectedNodes == null) {
    56                     selectedNodes = new ArrayList<Node>();
     56                    selectedNodes = new ArrayList<>();
    5757                }
    5858                selectedNodes.add(n);
     
    6868        for (Node n : w.getNodes()) {
    6969            if (selectedNodes == null) {
    70                 selectedNodes = new ArrayList<Node>();
     70                selectedNodes = new ArrayList<>();
    7171            }
    7272            selectedNodes.add(n);
  • applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/UndoSelectionAction.java

    r29769 r30737  
    4848        }
    4949        int k=0;
    50         Set<OsmPrimitive> newsel = new HashSet<OsmPrimitive>();
     50        Set<OsmPrimitive> newsel = new HashSet<>();
    5151        do {
    5252            if (index+1<history.size()) index++; else index=0;
Note: See TracChangeset for help on using the changeset viewer.