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/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionCheckTask.java

    r30725 r30737  
    7676    protected void realRun() throws SAXException, IOException,
    7777    OsmTransferException {
    78         jc.checkjunctions(new ArrayList<Channel>(subset), getProgressMonitor());
     78        jc.checkjunctions(new ArrayList<>(subset), getProgressMonitor());
    7979    }
    8080
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/JunctionSearchTask.java

    r30725 r30737  
    6464    protected void realRun() throws SAXException, IOException,
    6565    OsmTransferException {
    66         jc.junctionSearch(new ArrayList<Channel>(subset), getProgressMonitor());
     66        jc.junctionSearch(new ArrayList<>(subset), getProgressMonitor());
    6767    }
    6868
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/PrepareJunctionCheckorSearch.java

    r30725 r30737  
    2323        this.plugin = plugin;
    2424        this.n = n;
    25         this.subset = new HashSet<Channel>();
     25        this.subset = new HashSet<>();
    2626        this.produceRelation = producerelation;
    2727    }
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/commandlineinterface/CLI.java

    r30725 r30737  
    9191
    9292        JunctionChecker jc = new JunctionChecker(cdgb.getDigraph(), n);
    93         ArrayList<Channel> subset = new ArrayList<Channel>();
     93        ArrayList<Channel> subset = new ArrayList<>();
    9494
    9595        Channel seed = new Channel();
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/connectedness/DiGraphSealer.java

    r30725 r30737  
    3434     */
    3535    public void sealingGraph() {
    36         Vector<Integer> outgoingChannelIDs = new Vector<Integer>();
    37         Vector<Integer> incomingChannelIDs = new Vector<Integer>();
     36        Vector<Integer> outgoingChannelIDs = new Vector<>();
     37        Vector<Integer> incomingChannelIDs = new Vector<>();
    3838
    3939        for (int i = 0; i < digraph.numberOfChannels(); i++) {
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/connectedness/StrongConnectednessCalculator.java

    r30725 r30737  
    88
    99    private int index = 0;
    10     private final ArrayList<Channel> stack = new ArrayList<Channel>();
    11     private final ArrayList<ArrayList<Channel>> SCC = new ArrayList<ArrayList<Channel>>();
     10    private final ArrayList<Channel> stack = new ArrayList<>();
     11    private final ArrayList<ArrayList<Channel>> SCC = new ArrayList<>();
    1212    private final int numberOfNodes;
    1313    private int calculatedNodes = 0;
    14     private ArrayList<Channel> nsccchannels = new ArrayList<Channel>();
     14    private ArrayList<Channel> nsccchannels = new ArrayList<>();
    1515    private final ChannelDiGraph digraph;
    1616    int biggestPart = 0;
     
    5757     **/
    5858    private void saveNotSCCChannel() {
    59         nsccchannels = new ArrayList<Channel>();
     59        nsccchannels = new ArrayList<>();
    6060        for (int i = 0; i < SCC.size(); i++) {
    6161            if (i != biggestPart) {
     
    124124        if (v.getLowlink() == v.getIndex()) {
    125125            Channel n;
    126             ArrayList<Channel> component = new ArrayList<Channel>();
     126            ArrayList<Channel> component = new ArrayList<>();
    127127            do {
    128128                n = stack.remove(0);
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/converting/TurnRestrictionChecker.java

    r30725 r30737  
    1818public class TurnRestrictionChecker {
    1919
    20     private final ArrayList<OSMRelation> turnrestrictionsrelations = new ArrayList<OSMRelation>();
     20    private final ArrayList<OSMRelation> turnrestrictionsrelations = new ArrayList<>();
    2121    private final ChannelDiGraph channelDigraph;
    2222    private int relationpointer;
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/BasicChannel.java

    r30725 r30737  
    1111    private OSMNode toNode;
    1212    private OSMNode fromNode;
    13     private ArrayList<LeadsTo> leadsTo = new ArrayList<LeadsTo>();
    14     private final ArrayList<OSMWay> ways = new ArrayList<OSMWay>();
     13    private ArrayList<LeadsTo> leadsTo = new ArrayList<>();
     14    private final ArrayList<OSMWay> ways = new ArrayList<>();
    1515    private int newid;
    1616    //gibt es nur, wenn ein Channelobjekt aus einer Nichteinbahnstraße erzeugt wurde (backchannelID ist dann die ID des anderen Channels)
    1717    private int backChannelID = -100;
    18     private final ArrayList<Channel> predChannels = new ArrayList<Channel>();
     18    private final ArrayList<Channel> predChannels = new ArrayList<>();
    1919
    2020    //werden für den Tarjan-Algorithmus gebraucht
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/Channel.java

    r30725 r30737  
    1717    private boolean subgraph;
    1818    private int visited = BacktrackingColors.WHITE;
    19     private final ArrayList<Channel> reachableNodes = new ArrayList<Channel>();
     19    private final ArrayList<Channel> reachableNodes = new ArrayList<>();
    2020    private int ennr;
    2121    private boolean isStrongConnected = true;
     
    2323    private boolean isPartOfJunction = false; //wird für den eigenen Layer benötigt, um Teile einer Kreuzung farbig repräsentieren zu können
    2424   
    25     private final HashMap<Channel , ArrayList<Channel>> paths2 = new HashMap<Channel , ArrayList<Channel>>();
     25    private final HashMap<Channel , ArrayList<Channel>> paths2 = new HashMap<>();
    2626
    2727
     
    197197     */
    198198    public ArrayList<ArrayList<Channel>> getPaths() {
    199         ArrayList<ArrayList<Channel>> t = new ArrayList<ArrayList<Channel>>();
     199        ArrayList<ArrayList<Channel>> t = new ArrayList<>();
    200200        t.addAll(paths2.values());
    201201        return t;
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/ChannelDiGraph.java

    r30725 r30737  
    1111public class ChannelDiGraph extends Graph {
    1212
    13     private ArrayList<Channel> channels = new ArrayList<Channel>();
    14     private final ArrayList<LeadsTo> leadsTos = new ArrayList<LeadsTo>();
    15     private final HashSet<Channel> selectedChannels = new HashSet<Channel>();
    16     private HashSet<Channel> junctioncandidate = new HashSet<Channel>();
     13    private ArrayList<Channel> channels = new ArrayList<>();
     14    private final ArrayList<LeadsTo> leadsTos = new ArrayList<>();
     15    private final HashSet<Channel> selectedChannels = new HashSet<>();
     16    private HashSet<Channel> junctioncandidate = new HashSet<>();
    1717
    1818    public void setChannels(ArrayList<Channel> channels) {
     
    100100     */
    101101    public OSMNode[] getAllOSMNodes() {
    102         HashMap<Long, OSMNode> nodes = new HashMap<Long, OSMNode>();
     102        HashMap<Long, OSMNode> nodes = new HashMap<>();
    103103        for (int i = 0; i < channels.size(); i++) {
    104104            if (!nodes.containsKey(channels.get(i).getFromNode().getId())) {
     
    185185     */
    186186    public ArrayList<Channel> getChannelsTouchingOSMNodes (ArrayList<OSMNode> nodes) {
    187         ArrayList<Channel> touchingChannel = new ArrayList<Channel>();
     187        ArrayList<Channel> touchingChannel = new ArrayList<>();
    188188        for (int i = 0; i < nodes.size(); i++) {
    189189            for (int j = 0; j < channels.size(); j++) {
     
    204204
    205205    public ArrayList<Channel> getChannelsTouchingOSMNode(long id) {
    206         ArrayList<Channel> returnchannels = new ArrayList<Channel>();
     206        ArrayList<Channel> returnchannels = new ArrayList<>();
    207207        for (int i = 0; i < channels.size(); i++) {
    208208            if (channels.get(i).getFromNode().getId() == id) {
     
    223223     */
    224224    public ArrayList<Channel> getChannelsBetween(int idfrom, int idto) {
    225         ArrayList<Channel> channelsresult = new ArrayList<Channel>();
     225        ArrayList<Channel> channelsresult = new ArrayList<>();
    226226        for (int i = 0; i < channels.size(); i++) {
    227227            if (channels.get(i).getFromNode().getId() == idfrom) {
     
    240240
    241241    public ArrayList<Channel> getChannelswithWayID(int id) {
    242         ArrayList<Channel> channelsresult = new ArrayList<Channel>();
     242        ArrayList<Channel> channelsresult = new ArrayList<>();
    243243        for (int i = 0; i < channels.size(); i++) {
    244244            if (channels.get(i).getWay().getId() == id) {
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMEntity.java

    r30725 r30737  
    3838     * @uml.property  name="hashmap"
    3939     */
    40     private HashMap<String, String> hashmap = new HashMap<String, String>();
     40    private HashMap<String, String> hashmap = new HashMap<>();
    4141    /**
    4242     * @uml.property  name="version"
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMGraph.java

    r30725 r30737  
    1616public class OSMGraph extends Graph{
    1717
    18     private final HashMap<Long, OSMWay> ways = new HashMap<Long, OSMWay>();
    19     private HashMap<Long, OSMRelation> relations = new HashMap<Long, OSMRelation>();
    20     private final HashMap<Long, OSMNode> nodes = new HashMap<Long, OSMNode>();
     18    private final HashMap<Long, OSMWay> ways = new HashMap<>();
     19    private HashMap<Long, OSMRelation> relations = new HashMap<>();
     20    private final HashMap<Long, OSMNode> nodes = new HashMap<>();
    2121
    2222    public void addNode(OSMNode node) {
     
    8686    public ArrayList<Long> getIDsfromWay(int id) {
    8787        OSMWay w = ways.get(id);
    88         ArrayList<Long> ids  = new ArrayList<Long>();
     88        ArrayList<Long> ids  = new ArrayList<>();
    8989        ids.add(w.getToNode().getId());
    9090        ids.add(w.getFromNode().getId());
     
    9797        OSMnode.setLatitude(node.getBBox().getTopLeft().lat());
    9898        OSMnode.setLongitude(node.getBBox().getTopLeft().lon());
    99         OSMnode.setHashmap(new HashMap<String, String>(node.getKeys()));
     99        OSMnode.setHashmap(new HashMap<>(node.getKeys()));
    100100        nodes.put(OSMnode.getId(), OSMnode);
    101101    }
     
    108108            osmway.addNode(getNode(it.next().getId()));
    109109        }
    110         osmway.setHashmap(new HashMap<String, String>(way.getKeys()));
     110        osmway.setHashmap(new HashMap<>(way.getKeys()));
    111111        ways.put(osmway.getId(), osmway);
    112112    }
     
    115115        OSMRelation osmrelation = new OSMRelation();
    116116        osmrelation.setId(relation.getId());
    117         osmrelation.setHashmap(new HashMap<String, String>(relation.getKeys()));
     117        osmrelation.setHashmap(new HashMap<>(relation.getKeys()));
    118118        RelationMember rmember;
    119119        for (int i = 0; i < relation.getMembers().size(); i++) {
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMNode.java

    r30725 r30737  
    1111    private double latitude;
    1212    private double longitude;
    13     private ArrayList<Channel> outgoingChannels = new ArrayList<Channel>();
    14     private ArrayList<OSMNode> succNodeList = new ArrayList<OSMNode>();
    15     private ArrayList<OSMNode> predNodeList = new ArrayList<OSMNode>();
     13    private ArrayList<Channel> outgoingChannels = new ArrayList<>();
     14    private ArrayList<OSMNode> succNodeList = new ArrayList<>();
     15    private ArrayList<OSMNode> predNodeList = new ArrayList<>();
    1616   
    1717    public void addOutgoingChannel(Channel channel) {
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMRelation.java

    r30725 r30737  
    99public class OSMRelation extends OSMEntity {
    1010
    11     private ArrayList<Member> members = new ArrayList<Member>();
     11    private ArrayList<Member> members = new ArrayList<>();
    1212
    1313    public void setMembers(ArrayList<Member> members) {
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/datastructure/OSMWay.java

    r30725 r30737  
    88public class OSMWay extends OSMEntity {
    99
    10     private Vector<OSMNode> nodes = new Vector<OSMNode>();
     10    private Vector<OSMNode> nodes = new Vector<>();
    1111
    1212    public OSMNode[] getNodes() {
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/filter/Filter.java

    r30725 r30737  
    99public class Filter {
    1010   
    11     private HashSet<String> tagValues = new HashSet<String>();
     11    private HashSet<String> tagValues = new HashSet<>();
    1212    private String keyValue;
    1313   
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/JMinimality.java

    r30725 r30737  
    2828    private final ArrayList<Channel> OrEx;
    2929    private final int n;
    30     private final List<List<Object>> L = new ArrayList<List<Object>>(); //The list of columns to be sorted
     30    private final List<List<Object>> L = new ArrayList<>(); //The list of columns to be sorted
    3131    private long EEovern = 0;
    32     private final HashSet<Channel> subgraph = new HashSet<Channel>();//The candidate subgraph to be tested
     32    private final HashSet<Channel> subgraph = new HashSet<>();//The candidate subgraph to be tested
    3333    private ProgressMonitor pm;
    3434    private final boolean pmenabled;
    35     private final ArrayList<HashSet<Channel>> junctions = new ArrayList<HashSet<Channel>>();
     35    private final ArrayList<HashSet<Channel>> junctions = new ArrayList<>();
    3636    private final boolean searchFirstJunction;
    37     private final ArrayList<Channel> subJunction = new ArrayList<Channel>();
     37    private final ArrayList<Channel> subJunction = new ArrayList<>();
    3838    private final JPrepare jprepare;
    3939    private boolean Check = false;
     
    9292            do {
    9393                int missing = 0;
    94                 C = new ArrayList<Object>(3);
     94                C = new ArrayList<>(3);
    9595                v = new int[n][2];
    9696                C.add(i);//the first position of column variable C is the column index
     
    133133        Iterator<List<Object>> l = L.listIterator();
    134134        List<Object> C;
    135         ArrayList<int[]> CandidateK = new ArrayList<int[]>(n*n); //saves the candidate K_{n-1} in entry-exit pairs
     135        ArrayList<int[]> CandidateK = new ArrayList<>(n*n); //saves the candidate K_{n-1} in entry-exit pairs
    136136        long lindex= 0;
    137137        int h = 0;
     
    229229            }
    230230        }
    231         jprepare.jPrepare(new ArrayList<Channel>(subgraph));
     231        jprepare.jPrepare(new ArrayList<>(subgraph));
    232232        JCheck jCheck = new JCheck();
    233233        Check = jCheck.jCheck(jprepare.getEntries(), jprepare.getExits(), n);
     
    253253                }
    254254                if (isin == false) {
    255                     junctions.add(new HashSet<Channel>(subgraph));
     255                    junctions.add(new HashSet<>(subgraph));
    256256                    //log.info("Kreuzungskandidat der Liste zugefügt" + junctions.size());
    257257                }
     
    267267     */
    268268    public ArrayList<Channel> getSubJunctionCandidate(){
    269         return new ArrayList<Channel>(subgraph);
     269        return new ArrayList<>(subgraph);
    270270    }
    271271
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/JPrepare.java

    r30725 r30737  
    1717
    1818    public JPrepare(ChannelDiGraph digraph) {
    19         entries = new ArrayList<Channel>();
    20         exits = new ArrayList<Channel>();
     19        entries = new ArrayList<>();
     20        exits = new ArrayList<>();
    2121        this.digraph = digraph;
    2222    }
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/JunctionChecker.java

    r30725 r30737  
    3333    private JMinimality m;
    3434    // Variable wird beim KreuzungsSuchen benutzt, sonst ist sie leer!
    35     private ArrayList<HashSet<Channel>> junctions = new ArrayList<HashSet<Channel>>();
     35    private ArrayList<HashSet<Channel>> junctions = new ArrayList<>();
    3636    //dient zur Zeitmessung
    3737    private long startIterate = 0;
     
    4444        this.n = n;
    4545        this.jCheck = new JCheck();
    46         this.subjunction = new ArrayList<Channel>();
     46        this.subjunction = new ArrayList<>();
    4747        smallerJunction = false;
    4848    }
     
    138138
    139139    private void collectECandidates(ArrayList<Channel> subgraph) {
    140         E = new ArrayList<Channel>();
     140        E = new ArrayList<>();
    141141        for (int i = 0; i < subgraph.size(); i++) {
    142142            if ((subgraph.get(i).getIndegree() + subgraph.get(i).getOutdegree() >= 3)
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/TRDFS.java

    r30725 r30737  
    2626        this.vertices = adnodes;
    2727        this.digraph = digraph;
    28         this.cycleEdges = new ArrayList<LeadsTo>();
     28        this.cycleEdges = new ArrayList<>();
    2929    }
    3030
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/reader/ColorSchemeXMLReader.java

    r30725 r30737  
    3131    @Override
    3232    public void parseXML() {
    33         colorScheme = new HashMap<String, Color>();
     33        colorScheme = new HashMap<>();
    3434        String tempValue;
    3535        //String tempKeyValue ="";
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/reader/OSMXMLReader.java

    r30725 r30737  
    8282        OSMWay way = new OSMWay();
    8383        OSMRelation relation = new OSMRelation();
    84         HashMap<String, String> hashmap = new HashMap<String, String>();
     84        HashMap<String, String> hashmap = new HashMap<>();
    8585        try {
    8686            while (parser.hasNext()) {
     
    9292                    if (xmlelement.equals("node")) {
    9393                        node = new OSMNode();
    94                         hashmap = new HashMap<String, String>();
     94                        hashmap = new HashMap<>();
    9595                        readAttributes(node);
    9696                        node.setLatitude(Double.parseDouble(parser
     
    102102                    if (xmlelement.equals("way")) {
    103103                        way = new OSMWay();
    104                         hashmap = new HashMap<String, String>();
     104                        hashmap = new HashMap<>();
    105105                        readAttributes(way);
    106106                    }
     
    108108                    if (xmlelement.equals("relation")) {
    109109                        relation = new OSMRelation();
    110                         hashmap = new HashMap<String, String>();
     110                        hashmap = new HashMap<>();
    111111                        readAttributes(relation);
    112112                    }
     
    139139                    if (xmlelement.equals("relation")) {
    140140                        relation = new OSMRelation();
    141                         hashmap = new HashMap<String, String>();
     141                        hashmap = new HashMap<>();
    142142                        readAttributes(relation);
    143143                    }
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/reader/XMLFilterReader.java

    r30725 r30737  
    1616    public XMLFilterReader(String filename) {
    1717        super(filename);
    18         filters = new Vector<Filter>();
     18        filters = new Vector<>();
    1919    }
    2020
  • applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/util/RelationProducer.java

    r30725 r30737  
    2424    public RelationProducer(JunctionCheckerPlugin plugin) {
    2525        this.plugin = plugin;
    26         storedRelations = new HashSet<HashSet<Channel>>();
     26        storedRelations = new HashSet<>();
    2727    }
    2828
     
    3131            return;
    3232        }
    33         LinkedList<OsmPrimitive> ways = new LinkedList<OsmPrimitive>();
     33        LinkedList<OsmPrimitive> ways = new LinkedList<>();
    3434        Iterator<Channel> cit = subset.iterator();
    3535        while (cit.hasNext()) {
Note: See TracChangeset for help on using the changeset viewer.