Changeset 3673 in josm for trunk


Ignore:
Timestamp:
2010-11-25T13:01:58+01:00 (13 years ago)
Author:
bastiK
Message:

(hopefully) fix some coding errors

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

Legend:

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

    r3671 r3673  
    8181        for (int i=1; i<nodes.size(); i++) {
    8282            Node n = nodes.get(i);
    83             result.lineTo((float )n.getCoor().lat(), (float) n.getCoor().lon());
     83            result.lineTo((float) n.getCoor().lat(), (float) n.getCoor().lon());
    8484        }
    8585        return result;
  • trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java

    r3671 r3673  
    135135                    done.add(r.key);
    136136                    String keyname = r.key;
    137                     if (keyname == "") { //FIXME
     137                    if ("".equals(keyname)) {
    138138                        keyname = tr("<empty>");
    139139                    }
     
    144144                        if (count == 0) {
    145145                            String s = marktr("Role {0} missing");
    146                             errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"),
    147                                     tr(s, keyname), MessageFormat.format(s, keyname), ROLE_MISSING, n) );
     146                            errors.add(new TestError(this, Severity.WARNING, tr("Role verification problem"),
     147                                    tr(s, keyname), MessageFormat.format(s, keyname), ROLE_MISSING, n));
    148148                        }
    149149                        else if (vc > count) {
    150150                            String s = marktr("Number of {0} roles too low ({1})");
    151                             errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"),
    152                                     tr(s, keyname, count), MessageFormat.format(s, keyname, count), LOW_COUNT, n) );
     151                            errors.add(new TestError(this, Severity.WARNING, tr("Role verification problem"),
     152                                    tr(s, keyname, count), MessageFormat.format(s, keyname, count), LOW_COUNT, n));
    153153                        } else {
    154154                            String s = marktr("Number of {0} roles too high ({1})");
    155                             errors.add( new TestError(this, Severity.WARNING, tr("Role verification problem"),
    156                                     tr(s, keyname, count), MessageFormat.format(s, keyname, count), HIGH_COUNT, n) );
     155                            errors.add(new TestError(this, Severity.WARNING, tr("Role verification problem"),
     156                                    tr(s, keyname, count), MessageFormat.format(s, keyname, count), HIGH_COUNT, n));
    157157                        }
    158158                    }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r3671 r3673  
    836836            public boolean valueAll = false;
    837837            public boolean valueBool = false;
     838
    838839            private Pattern getPattern(String str) throws IllegalStateException, PatternSyntaxException {
    839840                if (str.endsWith("/i"))
     
    850851                String n = m.group(1).trim();
    851852
    852                 // FIXME FIXME: indentation and { } pairs don't match, probably coding error
    853 
    854                 if(n.equals("*"))
     853                if(n.equals("*")) {
    855854                    tagAll = true;
    856                 else
     855                } else {
    857856                    tag = n.startsWith("/") ? getPattern(n) : n;
    858857                    noMatch = m.group(2).equals("!=");
    859858                    n = m.group(3).trim();
    860                     if(n.equals("*"))
     859                    if (n.equals("*")) {
    861860                        valueAll = true;
    862                     else if(n.equals("BOOLEAN_TRUE"))
    863                     {
     861                    } else if (n.equals("BOOLEAN_TRUE")) {
    864862                        valueBool = true;
    865863                        value = OsmUtils.trueval;
    866                     }
    867                     else if(n.equals("BOOLEAN_FALSE"))
    868                     {
     864                    } else if (n.equals("BOOLEAN_FALSE")) {
    869865                        valueBool = true;
    870866                        value = OsmUtils.falseval;
    871                     }
    872                     else
     867                    } else {
    873868                        value = n.startsWith("/") ? getPattern(n) : n;
     869                    }
     870                }
    874871            }
    875872
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TurnrestrictionTest.java

    r3671 r3673  
    136136                errors.add(new TestError(this, Severity.ERROR,
    137137                        tr("The \"to\" way does not start or end at a \"via\" node"), TO_VIA_NODE, r));
    138                 //FIXME: return; ?
     138                return;
    139139            }
    140140        } else {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/WronglyOrderedWays.java

    r3671 r3673  
    8383         *
    8484         */
    85         if(w.getNode(0) == w.getNode(w.getNodesCount()-1)) {
     85        if (w.getNode(0) == w.getNode(w.getNodesCount()-1)) {
    8686            double area2 = 0;
    8787
Note: See TracChangeset for help on using the changeset viewer.