Ignore:
Timestamp:
2014-01-19T12:17:36+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #9588 - group validator role-related error messages in the same category

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

Legend:

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

    r6622 r6731  
    55
    66import java.awt.geom.GeneralPath;
     7import java.text.MessageFormat;
    78import java.util.ArrayList;
    89import java.util.Arrays;
     
    191192                        final String roleInNewMP = memberInNewMP.iterator().next().getRole();
    192193                        if (!member.getRole().equals(roleInNewMP)) {
    193                             addError(r, new TestError(this, Severity.WARNING, tr("Role for ''{0}'' should be ''{1}''",
    194                                     member.getMember().getDisplayName(DefaultNameFormatter.getInstance()), roleInNewMP),
     194                            addError(r, new TestError(this, Severity.WARNING, RelationChecker.ROLE_VERIF_PROBLEM_MSG,
     195                                    tr("Role for ''{0}'' should be ''{1}''",
     196                                            member.getMember().getDisplayName(DefaultNameFormatter.getInstance()), roleInNewMP),
     197                                    MessageFormat.format("Role for ''{0}'' should be ''{1}''",
     198                                            member.getMember().getDisplayName(DefaultNameFormatter.getInstance()), roleInNewMP),
    195199                                    WRONG_MEMBER_ROLE, Collections.singleton(r), Collections.singleton(member.getMember())));
    196200                        }
    197201                    }
    198202                }
    199 
    200203            }
    201204
  • trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java

    r6241 r6731  
    4545    protected static final int RELATION_UNKNOWN  = 1707;
    4646    protected static final int RELATION_EMPTY    = 1708;
     47   
     48    /**
     49     * Error message used to group errors related to role problems.
     50     * @since 6731
     51     */
     52    public static final String ROLE_VERIF_PROBLEM_MSG = tr("Role verification problem");
    4753
    4854    /**
     
    142148            } else {
    143149                LinkedList<String> done = new LinkedList<String>();
    144                 String errorMessage = tr("Role verification problem");
    145150                for (Role r : allroles) {
    146151                    done.add(r.key);
     
    155160                        if (count == 0) {
    156161                            String s = marktr("Role {0} missing");
    157                             errors.add(new TestError(this, Severity.WARNING, errorMessage,
     162                            errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
    158163                                    tr(s, keyname), MessageFormat.format(s, keyname), ROLE_MISSING, n));
    159164                        }
    160165                        else if (vc > count) {
    161166                            String s = marktr("Number of {0} roles too low ({1})");
    162                             errors.add(new TestError(this, Severity.WARNING, errorMessage,
     167                            errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
    163168                                    tr(s, keyname, count), MessageFormat.format(s, keyname, count), LOW_COUNT, n));
    164169                        } else {
    165170                            String s = marktr("Number of {0} roles too high ({1})");
    166                             errors.add(new TestError(this, Severity.WARNING, errorMessage,
     171                            errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
    167172                                    tr(s, keyname, count), MessageFormat.format(s, keyname, count), HIGH_COUNT, n));
    168173                        }
     
    194199                            LinkedList<OsmPrimitive> highlight = new LinkedList<OsmPrimitive>(wrongTypes);
    195200                            highlight.addFirst(n);
    196                             errors.add(new TestError(this, Severity.WARNING, errorMessage,
     201                            errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
    197202                                    tr(s, keyname), MessageFormat.format(s, keyname), WRONG_TYPE,
    198203                                    highlight, wrongTypes));
     
    204209                        if (key.length() > 0) {
    205210                            String s = marktr("Role {0} unknown");
    206                             errors.add(new TestError(this, Severity.WARNING, errorMessage,
     211                            errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
    207212                                    tr(s, key), MessageFormat.format(s, key), ROLE_UNKNOWN, n));
    208213                        } else {
    209214                            String s = marktr("Empty role found");
    210                             errors.add(new TestError(this, Severity.WARNING, errorMessage,
     215                            errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
    211216                                    tr(s), s, ROLE_EMPTY, n));
    212217                        }
Note: See TracChangeset for help on using the changeset viewer.