Changeset 11132 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
r11128 r11132 15 15 import java.util.Map; 16 16 import java.util.Set; 17 import java.util.TreeMap; 17 18 import java.util.function.Predicate; 18 19 import java.util.stream.Collectors; … … 34 35 import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; 35 36 import org.openstreetmap.josm.gui.util.GuiHelper; 37 import org.openstreetmap.josm.tools.AlphanumComparator; 36 38 import org.openstreetmap.josm.tools.Destroyable; 37 39 import org.openstreetmap.josm.tools.ListenerList; … … 180 182 = errors.stream().filter(filterToUse).collect( 181 183 Collectors.groupingBy(TestError::getSeverity, () -> new EnumMap<>(Severity.class), 182 Collectors.groupingBy(TestError::getMessage, 183 Collectors.groupingBy(e -> e.getDescription() == null ? "" : e.getDescription() 184 Collectors.groupingBy(TestError::getMessage, () -> new TreeMap<>(AlphanumComparator.getInstance()), 185 Collectors.groupingBy(e -> e.getDescription() == null ? "" : e.getDescription(), 186 () -> new TreeMap<>(AlphanumComparator.getInstance()), 187 Collectors.toList() 184 188 )))); 185 189 … … 230 234 if (groupNode != null) { 231 235 msg = tr("{0} ({1})", description, errors.size()); 236 } else if (description == null || description.isEmpty()) { 237 msg = tr("{0} ({1})", message, errors.size()); 232 238 } else { 233 239 msg = tr("{0} - {1} ({2})", message, description, errors.size()); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanelTest.java
r11129 r11132 9 9 import java.util.Arrays; 10 10 import java.util.Collections; 11 import java.util.Enumeration; 11 12 import java.util.HashSet; 12 13 import java.util.Set; … … 47 48 .build(), 48 49 TestError.builder(null, Severity.WARNING, 0) 49 .message("warn") 50 .message("warn", "foo") 51 .primitives(new Node(2)) 52 .build(), 53 TestError.builder(null, Severity.WARNING, 0) 54 .message("warn", "bar") 50 55 .primitives(new Node(2)) 51 56 .build()))); 52 57 assertNotNull(vtp); 53 assertEquals(2, vtp.getErrors().size()); 58 final Enumeration nodes = vtp.getRoot().breadthFirstEnumeration(); 59 assertEquals("", nodes.nextElement().toString()); 60 assertEquals("Errors (1)", nodes.nextElement().toString()); 61 assertEquals("Warnings (2)", nodes.nextElement().toString()); 62 assertEquals("err (1)", nodes.nextElement().toString()); 63 assertEquals("warn (2)", nodes.nextElement().toString()); 64 nodes.nextElement(); 65 assertEquals("bar (1)", nodes.nextElement().toString()); 66 assertEquals("foo (1)", nodes.nextElement().toString()); 54 67 vtp.setVisible(true); 55 68 vtp.setVisible(false);
Note:
See TracChangeset
for help on using the changeset viewer.