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/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/CollectionUtils.java

    r26154 r30737  
    3737   
    3838    public static <E> Set<E> toSet(Iterable<? extends E> iterable) {
    39         final Set<E> set = new HashSet<E>();
     39        final Set<E> set = new HashSet<>();
    4040       
    4141        for (E e : iterable) {
     
    4747   
    4848    public static <E> List<E> toList(Iterable<? extends E> iterable) {
    49         final List<E> list = new ArrayList<E>();
     49        final List<E> list = new ArrayList<>();
    5050       
    5151        for (E e : iterable) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiContainer.java

    r26509 r30737  
    4444    private final double laneWidth;
    4545   
    46     private final Map<Junction, JunctionGui> junctions = new HashMap<Junction, JunctionGui>();
    47     private final Map<Road, RoadGui> roads = new HashMap<Road, RoadGui>();
     46    private final Map<Junction, JunctionGui> junctions = new HashMap<>();
     47    private final Map<Road, RoadGui> roads = new HashMap<>();
    4848   
    4949    private final Stroke connectionStroke;
     
    159159        }
    160160       
    161         final List<Junction> primaries = new ArrayList<Junction>(mc.getPrimaryJunctions());
    162         final List<Double> top = new ArrayList<Double>();
    163         final List<Double> left = new ArrayList<Double>();
    164         final List<Double> right = new ArrayList<Double>();
    165         final List<Double> bottom = new ArrayList<Double>();
     161        final List<Junction> primaries = new ArrayList<>(mc.getPrimaryJunctions());
     162        final List<Double> top = new ArrayList<>();
     163        final List<Double> left = new ArrayList<>();
     164        final List<Double> right = new ArrayList<>();
     165        final List<Double> bottom = new ArrayList<>();
    166166       
    167167        for (Junction j : primaries) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/GuiUtil.java

    r26154 r30737  
    133133   
    134134    public static List<Point2D> locs(Iterable<Junction> junctions) {
    135         final List<Point2D> locs = new ArrayList<Point2D>();
     135        final List<Point2D> locs = new ArrayList<>();
    136136       
    137137        for (Junction j : junctions) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionGui.java

    r26154 r30737  
    296296    final double y;
    297297   
    298     private final NavigableMap<Double, Linkage> roads = new TreeMap<Double, Linkage>();
     298    private final NavigableMap<Double, Linkage> roads = new TreeMap<>();
    299299   
    300300    private final Path2D area = new Path2D.Double();
     
    310310        this.y = loc.getY();
    311311       
    312         final Set<Road> done = new HashSet<Road>();
     312        final Set<Road> done = new HashSet<>();
    313313        for (Road r : j.getRoads()) {
    314314            if (!done.contains(r)) {
     
    363363   
    364364    private Iterable<Corner> corners() {
    365         final List<Corner> result = new ArrayList<JunctionGui.Corner>(roads.size());
     365        final List<Corner> result = new ArrayList<>(roads.size());
    366366       
    367367        Linkage last = roads.lastEntry().getValue();
     
    396396   
    397397    public Set<RoadGui> getRoads() {
    398         final Set<RoadGui> result = new HashSet<RoadGui>();
     398        final Set<RoadGui> result = new HashSet<>();
    399399       
    400400        for (Linkage l : roads.values()) {
     
    435435        g2d.fill(area);
    436436       
    437         final List<InteractiveElement> result = new ArrayList<InteractiveElement>();
     437        final List<InteractiveElement> result = new ArrayList<>();
    438438       
    439439        if (getModel().isPrimary()) {
    440             for (Road.End r : new HashSet<Road.End>(getModel().getRoadEnds())) {
     440            for (Road.End r : new HashSet<>(getModel().getRoadEnds())) {
    441441                for (Turn t : r.getTurns()) {
    442442                    result.add(new TurnConnection(t));
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/JunctionPane.java

    r26509 r30737  
    162162    private BufferedImage interactive;
    163163   
    164     private final NavigableMap<Integer, List<InteractiveElement>> interactives = new TreeMap<Integer, List<InteractiveElement>>();
     164    private final NavigableMap<Integer, List<InteractiveElement>> interactives = new TreeMap<>();
    165165    private State state;
    166166    private InteractiveElement dragging;
     
    423423   
    424424    private List<InteractiveElement> interactives() {
    425         final List<InteractiveElement> result = new ArrayList<InteractiveElement>();
     425        final List<InteractiveElement> result = new ArrayList<>();
    426426       
    427427        for (List<InteractiveElement> ies : interactives.descendingMap().values()) {
     
    461461            final List<InteractiveElement> list;
    462462            if (existing == null) {
    463                 list = new ArrayList<InteractiveElement>();
     463                list = new ArrayList<>();
    464464                interactives.put(ie.getZIndex(), list);
    465465            } else {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/LaneGui.java

    r26316 r30737  
    241241            }
    242242           
    243             final List<Road> via = new ArrayList<Road>();
     243            final List<Road> via = new ArrayList<>();
    244244            assert (s.getViaConnectors().size() & 1) == 0;
    245245            for (int i = 0; i < s.getViaConnectors().size(); i += 2) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/RoadGui.java

    r26154 r30737  
    249249            this.end = end;
    250250           
    251             final List<LaneGui> lanes = new ArrayList<LaneGui>(end.getLanes().size());
     251            final List<LaneGui> lanes = new ArrayList<>(end.getLanes().size());
    252252            for (Lane l : end.getOppositeEnd().getLanes()) {
    253253                lanes.add(new LaneGui(RoadGui.this, l));
     
    464464   
    465465    private static final List<Point2D> prepended(List<Point2D> bends, Point2D point) {
    466         final List<Point2D> result = new ArrayList<Point2D>(bends.size() + 1);
     466        final List<Point2D> result = new ArrayList<>(bends.size() + 1);
    467467        result.add(point);
    468468        result.addAll(bends);
     
    486486   
    487487    private final Road road;
    488     private final List<Segment> segments = new ArrayList<Segment>();
     488    private final List<Segment> segments = new ArrayList<>();
    489489   
    490490    final double connectorRadius;
     
    501501        this.incomingB = new IncomingConnector(road.getToEnd());
    502502       
    503         final List<Point2D> bends = new ArrayList<Point2D>();
     503        final List<Point2D> bends = new ArrayList<>();
    504504        final List<Node> nodes = road.getRoute().getNodes();
    505505        for (int i = nodes.size() - 2; i > 0; --i) {
     
    582582   
    583583    List<InteractiveElement> paint(Graphics2D g2d) {
    584         final List<InteractiveElement> result = new ArrayList<InteractiveElement>();
     584        final List<InteractiveElement> result = new ArrayList<>();
    585585       
    586586        result.addAll(paintLanes(g2d));
     
    604604   
    605605    private List<LaneAdder> laneAdders() {
    606         final List<LaneAdder> result = new ArrayList<LaneAdder>(4);
     606        final List<LaneAdder> result = new ArrayList<>(4);
    607607       
    608608        if (!incomingA.getLanes().isEmpty()) {
     
    624624        }
    625625       
    626         final List<Extender> result = new ArrayList<Extender>();
     626        final List<Extender> result = new ArrayList<>();
    627627       
    628628        final Node n = end.getJunction().getNode();
     
    678678        g2d.draw(middleLines);
    679679       
    680         final List<InteractiveElement> result = new ArrayList<InteractiveElement>();
     680        final List<InteractiveElement> result = new ArrayList<>();
    681681       
    682682        moveIncoming(getModel().getFromEnd());
     
    707707       
    708708        Path innerPath = middle.offset(innerMargin, -1, -1, innerMargin);
    709         final List<Path> linePaths = new ArrayList<Path>();
     709        final List<Path> linePaths = new ArrayList<>();
    710710        linePaths.add(innerPath);
    711711       
     
    867867   
    868868    public List<LaneGui> getLanes() {
    869         final List<LaneGui> result = new ArrayList<LaneGui>();
     869        final List<LaneGui> result = new ArrayList<>();
    870870       
    871871        result.addAll(incomingB.getLanes());
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/State.java

    r26182 r30737  
    4747            }
    4848           
    49             final List<RoadGui.ViaConnector> tmp = new ArrayList<RoadGui.ViaConnector>(vias.size() + 1);
     49            final List<RoadGui.ViaConnector> tmp = new ArrayList<>(vias.size() + 1);
    5050            final boolean even = (vias.size() & 1) == 0;
    5151            final RoadGui.ViaConnector last = vias.get(vias.size() - 1);
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/TurnLanesDialog.java

    r29854 r30737  
    142142    private final JToggleButton validateButton = new JToggleButton(validateAction);
    143143   
    144     private final Set<OsmPrimitive> selected = new HashSet<OsmPrimitive>();
     144    private final Set<OsmPrimitive> selected = new HashSet<>();
    145145   
    146146    private boolean editing = true;
     
    205205        @Override
    206206        public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
    207         if (selected.equals(new HashSet<OsmPrimitive>(newSelection))) {
     207        if (selected.equals(new HashSet<>(newSelection))) {
    208208            return;
    209209        }
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/gui/ValidationPanel.java

    r26154 r30737  
    7474   
    7575    private final DefaultTableModel issueModel = new DefaultTableModel(COLUMN_NAMES, 0);
    76     private final List<Issue> issues = new ArrayList<Issue>();
     76    private final List<Issue> issues = new ArrayList<>();
    7777    private final JTable issueTable = new JTable(issueModel) {
    7878        private static final long serialVersionUID = 6323348290180585298L;
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/GenericCommand.java

    r27890 r30737  
    3434    private final DataSet dataSet;
    3535    private final String description;
    36     private final Map<OsmPrimitive, BeforeAfter> beforeAfters = new HashMap<OsmPrimitive, BeforeAfter>();
     36    private final Map<OsmPrimitive, BeforeAfter> beforeAfters = new HashMap<>();
    3737   
    3838    public GenericCommand(DataSet dataSet, String description) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Issue.java

    r26154 r30737  
    4949        QuickFix quickFix) {
    5050        this.relation = relation;
    51         this.primitives = Collections.unmodifiableList(new ArrayList<OsmPrimitive>(primitives));
     51        this.primitives = Collections.unmodifiableList(new ArrayList<>(primitives));
    5252        this.severity = severity;
    5353        this.description = description;
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Junction.java

    r26192 r30737  
    1313   
    1414    private final Node node;
    15     private final Set<Way> roads = new HashSet<Way>();
     15    private final Set<Way> roads = new HashSet<>();
    1616   
    1717    Junction(ModelContainer container, Node n) {
     
    2929   
    3030    public List<Road> getRoads() {
    31         final List<Road> result = new ArrayList<Road>(roads.size());
     31        final List<Road> result = new ArrayList<>(roads.size());
    3232       
    3333        for (Way w : roads) {
     
    3939   
    4040    public List<Road.End> getRoadEnds() {
    41         final List<Road.End> result = new ArrayList<Road.End>(roads.size());
     41        final List<Road.End> result = new ArrayList<>(roads.size());
    4242       
    4343        for (Way w : roads) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Lane.java

    r26702 r30737  
    2727   
    2828    static List<Lane> load(Road.End roadEnd) {
    29         final List<Lane> result = new ArrayList<Lane>();
     29        final List<Lane> result = new ArrayList<>();
    3030        int i;
    3131       
     
    5050   
    5151    static List<Double> loadLengths(Relation r, String key, double lengthBound) {
    52         final List<Double> result = new ArrayList<Double>();
     52        final List<Double> result = new ArrayList<>();
    5353       
    5454        if (r != null && r.get(key) != null) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/ModelContainer.java

    r26288 r30737  
    2424   
    2525    public static ModelContainer create(Iterable<Node> primaryNodes, Iterable<Way> primaryWays) {
    26         return new ModelContainer(new HashSet<Node>(CollectionUtils.toList(primaryNodes)), new HashSet<Way>(
     26        return new ModelContainer(new HashSet<>(CollectionUtils.toList(primaryNodes)), new HashSet<>(
    2727                CollectionUtils.toList(primaryWays)), false);
    2828    }
    2929   
    3030    public static ModelContainer createEmpty(Iterable<Node> primaryNodes, Iterable<Way> primaryWays) {
    31         return new ModelContainer(new HashSet<Node>(CollectionUtils.toList(primaryNodes)), new HashSet<Way>(
     31        return new ModelContainer(new HashSet<>(CollectionUtils.toList(primaryNodes)), new HashSet<>(
    3232                CollectionUtils.toList(primaryWays)), true);
    3333    }
     
    4343            closed = true;
    4444           
    45             for (Node n : new ArrayList<Node>(closedNodes)) {
     45            for (Node n : new ArrayList<>(closedNodes)) {
    4646                for (Way w : Utils.filterRoads(n.getReferrers())) {
    4747                    if (w.isFirstLastNode(n)) {
     
    5050                }
    5151               
    52                 for (Way w : new ArrayList<Way>(closedWays)) {
     52                for (Way w : new ArrayList<>(closedWays)) {
    5353                    closed &= close(closedNodes, closedWays, w);
    5454                }
     
    7878        boolean closed = true;
    7979       
    80         final List<Way> via = new ArrayList<Way>();
     80        final List<Way> via = new ArrayList<>();
    8181        for (RelationMember m : Utils.getMembers(r, Constants.TURN_ROLE_VIA)) {
    8282            if (m.isWay()) {
     
    113113    }
    114114   
    115     private final Map<Node, Junction> junctions = new HashMap<Node, Junction>();
    116     private final Map<Way, Road> roads = new HashMap<Way, Road>();
     115    private final Map<Node, Junction> junctions = new HashMap<>();
     116    private final Map<Way, Road> roads = new HashMap<>();
    117117   
    118118    private final Set<Node> primaryNodes;
     
    123123    private ModelContainer(Set<Node> primaryNodes, Set<Way> primaryWays, boolean empty) {
    124124        if (empty) {
    125             this.primaryNodes = Collections.unmodifiableSet(new HashSet<Node>(primaryNodes));
    126             this.primaryWays = Collections.unmodifiableSet(new HashSet<Way>(primaryWays));
     125            this.primaryNodes = Collections.unmodifiableSet(new HashSet<>(primaryNodes));
     126            this.primaryWays = Collections.unmodifiableSet(new HashSet<>(primaryWays));
    127127            this.empty = true;
    128128        } else {
    129             final Set<Node> closedNodes = filterUsables(new HashSet<Node>(primaryNodes));
    130             final Set<Way> closedWays = filterUsables(new HashSet<Way>(primaryWays));
     129            final Set<Node> closedNodes = filterUsables(new HashSet<>(primaryNodes));
     130            final Set<Way> closedWays = filterUsables(new HashSet<>(primaryWays));
    131131           
    132132            close(closedNodes, closedWays);
     
    154154   
    155155    private Set<Pair<Way, Junction>> createPrimaryJunctions() {
    156         final Set<Pair<Way, Junction>> roads = new HashSet<Pair<Way, Junction>>();
     156        final Set<Pair<Way, Junction>> roads = new HashSet<>();
    157157       
    158158        for (Node n : primaryNodes) {
    159             final List<Way> ws = new ArrayList<Way>();
     159            final List<Way> ws = new ArrayList<>();
    160160            for (Way w : Utils.filterRoads(n.getReferrers())) {
    161161                if (w.isFirstLastNode(n)) {
     
    167167                final Junction j = register(new Junction(this, n));
    168168                for (Way w : ws) {
    169                     roads.add(new Pair<Way, Junction>(w, j));
     169                    roads.add(new Pair<>(w, j));
    170170                }
    171171            }
     
    228228        final String ERR_ILLEGAL_ARGS = "The given roads can not be merged into one.";
    229229       
    230         final List<Way> ws = new ArrayList<Way>(CollectionUtils.toList(CollectionUtils.reverse(a.getRoute().getWays())));
     230        final List<Way> ws = new ArrayList<>(CollectionUtils.toList(CollectionUtils.reverse(a.getRoute().getWays())));
    231231        final List<Way> bws = b.getRoute().getWays();
    232232       
     
    262262        }
    263263       
    264         final Set<Junction> pjs = new HashSet<Junction>();
     264        final Set<Junction> pjs = new HashSet<>();
    265265        for (Node n : primaryNodes) {
    266266            pjs.add(getJunction(n));
     
    274274        }
    275275       
    276         final Set<Road> prs = new HashSet<Road>();
     276        final Set<Road> prs = new HashSet<>();
    277277        for (Way w : primaryWays) {
    278278            prs.add(roads.get(w));
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Road.java

    r26192 r30737  
    245245           
    246246            final double extraLength = left ? extraLengthLeft : extraLengthRight;
    247             final List<Double> newLengths = new ArrayList<Double>();
     247            final List<Double> newLengths = new ArrayList<>();
    248248            int i = Math.abs(lane.getIndex());
    249249            final String key = left ? Constants.LENGTHS_KEY_LENGTHS_LEFT : Constants.LENGTHS_KEY_LENGTHS_RIGHT;
     
    275275   
    276276    private static Pair<Relation, Relation> getLengthRelations(Way w, Node n) {
    277         final List<Relation> left = new ArrayList<Relation>();
    278         final List<Relation> right = new ArrayList<Relation>();
     277        final List<Relation> left = new ArrayList<>();
     278        final List<Relation> right = new ArrayList<>();
    279279       
    280280        for (OsmPrimitive p : w.getReferrers()) {
     
    307307        }
    308308       
    309         return new Pair<Relation, Relation>( //
     309        return new Pair<>( //
    310310                left.isEmpty() ? null : left.get(0), //
    311311                right.isEmpty() ? null : right.get(0) //
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Route.java

    r26154 r30737  
    135135   
    136136    public static Route create(List<Way> ws, Node end) {
    137         final List<Segment> segments = new ArrayList<Segment>(ws.size());
     137        final List<Segment> segments = new ArrayList<>(ws.size());
    138138       
    139139        for (Way w : ws) {
     
    153153   
    154154    private Route(List<Segment> segments) {
    155         this.segments = Collections.unmodifiableList(new ArrayList<Segment>(segments));
     155        this.segments = Collections.unmodifiableList(new ArrayList<>(segments));
    156156    }
    157157   
     
    161161   
    162162    public List<Node> getNodes() {
    163         final List<Node> ns = new ArrayList<Node>();
     163        final List<Node> ns = new ArrayList<>();
    164164       
    165165        ns.add(segments.get(0).getStart());
     
    220220   
    221221    public List<Way> getWays() {
    222         final List<Way> ws = new ArrayList<Way>();
     222        final List<Way> ws = new ArrayList<>();
    223223       
    224224        for (Segment s : segments) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Turn.java

    r26288 r30737  
    2121public final class Turn {
    2222    static Set<Turn> load(ModelContainer c, String role, OsmPrimitive primitive) {
    23         final Set<Turn> result = new HashSet<Turn>();
     23        final Set<Turn> result = new HashSet<>();
    2424       
    2525        for (Relation r : OsmPrimitive.getFilteredList(primitive.getReferrers(), Relation.class)) {
     
    6161       
    6262        final List<Way> tmp = Utils.getMemberWays(r, Constants.TURN_ROLE_VIA);
    63         final LinkedList<Road> via = new LinkedList<Road>();
     63        final LinkedList<Road> via = new LinkedList<>();
    6464       
    6565        final Road.End fromRoadEnd = c.getJunction(Utils.lineUp(from, tmp.get(0))).getRoadEnd(from);
     
    9797        n = Utils.getOppositeEnd(to, n);
    9898       
    99         final Set<Turn> result = new HashSet<Turn>();
     99        final Set<Turn> result = new HashSet<>();
    100100        for (int i : indices(r, Constants.TURN_KEY_LANES)) {
    101101            result.add(new Turn(r, fromRoadEnd.getLane(Lane.Kind.REGULAR, i), via, toRoadEnd));
     
    111111       
    112112        if (joined == null) {
    113             return new ArrayList<Integer>(1);
    114         }
    115        
    116         final List<Integer> result = new ArrayList<Integer>();
     113            return new ArrayList<>(1);
     114        }
     115       
     116        final List<Integer> result = new ArrayList<>();
    117117        for (String lane : Constants.SPLIT_PATTERN.split(joined)) {
    118118            result.add(Integer.parseInt(lane));
     
    136136        final Road.End toRoadEnd = j.getRoadEnd(to);
    137137       
    138         final Set<Turn> result = new HashSet<Turn>();
     138        final Set<Turn> result = new HashSet<>();
    139139        for (int i : indices(r, Constants.TURN_KEY_LANES)) {
    140140            result.add(new Turn(r, fromRoadEnd.getLane(Lane.Kind.REGULAR, i), Collections.<Road> emptyList(), toRoadEnd));
     
    217217   
    218218    void fixReferences(GenericCommand cmd, boolean left, int index) {
    219         final List<Integer> fixed = new ArrayList<Integer>();
     219        final List<Integer> fixed = new ArrayList<>();
    220220        for (int i : indices(relation, Constants.TURN_KEY_EXTRA_LANES)) {
    221221            if (left ? i < index : i > index) {
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Utils.java

    r30043 r30737  
    2020
    2121public class Utils {
    22     private static final Set<String> ROAD_HIGHWAY_VALUES = Collections.unmodifiableSet(new HashSet<String>(Arrays
     22    private static final Set<String> ROAD_HIGHWAY_VALUES = Collections.unmodifiableSet(new HashSet<>(Arrays
    2323            .asList("motorway", "motorway_link", "trunk", "trunk_link", "primary", "primary_link", "secondary",
    2424                    "secondary_link", "tertiary", "tertiary_link", "residential", "unclassified", "road", "living_street", "service",
     
    3030   
    3131    public static final List<Way> filterRoads(List<OsmPrimitive> of) {
    32         final List<Way> result = new ArrayList<Way>();
     32        final List<Way> result = new ArrayList<>();
    3333       
    3434        for (OsmPrimitive p : of) {
     
    7070   
    7171    public static List<RelationMember> getMembers(Relation r, String role) {
    72         final List<RelationMember> result = new ArrayList<RelationMember>();
     72        final List<RelationMember> result = new ArrayList<>();
    7373        for (RelationMember m : r.getMembers()) {
    7474            if (m.getRole().equals(role)) {
     
    8888   
    8989    private static <T> List<T> mapMembers(List<RelationMember> ms, Class<T> t) {
    90         final List<T> result = new ArrayList<T>(ms.size());
     90        final List<T> result = new ArrayList<>(ms.size());
    9191        for (RelationMember m : ms) {
    9292            result.add(t.cast(m.getMember()));
     
    102102     */
    103103    public static Node lineUp(Way a, Way b) {
    104         final Set<Node> s = new HashSet<Node>(Arrays.asList(a.firstNode(), a.lastNode(), b.firstNode(), b.lastNode()));
     104        final Set<Node> s = new HashSet<>(Arrays.asList(a.firstNode(), a.lastNode(), b.firstNode(), b.lastNode()));
    105105        if (a.firstNode() == a.lastNode() || b.firstNode().equals(b.lastNode()) || s.size() == 2) {
    106106            throw new IllegalArgumentException("Cycles are not allowed.");
     
    152152     */
    153153    public static List<Route> orderWays(Iterable<Way> ways, Iterable<Node> nodes) {
    154         final List<Way> ws = new LinkedList<Way>(CollectionUtils.toList(ways));
    155         final Set<Node> ns = new HashSet<Node>(CollectionUtils.toList(nodes));
    156        
    157         final List<Route> result = new ArrayList<Route>();
     154        final List<Way> ws = new LinkedList<>(CollectionUtils.toList(ways));
     155        final Set<Node> ns = new HashSet<>(CollectionUtils.toList(nodes));
     156       
     157        final List<Route> result = new ArrayList<>();
    158158       
    159159        while (!ws.isEmpty()) {
     
    175175        }
    176176       
    177         final List<Way> result = new ArrayList<Way>();
     177        final List<Way> result = new ArrayList<>();
    178178        result.add(w);
    179179        Node n = first ? w.lastNode() : w.firstNode();
     
    205205   
    206206    public static Iterable<Way> flattenVia(Node start, List<Road> via, Node end) {
    207         final List<Way> result = new ArrayList<Way>();
     207        final List<Way> result = new ArrayList<>();
    208208       
    209209        Node n = start;
  • applications/editors/josm/plugins/turnlanes/src/org/openstreetmap/josm/plugins/turnlanes/model/Validator.java

    r26288 r30737  
    105105   
    106106    public List<Issue> validate(DataSet dataSet) {
    107         final List<Relation> lenghts = new ArrayList<Relation>();
    108         final List<Relation> turns = new ArrayList<Relation>();
     107        final List<Relation> lenghts = new ArrayList<>();
     108        final List<Relation> turns = new ArrayList<>();
    109109       
    110110        for (Relation r : OsmPrimitive.getFilteredList(dataSet.allPrimitives(), Relation.class)) {
     
    121121        }
    122122       
    123         final List<Issue> issues = new ArrayList<Issue>();
    124        
    125         final Map<IncomingLanes.Key, IncomingLanes> incomingLanes = new HashMap<IncomingLanes.Key, IncomingLanes>();
     123        final List<Issue> issues = new ArrayList<>();
     124       
     125        final Map<IncomingLanes.Key, IncomingLanes> incomingLanes = new HashMap<>();
    126126        issues.addAll(validateLengths(lenghts, incomingLanes));
    127127        issues.addAll(validateTurns(turns, incomingLanes));
     
    138138   
    139139    private List<Issue> validateLengths(List<Relation> lenghts, Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
    140         final List<Issue> issues = new ArrayList<Issue>();
     140        final List<Issue> issues = new ArrayList<>();
    141141       
    142142        for (Relation r : lenghts) {
     
    148148   
    149149    private List<Issue> validateLengths(Relation r, Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
    150         final List<Issue> issues = new ArrayList<Issue>();
     150        final List<Issue> issues = new ArrayList<>();
    151151       
    152152        try {
     
    227227   
    228228    private Route orderWays(final Relation r, List<Way> ways, Node end, List<Issue> issues, String role, String type) {
    229         final List<Way> unordered = new ArrayList<Way>(ways);
    230         final List<Way> ordered = new ArrayList<Way>(ways.size());
    231         final Set<Node> ends = new HashSet<Node>(); // to find cycles
     229        final List<Way> unordered = new ArrayList<>(ways);
     230        final List<Way> ordered = new ArrayList<>(ways.size());
     231        final Set<Node> ends = new HashSet<>(); // to find cycles
    232232       
    233233        Node current = end;
     
    280280   
    281281    private List<Issue> validateTurns(List<Relation> turns, Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
    282         final List<Issue> issues = new ArrayList<Issue>();
     282        final List<Issue> issues = new ArrayList<>();
    283283       
    284284        for (Relation r : turns) {
     
    290290   
    291291    private List<Issue> validateTurns(Relation r, Map<IncomingLanes.Key, IncomingLanes> incomingLanes) {
    292         final List<Issue> issues = new ArrayList<Issue>();
     292        final List<Issue> issues = new ArrayList<>();
    293293       
    294294        try {
     
    367367        }
    368368       
    369         final List<Integer> result = new ArrayList<Integer>();
     369        final List<Integer> result = new ArrayList<>();
    370370       
    371371        for (String s : Constants.SPLIT_PATTERN.split(ints)) {
Note: See TracChangeset for help on using the changeset viewer.