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

[josm_plugins] fix Java 7 / unused code warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/TheRing.java

    r29535 r30737  
    3737    public TheRing( Way source ) {
    3838        this.source = source;
    39         segments = new ArrayList<RingSegment>(1);
     39        segments = new ArrayList<>(1);
    4040        segments.add(new RingSegment(source));
    4141    }
    4242   
    4343    public static boolean areAllOfThoseRings( Collection<Way> ways ) {
    44         List<Way> rings = new ArrayList<Way>();
     44        List<Way> rings = new ArrayList<>();
    4545        for( Way way : ways ) {
    4646            if( way.isClosed() )
     
    7070    public static List<Relation> makeManySimpleMultipolygons( Collection<Way> selection, List<Command> commands ) {
    7171        log("---------------------------------------");
    72         List<TheRing> rings = new ArrayList<TheRing>(selection.size());
     72        List<TheRing> rings = new ArrayList<>(selection.size());
    7373        for( Way w : selection )
    7474            rings.add(new TheRing(w));
     
    7777                rings.get(i).collide(rings.get(j));
    7878        redistributeSegments(rings);
    79         List<Relation> relations = new ArrayList<Relation>();
    80         Map<Relation, Relation> relationCache = new HashMap<Relation, Relation>();
     79        List<Relation> relations = new ArrayList<>();
     80        Map<Relation, Relation> relationCache = new HashMap<>();
    8181        for( TheRing r : rings ) {
    8282            commands.addAll(r.getCommands(relationCache));
     
    247247    public static void redistributeSegments( List<TheRing> rings ) {
    248248        // build segments map
    249         Map<RingSegment, TheRing> segmentMap = new HashMap<RingSegment, TheRing>();
     249        Map<RingSegment, TheRing> segmentMap = new HashMap<>();
    250250        for( TheRing ring : rings )
    251251            for( RingSegment seg : ring.segments )
     
    317317
    318318        // build a map of referencing relations
    319         Map<Relation, Integer> referencingRelations = new HashMap<Relation, Integer>();
    320         List<Command> relationCommands = new ArrayList<Command>();
     319        Map<Relation, Integer> referencingRelations = new HashMap<>();
     320        List<Command> relationCommands = new ArrayList<>();
    321321        for( OsmPrimitive p : source.getReferrers() ) {
    322322            if( p instanceof Relation ) {
     
    342342        // поÑ�тому Ñ�охранÑ�етÑ�Ñ� только первое изменение
    343343
    344         List<Command> commands = new ArrayList<Command>();
     344        List<Command> commands = new ArrayList<>();
    345345        boolean foundOwnWay = false;
    346346        for( RingSegment seg : segments ) {
     
    464464            if( pos <= 0 || pos >= nodes.size() - 1 )
    465465                return null;
    466             List<Node> newNodes = new ArrayList<Node>(nodes.subList(pos, nodes.size()));
     466            List<Node> newNodes = new ArrayList<>(nodes.subList(pos, nodes.size()));
    467467            nodes.subList(pos + 1, nodes.size()).clear();
    468468            return new RingSegment(newNodes);
     
    489489                return null;
    490490
    491             List<Node> newNodes = new ArrayList<Node>();
     491            List<Node> newNodes = new ArrayList<>();
    492492            if( pos2 > pos1 ) {
    493493                newNodes.addAll(nodes.subList(pos2, nodes.size()));
     
    499499            } else {
    500500                newNodes.addAll(nodes.subList(pos2, pos1 + 1));
    501                 nodes.addAll(new ArrayList<Node>(nodes.subList(0, pos2 + 1)));
     501                nodes.addAll(new ArrayList<>(nodes.subList(0, pos2 + 1)));
    502502                nodes.subList(0, pos1).clear();
    503503            }
     
    513513            if( nodes == null )
    514514                throw new IllegalArgumentException("Won't give you wayNodes: it is a reference");
    515             List<Node> wayNodes = new ArrayList<Node>(nodes);
     515            List<Node> wayNodes = new ArrayList<>(nodes);
    516516            if( isRing )
    517517                wayNodes.add(wayNodes.get(0));
Note: See TracChangeset for help on using the changeset viewer.