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/cadastre-fr/src/cadastre_fr
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/Address.java

    r29801 r30737  
    131131        MapView mv = Main.map.mapView;
    132132        Point mousePos = e.getPoint();
    133         List<Way> mouseOnExistingWays = new ArrayList<Way>();
    134         List<Way> mouseOnExistingBuildingWays = new ArrayList<Way>();
    135         mouseOnExistingWays = new ArrayList<Way>();
     133        List<Way> mouseOnExistingWays = new ArrayList<>();
     134        List<Way> mouseOnExistingBuildingWays = new ArrayList<>();
     135        mouseOnExistingWays = new ArrayList<>();
    136136        Node currentMouseNode = mv.getNearestNode(mousePos, OsmPrimitive.isSelectablePredicate);
    137137        if (currentMouseNode != null) {
     
    144144                    && !inputStreet.getText().equals("")) {
    145145                // house number already present but not linked to a street
    146                 Collection<Command> cmds = new LinkedList<Command>();
     146                Collection<Command> cmds = new LinkedList<>();
    147147                addStreetNameOrRelation(currentMouseNode, cmds);
    148148                Command c = new SequenceCommand("Add node address", cmds);
     
    164164                        inputStreet.setText(currentMouseNode.get(tagHouseStreet));
    165165                        if (ctrl) {
    166                             Collection<Command> cmds = new LinkedList<Command>();
     166                            Collection<Command> cmds = new LinkedList<>();
    167167                            addAddrToPrimitive(currentMouseNode, cmds);
    168168                            if (num == null)
     
    179179                            applyInputNumberChange();
    180180                        }
    181                         Collection<Command> cmds = new LinkedList<Command>();
     181                        Collection<Command> cmds = new LinkedList<>();
    182182                        addAddrToPrimitive(currentMouseNode, cmds);
    183183                    } else {
     
    206206                    Toolkit.getDefaultToolkit().beep();
    207207                } else {
    208                     Collection<Command> cmds = new LinkedList<Command>();
     208                    Collection<Command> cmds = new LinkedList<>();
    209209                    if (ctrl) {
    210210                        applyInputNumberChange();
     
    305305        cmds.add(new AddCommand(n));
    306306        List<WaySegment> wss = Main.map.mapView.getNearestWaySegments(e.getPoint(), OsmPrimitive.isSelectablePredicate);
    307         Map<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>();
     307        Map<Way, List<Integer>> insertPoints = new HashMap<>();
    308308        for (WaySegment ws : wss) {
    309309            List<Integer> is;
     
    311311                is = insertPoints.get(ws.way);
    312312            } else {
    313                 is = new ArrayList<Integer>();
     313                is = new ArrayList<>();
    314314                insertPoints.put(ws.way, is);
    315315            }
     
    317317            is.add(ws.lowerIndex);
    318318        }
    319         Set<Pair<Node,Node>> segSet = new HashSet<Pair<Node,Node>>();
    320         ArrayList<Way> replacedWays = new ArrayList<Way>();
    321         ArrayList<Way> reuseWays = new ArrayList<Way>();
     319        Set<Pair<Node,Node>> segSet = new HashSet<>();
     320        ArrayList<Way> replacedWays = new ArrayList<>();
     321        ArrayList<Way> reuseWays = new ArrayList<>();
    322322        for (Map.Entry<Way, List<Integer>> insertPoint : insertPoints.entrySet()) {
    323323            Way w = insertPoint.getKey();
     
    326326            pruneSuccsAndReverse(is);
    327327            for (int i : is) {
    328                 segSet.add(Pair.sort(new Pair<Node,Node>(w.getNode(i), w.getNode(i+1))));
     328                segSet.add(Pair.sort(new Pair<>(w.getNode(i), w.getNode(i+1))));
    329329            }
    330330            for (int i : is) {
     
    403403        //if (is.size() < 2) return;
    404404
    405         HashSet<Integer> is2 = new HashSet<Integer>();
     405        HashSet<Integer> is2 = new HashSet<>();
    406406        for (int i : is) {
    407407            if (!is2.contains(i - 1) && !is2.contains(i + 1)) {
     
    541541   
    542542    private void setNewSelection(OsmPrimitive osm) {
    543         Collection<OsmPrimitive> newSelection = new LinkedList<OsmPrimitive>(Main.main.getCurrentDataSet().getSelected());
     543        Collection<OsmPrimitive> newSelection = new LinkedList<>(Main.main.getCurrentDataSet().getSelected());
    544544        newSelection.clear();
    545545        newSelection.add(osm);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CacheControl.java

    r29922 r30737  
    4444    public WMSLayer wmsLayer = null;
    4545
    46     private ArrayList<GeorefImage> imagesToSave = new ArrayList<GeorefImage>();
     46    private ArrayList<GeorefImage> imagesToSave = new ArrayList<>();
    4747    private Lock imagesLock = new ReentrantLock();
    4848
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java

    r30701 r30737  
    3333    private String lastWMSLayerName = null;
    3434    private URL searchFormURL;
    35     private Vector<String> listOfCommunes = new Vector<String>();
    36     private Vector<String> listOfTA = new Vector<String>();
     35    private Vector<String> listOfCommunes = new Vector<>();
     36    private Vector<String> listOfTA = new Vector<>();
    3737    class PlanImage {
    3838        String name;
     
    4343        }
    4444    }
    45     private Vector<PlanImage> listOfFeuilles = new Vector<PlanImage>();
     45    private Vector<PlanImage> listOfFeuilles = new Vector<>();
    4646    private long cookieTimestamp;
    4747
     
    435435    private int selectFeuilleDialog() {
    436436        JPanel p = new JPanel(new GridBagLayout());
    437         Vector<String> imageNames = new Vector<String>();
     437        Vector<String> imageNames = new Vector<>();
    438438        for (PlanImage src : listOfFeuilles) {
    439439            imageNames.add(src.name);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r29922 r30737  
    422422                    zone = code - 27561;
    423423                } else {                                            // UTM_France_DOM
    424                     Map<Integer, Integer> utmfr = new HashMap<Integer, Integer>();
     424                    Map<Integer, Integer> utmfr = new HashMap<>();
    425425                    utmfr.put(2969, 0);
    426426                    utmfr.put(2970, 1);
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java

    r30532 r30737  
    3939    {
    4040        if (CadastrePlugin.autoSourcing && CadastrePlugin.pluginUsed && !apiDataSet.getPrimitivesToAdd().isEmpty()) {
    41             Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>();
     41            Collection<OsmPrimitive> sel = new HashSet<>();
    4242            for (OsmPrimitive osm : apiDataSet.getPrimitivesToAdd()) {
    4343                if ((osm instanceof Way && (osm.getKeys().size() == 0 || !tagSourceExist(osm)))
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java

    r29854 r30737  
    9999    private void createBuildings(String svg) {
    100100        String[] SVGpaths = new SVGParser().getClosedPaths(svg);
    101         ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList<ArrayList<EastNorth>>();
     101        ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList<>();
    102102
    103103        // convert SVG nodes to eastNorth coordinates
    104104        for (int i=0; i< SVGpaths.length; i++) {
    105             ArrayList<EastNorth> eastNorth = new ArrayList<EastNorth>();
     105            ArrayList<EastNorth> eastNorth = new ArrayList<>();
    106106            createNodes(SVGpaths[i], eastNorth);
    107107            if (eastNorth.size() > 2)
     
    156156        }
    157157
    158         Collection<Command> cmds = new LinkedList<Command>();
     158        Collection<Command> cmds = new LinkedList<>();
    159159        for (Node node : svgDataSet.getNodes())
    160160            if (!node.isDeleted())
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGTask.java

    r29854 r30737  
    104104    private void createWay(String svg) {
    105105        String[] SVGpaths = new SVGParser().getClosedPaths(svg);
    106         ArrayList<Double> fitViewBox = new ArrayList<Double>();
    107         ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList<ArrayList<EastNorth>>();
     106        ArrayList<Double> fitViewBox = new ArrayList<>();
     107        ArrayList<ArrayList<EastNorth>> eastNorths = new ArrayList<>();
    108108        for (int i=0; i< SVGpaths.length; i++) {
    109             ArrayList<EastNorth> eastNorth = new ArrayList<EastNorth>();
     109            ArrayList<EastNorth> eastNorth = new ArrayList<>();
    110110            fitViewBox.add( createNodes(SVGpaths[i], eastNorth) );
    111111            eastNorths.add(eastNorth);
     
    114114        Double min = Collections.min(fitViewBox);
    115115        int bestPath = fitViewBox.indexOf(min);
    116         List<Node> nodeList = new ArrayList<Node>();
     116        List<Node> nodeList = new ArrayList<>();
    117117        for (EastNorth eastNorth : eastNorths.get(bestPath)) {
    118118            nodeList.add(new Node(Main.getProjection().eastNorth2latlon(eastNorth)));
    119119        }
    120120        Way wayToAdd = new Way();
    121         Collection<Command> cmds = new LinkedList<Command>();
     121        Collection<Command> cmds = new LinkedList<>();
    122122        for (Node node : nodeList) {
    123123            cmds.add(new AddCommand(node));
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/GrabThread.java

    r26524 r30737  
    2525    private Lock lockImagesToGrag = new ReentrantLock();
    2626
    27     private ArrayList<EastNorthBound> imagesToGrab = new ArrayList<EastNorthBound>();
     27    private ArrayList<EastNorthBound> imagesToGrab = new ArrayList<>();
    2828
    2929    private CacheControl cacheControl = null;
     
    5858   
    5959    public ArrayList<EastNorthBound> getImagesToGrabCopy() {
    60         ArrayList<EastNorthBound> copyList = new ArrayList<EastNorthBound>();
     60        ArrayList<EastNorthBound> copyList = new ArrayList<>();
    6161        lockImagesToGrag.lock();
    6262        for (EastNorthBound img : imagesToGrab) {
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SVGParser.java

    r18544 r30737  
    4747     */
    4848    public String [] getClosedPaths(String svg) {
    49         ArrayList<String> path = new ArrayList<String>();
     49        ArrayList<String> path = new ArrayList<>();
    5050        int i = 0;
    5151        while (svg.indexOf(cPathStart, i) != -1) {
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/SimplifyWay.java

    r20585 r30737  
    2323    public void simplifyWayRange(Way wnew, int from, int to, double thr) {
    2424        if (to - from >= 2) {
    25             ArrayList<Node> ns = new ArrayList<Node>();
     25            ArrayList<Node> ns = new ArrayList<>();
    2626            simplifyWayRange(wnew, from, to, ns, thr);
    2727            List<Node> nodes = wnew.getNodes();
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSDownloadAction.java

    r30701 r30737  
    2525    public static WMSLayer getLayer() {
    2626        // check if we already have a layer created. if not, create; if yes, reuse.
    27         ArrayList<WMSLayer> existingWMSlayers = new ArrayList<WMSLayer>();
     27        ArrayList<WMSLayer> existingWMSlayers = new ArrayList<>();
    2828        if (Main.map != null) {
    2929            Layer activeLayer = Main.map.mapView.getActiveLayer();
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/WMSLayer.java

    r29922 r30737  
    5454            CadastrePlugin.class.getResource("/images/cadastre_small.png")));
    5555
    56     private Vector<GeorefImage> images = new Vector<GeorefImage>();
     56    private Vector<GeorefImage> images = new Vector<>();
    5757
    5858    public Lock imagesLock = new ReentrantLock();
     
    6767    public static int currentFormat;
    6868
    69     private ArrayList<EastNorthBound> dividedBbox = new ArrayList<EastNorthBound>();
     69    private ArrayList<EastNorthBound> dividedBbox = new ArrayList<>();
    7070
    7171    private String location = "";
     
    540540            int oldImgWidth = images.get(0).image.getWidth();
    541541            int oldImgHeight = images.get(0).image.getHeight();
    542             HashSet<Double> lx = new HashSet<Double>();
    543             HashSet<Double> ly = new HashSet<Double>();
     542            HashSet<Double> lx = new HashSet<>();
     543            HashSet<Double> ly = new HashSet<>();
    544544            for (GeorefImage img : images) {
    545545                lx.add(img.min.east());
Note: See TracChangeset for help on using the changeset viewer.