Ignore:
Timestamp:
2015-06-20T23:42:21+02:00 (9 years ago)
Author:
Don-vip
Message:

checkstyle: enable relevant whitespace checks and fix them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java

    r8393 r8510  
    121121    }
    122122
    123 
    124123    @SuppressWarnings("unchecked")
    125124    @Override
     
    163162        List<TestError> errors = new ArrayList<>();
    164163
    165         MultiMap<Map<String,String>, OsmPrimitive> mm = new MultiMap<>();
     164        MultiMap<Map<String, String>, OsmPrimitive> mm = new MultiMap<>();
    166165        for (Node n: nodes) {
    167166            mm.put(n.getKeys(), n);
    168167        }
    169168
    170         Map<String,Boolean> typeMap=new HashMap<>();
     169        Map<String, Boolean> typeMap = new HashMap<>();
    171170        String[] types = {"none", "highway", "railway", "waterway", "boundary", "power", "natural", "landuse", "building"};
    172171
    173 
    174         // check whether we have multiple nodes at the same position with
    175         // the same tag set
    176         //
    177         for (Iterator<Map<String,String>> it = mm.keySet().iterator(); it.hasNext();) {
    178             Map<String,String> tagSet = it.next();
     172        // check whether we have multiple nodes at the same position with the same tag set
     173        for (Iterator<Map<String, String>> it = mm.keySet().iterator(); it.hasNext();) {
     174            Map<String, String> tagSet = it.next();
    179175            if (mm.get(tagSet).size() > 1) {
    180176
     
    184180
    185181                for (OsmPrimitive p : mm.get(tagSet)) {
    186                     if (p.getType()==OsmPrimitiveType.NODE) {
     182                    if (p.getType() == OsmPrimitiveType.NODE) {
    187183                        Node n = (Node) p;
    188                         List<OsmPrimitive> lp=n.getReferrers();
     184                        List<OsmPrimitive> lp = n.getReferrers();
    189185                        for (OsmPrimitive sp: lp) {
    190                             if (sp.getType()==OsmPrimitiveType.WAY) {
     186                            if (sp.getType() == OsmPrimitiveType.WAY) {
    191187                                boolean typed = false;
    192                                 Way w=(Way) sp;
     188                                Way w = (Way) sp;
    193189                                Map<String, String> keys = w.getKeys();
    194190                                for (String type: typeMap.keySet()) {
    195191                                    if (keys.containsKey(type)) {
    196192                                        typeMap.put(type, true);
    197                                         typed=true;
     193                                        typed = true;
    198194                                    }
    199195                                }
     
    207203                }
    208204
    209                 int nbType=0;
     205                int nbType = 0;
    210206                for (Entry<String, Boolean> entry: typeMap.entrySet()) {
    211207                    if (entry.getValue()) {
     
    214210                }
    215211
    216                 if (nbType>1) {
     212                if (nbType > 1) {
    217213                    String msg = marktr("Mixed type duplicated nodes");
    218214                    errors.add(new TestError(
     
    364360                // object to keep track of the nodes at this position.
    365361                //
    366                 Node n1 = (Node)potentialDuplicates.get(n);
     362                Node n1 = (Node) potentialDuplicates.get(n);
    367363                List<Node> nodes = new ArrayList<>(2);
    368364                nodes.add(n1);
     
    372368                // we have multiple nodes at the same position.
    373369                //
    374                 List<Node> nodes = (List<Node>)potentialDuplicates.get(n);
     370                List<Node> nodes = (List<Node>) potentialDuplicates.get(n);
    375371                nodes.add(n);
    376372            }
     
    413409        }
    414410
    415         return null;// undoRedo handling done in mergeNodes
     411        return null; // undoRedo handling done in mergeNodes
    416412    }
    417413
Note: See TracChangeset for help on using the changeset viewer.