Changeset 6731 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2014-01-19T12:17:36+01:00 (11 years ago)
- 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 5 5 6 6 import java.awt.geom.GeneralPath; 7 import java.text.MessageFormat; 7 8 import java.util.ArrayList; 8 9 import java.util.Arrays; … … 191 192 final String roleInNewMP = memberInNewMP.iterator().next().getRole(); 192 193 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), 195 199 WRONG_MEMBER_ROLE, Collections.singleton(r), Collections.singleton(member.getMember()))); 196 200 } 197 201 } 198 202 } 199 200 203 } 201 204 -
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r6241 r6731 45 45 protected static final int RELATION_UNKNOWN = 1707; 46 46 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"); 47 53 48 54 /** … … 142 148 } else { 143 149 LinkedList<String> done = new LinkedList<String>(); 144 String errorMessage = tr("Role verification problem");145 150 for (Role r : allroles) { 146 151 done.add(r.key); … … 155 160 if (count == 0) { 156 161 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, 158 163 tr(s, keyname), MessageFormat.format(s, keyname), ROLE_MISSING, n)); 159 164 } 160 165 else if (vc > count) { 161 166 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, 163 168 tr(s, keyname, count), MessageFormat.format(s, keyname, count), LOW_COUNT, n)); 164 169 } else { 165 170 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, 167 172 tr(s, keyname, count), MessageFormat.format(s, keyname, count), HIGH_COUNT, n)); 168 173 } … … 194 199 LinkedList<OsmPrimitive> highlight = new LinkedList<OsmPrimitive>(wrongTypes); 195 200 highlight.addFirst(n); 196 errors.add(new TestError(this, Severity.WARNING, errorMessage,201 errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG, 197 202 tr(s, keyname), MessageFormat.format(s, keyname), WRONG_TYPE, 198 203 highlight, wrongTypes)); … … 204 209 if (key.length() > 0) { 205 210 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, 207 212 tr(s, key), MessageFormat.format(s, key), ROLE_UNKNOWN, n)); 208 213 } else { 209 214 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, 211 216 tr(s), s, ROLE_EMPTY, n)); 212 217 }
Note:
See TracChangeset
for help on using the changeset viewer.