Changeset 7005 in josm for trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
- Timestamp:
- 2014-04-26T17:39:23+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/RelationChecker.java
r6863 r7005 65 65 } 66 66 67 private static Collection<TaggingPreset> relationpresets = new LinkedList< TaggingPreset>();67 private static Collection<TaggingPreset> relationpresets = new LinkedList<>(); 68 68 69 69 /** … … 87 87 private static class RoleInfo { 88 88 private int total = 0; 89 private Collection<Node> nodes = new LinkedList< Node>();90 private Collection<Way> ways = new LinkedList< Way>();91 private Collection<Way> openways = new LinkedList< Way>();92 private Collection<Relation> relations = new LinkedList< Relation>();89 private Collection<Node> nodes = new LinkedList<>(); 90 private Collection<Way> ways = new LinkedList<>(); 91 private Collection<Way> openways = new LinkedList<>(); 92 private Collection<Relation> relations = new LinkedList<>(); 93 93 } 94 94 … … 96 96 @Override 97 97 public void visit(Relation n) { 98 LinkedList<Role> allroles = new LinkedList< Role>();98 LinkedList<Role> allroles = new LinkedList<>(); 99 99 for (TaggingPreset p : relationpresets) { 100 100 boolean matches = true; … … 124 124 RELATION_UNKNOWN, n) ); 125 125 } else { 126 HashMap<String,RoleInfo> map = new HashMap< String, RoleInfo>();126 HashMap<String,RoleInfo> map = new HashMap<>(); 127 127 for (RelationMember m : n.getMembers()) { 128 128 String s = ""; … … 152 152 RELATION_EMPTY, n) ); 153 153 } else { 154 LinkedList<String> done = new LinkedList< String>();154 LinkedList<String> done = new LinkedList<>(); 155 155 for (Role r : allroles) { 156 156 done.add(r.key); … … 180 180 if (ri != null) { 181 181 if (r.types != null) { 182 Set<OsmPrimitive> wrongTypes = new HashSet< OsmPrimitive>();182 Set<OsmPrimitive> wrongTypes = new HashSet<>(); 183 183 if (!r.types.contains(TaggingPresetType.WAY)) { 184 184 wrongTypes.addAll(r.types.contains(TaggingPresetType.CLOSEDWAY) ? ri.openways : ri.ways); … … 192 192 if (!wrongTypes.isEmpty()) { 193 193 String s = marktr("Member for role {0} of wrong type"); 194 LinkedList<OsmPrimitive> highlight = new LinkedList< OsmPrimitive>(wrongTypes);194 LinkedList<OsmPrimitive> highlight = new LinkedList<>(wrongTypes); 195 195 highlight.addFirst(n); 196 196 errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG, … … 200 200 } 201 201 if (r.memberExpression != null) { 202 Set<OsmPrimitive> notMatching = new HashSet< OsmPrimitive>();202 Set<OsmPrimitive> notMatching = new HashSet<>(); 203 203 for (Collection<OsmPrimitive> c : Arrays.asList(new Collection[]{ri.nodes, ri.ways, ri.relations})) { 204 204 for (OsmPrimitive p : c) { … … 210 210 if (!notMatching.isEmpty()) { 211 211 String s = marktr("Member for role ''{0}'' does not match ''{1}''"); 212 LinkedList<OsmPrimitive> highlight = new LinkedList< OsmPrimitive>(notMatching);212 LinkedList<OsmPrimitive> highlight = new LinkedList<>(notMatching); 213 213 highlight.addFirst(n); 214 214 errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
Note:
See TracChangeset
for help on using the changeset viewer.
