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

checkstyle: enable relevant whitespace checks and fix them

Location:
trunk/src/org/openstreetmap/josm/data/validation
Files:
30 edited

Legend:

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

    r8378 r8510  
    168168                pathDir.mkdirs();
    169169            }
    170         } catch (Exception e){
     170        } catch (Exception e) {
    171171            Main.error(e);
    172172        }
     
    242242
    243243    private static void applyPrefs(Map<String, Test> tests, boolean beforeUpload) {
    244         for(String testName : Main.pref.getCollection(beforeUpload
     244        for (String testName : Main.pref.getCollection(beforeUpload
    245245        ? ValidatorPreference.PREF_SKIP_TESTS_BEFORE_UPLOAD : ValidatorPreference.PREF_SKIP_TESTS)) {
    246246            Test test = tests.get(testName);
  • trunk/src/org/openstreetmap/josm/data/validation/TestError.java

    r8435 r8510  
    317317                v.visit((WaySegment) o);
    318318            } else if (o instanceof List<?>) {
    319                 v.visit((List<Node>)o);
     319                v.visit((List<Node>) o);
    320320            }
    321321        }
     
    366366
    367367    @Override public void primitivesAdded(PrimitivesAddedEvent event) {}
     368
    368369    @Override public void tagsChanged(TagsChangedEvent event) {}
     370
    369371    @Override public void nodeMoved(NodeMovedEvent event) {}
     372
    370373    @Override public void wayNodesChanged(WayNodesChangedEvent event) {}
     374
    371375    @Override public void relationMembersChanged(RelationMembersChangedEvent event) {}
     376
    372377    @Override public void otherDatasetChange(AbstractDatasetChangedEvent event) {}
     378
    373379    @Override public void dataChanged(DataChangedEvent event) {}
    374380
  • trunk/src/org/openstreetmap/josm/data/validation/ValidatorVisitor.java

    r8378 r8510  
    1010public interface ValidatorVisitor {
    1111    void visit(TestError error);
     12
    1213    void visit(OsmPrimitive p);
     14
    1315    void visit(WaySegment ws);
     16
    1417    void visit(List<Node> nodes);
    1518}
  • trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java

    r8419 r8510  
    115115     */
    116116    public static DomainValidator getInstance(boolean allowLocal) {
    117        if(allowLocal) {
     117       if (allowLocal) {
    118118          return DOMAIN_VALIDATOR_WITH_LOCAL;
    119119       }
     
    138138        if (groups != null && groups.length > 0) {
    139139            return isValidTld(groups[0]);
    140         } else if(allowLocal) {
     140        } else if (allowLocal) {
    141141            if (hostnameRegex.isValid(domain)) {
    142142               return true;
     
    154154     */
    155155    public boolean isValidTld(String tld) {
    156         if(allowLocal && isValidLocalTld(tld)) {
     156        if (allowLocal && isValidLocalTld(tld)) {
    157157           return true;
    158158        }
  • trunk/src/org/openstreetmap/josm/data/validation/routines/EmailValidator.java

    r7937 r8510  
    8888     */
    8989    public static EmailValidator getInstance(boolean allowLocal) {
    90         if(allowLocal) {
     90        if (allowLocal) {
    9191           return EMAIL_VALIDATOR_WITH_LOCAL;
    9292        }
  • trunk/src/org/openstreetmap/josm/data/validation/routines/InetAddressValidator.java

    r8461 r8510  
    8282            try {
    8383                iIpSegment = Integer.parseInt(ipSegment);
    84             } catch(NumberFormatException e) {
     84            } catch (NumberFormatException e) {
    8585                return false;
    8686            }
  • trunk/src/org/openstreetmap/josm/data/validation/routines/RegexValidator.java

    r8394 r8510  
    107107        }
    108108        patterns = new Pattern[regexs.length];
    109         int flags = caseSensitive ? 0: Pattern.CASE_INSENSITIVE;
     109        int flags = caseSensitive ? 0 : Pattern.CASE_INSENSITIVE;
    110110        for (int i = 0; i < regexs.length; i++) {
    111111            if (regexs[i] == null || regexs[i].isEmpty()) {
  • trunk/src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java

    r8509 r8510  
    405405
    406406        String extra = authorityMatcher.group(PARSE_AUTHORITY_EXTRA);
    407         if (extra != null && !extra.trim().isEmpty()){
     407        if (extra != null && !extra.trim().isEmpty()) {
    408408            return false;
    409409        }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java

    r8419 r8510  
    5555            this(code, Collections.singleton(p), message);
    5656        }
     57
    5758        public AddressError(int code, Collection<OsmPrimitive> collection, String message) {
    5859            this(code, collection, message, null, null);
    5960        }
     61
    6062        public AddressError(int code, Collection<OsmPrimitive> collection, String message, String description, String englishDescription) {
    6163            this(code, Severity.WARNING, collection, message, description, englishDescription);
    6264        }
     65
    6366        public AddressError(int code, Severity severity, Collection<OsmPrimitive> collection, String message, String description,
    6467                String englishDescription) {
     
    207210            centroid = ((Node) house).getEastNorth();
    208211        } else if (house instanceof Way) {
    209             List<Node> nodes = ((Way)house).getNodes();
     212            List<Node> nodes = ((Way) house).getNodes();
    210213            if (house.hasKey(ADDR_INTERPOLATION)) {
    211214                for (Node n : nodes) {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java

    r8378 r8510  
    4040
    4141    /** All way segments, grouped by cells */
    42     private Map<Point2D,List<WaySegment>> cellSegments;
     42    private Map<Point2D, List<WaySegment>> cellSegments;
    4343    /** The already detected errors */
    4444    private Set<WaySegment> errorSegments;
     
    181181     */
    182182    public CrossingWays(String title) {
    183         super(title, tr("This test checks if two roads, railways, waterways or buildings crosses in the same layer, but are not connected by a node."));
     183        super(title, tr("This test checks if two roads, railways, waterways or buildings crosses in the same layer, " +
     184                "but are not connected by a node."));
    184185    }
    185186
  • 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
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java

    r8444 r8510  
    5555        @Override
    5656        public int hashCode() {
    57             return role.hashCode()+(int)relId+tags.hashCode()+type.hashCode()+coor.hashCode();
     57            return role.hashCode()+(int) relId+tags.hashCode()+type.hashCode()+coor.hashCode();
    5858        }
    5959
     
    6262            if (!(obj instanceof RelMember)) return false;
    6363            RelMember rm = (RelMember) obj;
    64             return rm.role.equals(role) && rm.type.equals(type) && rm.relId==relId && rm.tags.equals(tags) && rm.coor.equals(coor);
     64            return rm.role.equals(role) && rm.type.equals(type) && rm.relId == relId && rm.tags.equals(tags) && rm.coor.equals(coor);
    6565        }
    6666
     
    233233        for (OsmPrimitive osm : sel)
    234234            if (osm instanceof Relation && !osm.isDeleted()) {
    235                 relFix.add((Relation)osm);
     235                relFix.add((Relation) osm);
    236236            }
    237237
     
    296296        for (OsmPrimitive osm : sel)
    297297            if (osm instanceof Relation) {
    298                 relations.add((Relation)osm);
     298                relations.add((Relation) osm);
    299299            }
    300300
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java

    r8382 r8510  
    6767    private static class WayPairNoTags {
    6868        private final List<LatLon> coor;
     69
    6970        public WayPairNoTags(List<LatLon> coor) {
    7071            this.coor = coor;
    7172        }
     73
    7274        @Override
    7375        public int hashCode() {
    7476            return coor.hashCode();
    7577        }
     78
    7679        @Override
    7780        public boolean equals(Object obj) {
     
    125128            if (sameway.size() > 1) {
    126129                //Report error only if at least some tags are different, as otherwise the error was already reported as duplicated ways
    127                 Map<String, String> tags0=null;
    128                 boolean skip=true;
     130                Map<String, String> tags0 = null;
     131                boolean skip = true;
    129132
    130133                for (OsmPrimitive o : sameway) {
    131                     if (tags0==null) {
    132                         tags0=o.getKeys();
     134                    if (tags0 == null) {
     135                        tags0 = o.getKeys();
    133136                        removeUninterestingKeys(tags0);
    134137                    } else {
    135                         Map<String, String> tagsCmp=o.getKeys();
     138                        Map<String, String> tagsCmp = o.getKeys();
    136139                        removeUninterestingKeys(tagsCmp);
    137140                        if (!tagsCmp.equals(tags0)) {
    138                             skip=false;
     141                            skip = false;
    139142                            break;
    140143                        }
     
    158161     */
    159162    public void removeUninterestingKeys(Map<String, String> wkeys) {
    160         for(String key : OsmPrimitive.getDiscardableKeys()) {
     163        for (String key : OsmPrimitive.getDiscardableKeys()) {
    161164            wkeys.remove(key);
    162165        }
     
    207210            int lowestIndex = 0;
    208211            long lowestNodeId = wNodes.get(0).getUniqueId();
    209             for (int i=1; i<wNodes.size(); i++) {
     212            for (int i = 1; i < wNodes.size(); i++) {
    210213                if (wNodes.get(i).getUniqueId() < lowestNodeId) {
    211214                    lowestNodeId = wNodes.get(i).getUniqueId();
     
    213216                }
    214217            }
    215             for (int i=lowestIndex; i<wNodes.size()-1; i++) {
     218            for (int i = lowestIndex; i < wNodes.size()-1; i++) {
    216219                wNodesToUse.add(wNodes.get(i));
    217220            }
    218             for (int i=0; i<lowestIndex; i++) {
     221            for (int i = 0; i < lowestIndex; i++) {
    219222                wNodesToUse.add(wNodes.get(i));
    220223            }
     
    241244        for (OsmPrimitive osm : sel) {
    242245            if (osm instanceof Way && !osm.isDeleted()) {
    243                 ways.add((Way)osm);
     246                ways.add((Way) osm);
    244247            }
    245248        }
     
    301304
    302305        //Do not automatically fix same ways with different tags
    303         if (testError.getCode()!=DUPLICATE_WAY) return false;
     306        if (testError.getCode() != DUPLICATE_WAY) return false;
    304307
    305308        // We fix it only if there is no more than one way that is relation member.
     
    309312        for (OsmPrimitive osm : sel) {
    310313            if (osm instanceof Way) {
    311                 ways.add((Way)osm);
     314                ways.add((Way) osm);
    312315            }
    313316        }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/InternetTags.java

    r7937 r8510  
    132132            String errMsg = validator.getErrorMessage();
    133133            // Special treatment to allow URLs without protocol. See UrlValidator#isValid
    134             if (tr("URL contains an invalid protocol: {0}", (String)null).equals(errMsg)) {
     134            if (tr("URL contains an invalid protocol: {0}", (String) null).equals(errMsg)) {
    135135                String proto = validator instanceof EmailValidator ? "mailto://" : "http://";
    136136                return doValidateTag(p, k, proto+value, validator, code);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/LongSegment.java

    r8455 r8510  
    3535    public void visit(Way w) {
    3636        Double length = w.getLongestSegmentLength();
    37         if(length > maxlength) {
     37        if (length > maxlength) {
    3838            length /= 1000.0;
    3939            errors.add(new TestError(this, Severity.WARNING, tr("Long segments"),
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r8509 r8510  
    424424        static String insertArguments(Selector matchingSelector, String s, OsmPrimitive p) {
    425425            if (s != null && matchingSelector instanceof Selector.ChildOrParentSelector) {
    426                 return insertArguments(((Selector.ChildOrParentSelector)matchingSelector).right, s, p);
     426                return insertArguments(((Selector.ChildOrParentSelector) matchingSelector).right, s, p);
    427427            } else if (s == null || !(matchingSelector instanceof GeneralSelector)) {
    428428                return s;
     
    583583            for (Selector s : rule.selectors) {
    584584                if (s instanceof AbstractSelector) {
    585                     for (Condition c : ((AbstractSelector)s).getConditions()) {
     585                    for (Condition c : ((AbstractSelector) s).getConditions()) {
    586586                        if (c instanceof ClassCondition) {
    587587                            result.add(((ClassCondition) c).id);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java

    r8509 r8510  
    7979        for (Test t : OsmValidator.getEnabledTests(false)) {
    8080            if (t instanceof UnclosedWays) {
    81                 keysCheckedByAnotherTest.addAll(((UnclosedWays)t).getCheckedKeys());
     81                keysCheckedByAnotherTest.addAll(((UnclosedWays) t).getCheckedKeys());
    8282                break;
    8383            }
     
    9494        GeneralPath result = new GeneralPath();
    9595        result.moveTo((float) nodes.get(0).getCoor().lat(), (float) nodes.get(0).getCoor().lon());
    96         for (int i=1; i<nodes.size(); i++) {
     96        for (int i = 1; i < nodes.size(); i++) {
    9797            Node n = nodes.get(i);
    9898            result.lineTo((float) n.getCoor().lat(), (float) n.getCoor().lon());
  • trunk/src/org/openstreetmap/josm/data/validation/tests/NameMismatch.java

    r8455 r8510  
    4040    public NameMismatch() {
    4141        super(tr("Missing name:* translation"),
    42             tr("This test finds multilingual objects whose ''name'' attribute is not equal to some ''name:*'' attribute and not a composition of ''name:*'' attributes, e.g., Italia - Italien - Italy."));
     42            tr("This test finds multilingual objects whose ''name'' attribute is not equal to some ''name:*'' attribute " +
     43                    "and not a composition of ''name:*'' attributes, e.g., Italia - Italien - Italy."));
    4344    }
    4445
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java

    r8382 r8510  
    6363                        "    r.getErrors = function() {return [];};" +
    6464                        "    return r;" +
    65                         "  } catch(err) {" +
     65                        "  } catch (err) {" +
    6666                        "    return {" +
    6767                        "      getWarnings: function() {return [];}," +
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java

    r8444 r8510  
    4040
    4141    /** Bag of all way segments */
    42     private MultiMap<Pair<Node,Node>, WaySegment> nodePairs;
     42    private MultiMap<Pair<Node, Node>, WaySegment> nodePairs;
    4343
    4444    protected static final int OVERLAPPING_HIGHWAY = 101;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java

    r8382 r8510  
    122122            List<List<Node>> nodesLists = new ArrayList<>();
    123123            if (station instanceof Way) {
    124                 nodesLists.add(((Way)station).getNodes());
     124                nodesLists.add(((Way) station).getNodes());
    125125            } else if (station instanceof Relation) {
    126126                Multipolygon polygon = MultipolygonCache.getInstance().get(Main.map.mapView, (Relation) station);
     
    147147            if (it.hasNext()) {
    148148                return new ChangePropertyCommand(it.next(),
    149                         "power", towerPoleTagMap.get(((PowerLineError)testError).line));
     149                        "power", towerPoleTagMap.get(((PowerLineError) testError).line));
    150150            }
    151151        }
     
    155155    @Override
    156156    public boolean isFixable(TestError testError) {
    157         return testError instanceof PowerLineError && towerPoleTagMap.containsKey(((PowerLineError)testError).line);
     157        return testError instanceof PowerLineError && towerPoleTagMap.containsKey(((PowerLineError) testError).line);
    158158    }
    159159
     
    207207    protected class PowerLineError extends TestError {
    208208        private final Way line;
     209
    209210        public PowerLineError(Node n, Way line) {
    210211            super(PowerLines.this, Severity.WARNING,
     
    212213            this.line = line;
    213214        }
     215
    214216        public final Node getNode() {
    215217            // primitives list can be empty if all primitives have been purged
  • trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java

    r8461 r8510  
    8585
    8686    private static class RolePreset {
     87        private final List<Role> roles;
     88        private final String name;
     89
    8790        public RolePreset(List<Role> roles, String name) {
    8891            this.roles = roles;
    8992            this.name = name;
    9093        }
    91         private final List<Role> roles;
    92         private final String name;
    9394    }
    9495
     
    118119
    119120    private Map<String, RoleInfo> buildRoleInfoMap(Relation n) {
    120         Map<String,RoleInfo> map = new HashMap<>();
     121        Map<String, RoleInfo> map = new HashMap<>();
    121122        for (RelationMember m : n.getMembers()) {
    122123            String role = m.getRole();
     
    150151            }
    151152            if (matches && r != null) {
    152                 for(Role role: r.roles) {
     153                for (Role role: r.roles) {
    153154                    String key = role.key;
    154155                    List<Role> roleGroup = null;
     
    213214                    // verify if preset accepts such member
    214215                    OsmPrimitive primitive = member.getMember();
    215                     if(!primitive.isUsable()) {
     216                    if (!primitive.isUsable()) {
    216217                        // if member is not usable (i.e. not present in working set)
    217218                        // we can't verify expression - so we just skip it
     
    219220                    } else {
    220221                        // verify expression
    221                         if(r.memberExpression.match(primitive)) {
     222                        if (r.memberExpression.match(primitive)) {
    222223                            return true;
    223224                        } else {
     
    283284
    284285        // verify role counts based on whole role sets
    285         for(RolePreset rp: allroles.values()) {
     286        for (RolePreset rp: allroles.values()) {
    286287            for (Role r: rp.roles) {
    287288                String keyname = r.key;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java

    r8404 r8510  
    3737
    3838    /** All ways, grouped by cells */
    39     private Map<Point2D,List<Way>> cellWays;
     39    private Map<Point2D, List<Way>> cellWays;
    4040    /** The already detected errors */
    4141    private MultiMap<Way, Way> errorWays;
     
    130130        if (m == 0)
    131131            return n;
    132         d = new int[n + 1][m + 1];
     132        d = new int[n+1][m+1];
    133133
    134134        // Step 2
     
    198198        // check plain strings
    199199        int distance = getLevenshteinDistance(name, name2);
    200         boolean similar = distance>0 && distance<=2;
     200        boolean similar = distance > 0 && distance <= 2;
    201201
    202202        // try all rules
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r8470 r8510  
    265265            }
    266266            // TODO directionKeys are no longer in OsmPrimitive (search pattern is used instead)
    267             /*  for(String a : OsmPrimitive.getDirectionKeys())
     267            /*  for (String a : OsmPrimitive.getDirectionKeys())
    268268                presetsValueData.add(a);
    269269             */
     
    345345                withErrors.put(p, "ICK");
    346346            }
    347             if (checkValues && (value!=null && value.length() > 255) && !withErrors.contains(p, "LV")) {
     347            if (checkValues && (value != null && value.length() > 255) && !withErrors.contains(p, "LV")) {
    348348                errors.add(new TestError(this, Severity.ERROR, tr("Tag value longer than allowed"),
    349349                        tr(s, key), MessageFormat.format(s, key), LONG_VALUE, p));
    350350                withErrors.put(p, "LV");
    351351            }
    352             if (checkKeys && (key!=null && key.length() > 255) && !withErrors.contains(p, "LK")) {
     352            if (checkKeys && (key != null && key.length() > 255) && !withErrors.contains(p, "LK")) {
    353353                errors.add(new TestError(this, Severity.ERROR, tr("Tag key longer than allowed"),
    354354                        tr(s, key), MessageFormat.format(s, key), LONG_KEY, p));
    355355                withErrors.put(p, "LK");
    356356            }
    357             if (checkValues && (value==null || value.trim().isEmpty()) && !withErrors.contains(p, "EV")) {
     357            if (checkValues && (value == null || value.trim().isEmpty()) && !withErrors.contains(p, "EV")) {
    358358                errors.add(new TestError(this, Severity.WARNING, tr("Tags with empty values"),
    359359                        tr(s, key), MessageFormat.format(s, key), EMPTY_VALUES, p));
     
    392392                }
    393393                for (String a : ignoreDataEquals) {
    394                     if(key.equals(a)) {
     394                    if (key.equals(a)) {
    395395                        ignore = true;
    396396                    }
    397397                }
    398398                for (String a : ignoreDataEndsWith) {
    399                     if(key.endsWith(a)) {
     399                    if (key.endsWith(a)) {
    400400                        ignore = true;
    401401                    }
     
    508508        a.anchor = GridBagConstraints.EAST;
    509509
    510         testPanel.add(new JLabel(name+" :"), GBC.eol().insets(3,0,0,0));
     510        testPanel.add(new JLabel(name+" :"), GBC.eol().insets(3, 0, 0, 0));
    511511
    512512        prefCheckKeys = new JCheckBox(tr("Check property keys."), Main.pref.getBoolean(PREF_CHECK_KEYS, true));
    513513        prefCheckKeys.setToolTipText(tr("Validate that property keys are valid checking against list of words."));
    514         testPanel.add(prefCheckKeys, GBC.std().insets(20,0,0,0));
     514        testPanel.add(prefCheckKeys, GBC.std().insets(20, 0, 0, 0));
    515515
    516516        prefCheckKeysBeforeUpload = new JCheckBox();
     
    520520        prefCheckComplex = new JCheckBox(tr("Use complex property checker."), Main.pref.getBoolean(PREF_CHECK_COMPLEX, true));
    521521        prefCheckComplex.setToolTipText(tr("Validate property values and tags using complex rules."));
    522         testPanel.add(prefCheckComplex, GBC.std().insets(20,0,0,0));
     522        testPanel.add(prefCheckComplex, GBC.std().insets(20, 0, 0, 0));
    523523
    524524        prefCheckComplexBeforeUpload = new JCheckBox();
     
    547547        prefCheckValues = new JCheckBox(tr("Check property values."), Main.pref.getBoolean(PREF_CHECK_VALUES, true));
    548548        prefCheckValues.setToolTipText(tr("Validate that property values are valid checking against presets."));
    549         testPanel.add(prefCheckValues, GBC.std().insets(20,0,0,0));
     549        testPanel.add(prefCheckValues, GBC.std().insets(20, 0, 0, 0));
    550550
    551551        prefCheckValuesBeforeUpload = new JCheckBox();
     
    555555        prefCheckFixmes = new JCheckBox(tr("Check for FIXMES."), Main.pref.getBoolean(PREF_CHECK_FIXMES, true));
    556556        prefCheckFixmes.setToolTipText(tr("Looks for nodes or ways with FIXME in any property value."));
    557         testPanel.add(prefCheckFixmes, GBC.std().insets(20,0,0,0));
     557        testPanel.add(prefCheckFixmes, GBC.std().insets(20, 0, 0, 0));
    558558
    559559        prefCheckFixmesBeforeUpload = new JCheckBox();
     
    667667            private Pattern getPattern(String str) throws PatternSyntaxException {
    668668                if (str.endsWith("/i"))
    669                     return Pattern.compile(str.substring(1,str.length()-2), Pattern.CASE_INSENSITIVE);
     669                    return Pattern.compile(str.substring(1, str.length()-2), Pattern.CASE_INSENSITIVE);
    670670                if (str.endsWith("/"))
    671                     return Pattern.compile(str.substring(1,str.length()-1));
     671                    return Pattern.compile(str.substring(1, str.length()-1));
    672672
    673673                throw new IllegalStateException();
    674674            }
     675
    675676            public CheckerElement(String exp) throws PatternSyntaxException {
    676677                Matcher m = Pattern.compile("(.+)([!=]=)(.+)").matcher(exp);
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java

    r8390 r8510  
    174174
    175175        for (OsmPrimitive parent: w.getReferrers()) {
    176             if (parent instanceof Relation && ((Relation)parent).isMultipolygon())
     176            if (parent instanceof Relation && ((Relation) parent).isMultipolygon())
    177177                return;
    178178        }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java

    r8509 r8510  
    423423            return ret;
    424424        for (int i = 1; i < size; ++i) {
    425             if(i < size-1) {
     425            if (i < size-1) {
    426426                addNode(w.getNode(i), middlenodes);
    427427            }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java

    r8444 r8510  
    127127                        OsmPrimitive member = m.getMember();
    128128                        if (member instanceof Way && member.isUsable() && !member.isTagged()) {
    129                             waysUsedInRelations.add((Way)member);
     129                            waysUsedInRelations.add((Way) member);
    130130                        }
    131131                    }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java

    r7937 r8510  
    4040        List<OsmPrimitive> r = w.firstNode().getReferrers();
    4141        for (OsmPrimitive p : r) {
    42             if(p != w && p.hasKey("highway")) {
     42            if (p != w && p.hasKey("highway")) {
    4343                hasway = true;
    4444                break;
     
    5353        r = w.lastNode().getReferrers();
    5454        for (OsmPrimitive p : r) {
    55             if(p != w && p.hasKey("highway")) {
     55            if (p != w && p.hasKey("highway")) {
    5656                hasway = true;
    5757                break;
  • trunk/src/org/openstreetmap/josm/data/validation/util/Entities.java

    r8395 r8510  
    382382                        }
    383383                    } else { // escaped value content is an entity name
    384                         if(mapNameToValue == null) {
     384                        if (mapNameToValue == null) {
    385385                            mapNameToValue = new HashMap<>();
    386386                            for (String[] pair : ARRAY)
  • trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java

    r8444 r8510  
    3333     * @return A list with all the cells the way starts or ends
    3434     */
    35     public static List<List<Way>> getWaysInCell(Way w, Map<Point2D,List<Way>> cellWays) {
     35    public static List<List<Way>> getWaysInCell(Way w, Map<Point2D, List<Way>> cellWays) {
    3636        if (w.getNodesCount() == 0)
    3737            return Collections.emptyList();
Note: See TracChangeset for help on using the changeset viewer.