Ignore:
Timestamp:
2014-04-26T17:39:23+02:00 (12 years ago)
Author:
Don-vip
Message:

see #8465 - use diamond operator where applicable

File:
1 edited

Legend:

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

    r6863 r7005  
    6565    }
    6666
    67     private static Collection<TaggingPreset> relationpresets = new LinkedList<TaggingPreset>();
     67    private static Collection<TaggingPreset> relationpresets = new LinkedList<>();
    6868
    6969    /**
     
    8787    private static class RoleInfo {
    8888        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<>();
    9393    }
    9494
     
    9696    @Override
    9797    public void visit(Relation n) {
    98         LinkedList<Role> allroles = new LinkedList<Role>();
     98        LinkedList<Role> allroles = new LinkedList<>();
    9999        for (TaggingPreset p : relationpresets) {
    100100            boolean matches = true;
     
    124124                    RELATION_UNKNOWN, n) );
    125125        } else {
    126             HashMap<String,RoleInfo> map = new HashMap<String, RoleInfo>();
     126            HashMap<String,RoleInfo> map = new HashMap<>();
    127127            for (RelationMember m : n.getMembers()) {
    128128                String s = "";
     
    152152                        RELATION_EMPTY, n) );
    153153            } else {
    154                 LinkedList<String> done = new LinkedList<String>();
     154                LinkedList<String> done = new LinkedList<>();
    155155                for (Role r : allroles) {
    156156                    done.add(r.key);
     
    180180                    if (ri != null) {
    181181                        if (r.types != null) {
    182                             Set<OsmPrimitive> wrongTypes = new HashSet<OsmPrimitive>();
     182                            Set<OsmPrimitive> wrongTypes = new HashSet<>();
    183183                            if (!r.types.contains(TaggingPresetType.WAY)) {
    184184                                wrongTypes.addAll(r.types.contains(TaggingPresetType.CLOSEDWAY) ? ri.openways : ri.ways);
     
    192192                            if (!wrongTypes.isEmpty()) {
    193193                                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);
    195195                                highlight.addFirst(n);
    196196                                errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
     
    200200                        }
    201201                        if (r.memberExpression != null) {
    202                             Set<OsmPrimitive> notMatching = new HashSet<OsmPrimitive>();
     202                            Set<OsmPrimitive> notMatching = new HashSet<>();
    203203                            for (Collection<OsmPrimitive> c : Arrays.asList(new Collection[]{ri.nodes, ri.ways, ri.relations})) {
    204204                                for (OsmPrimitive p : c) {
     
    210210                            if (!notMatching.isEmpty()) {
    211211                                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);
    213213                                highlight.addFirst(n);
    214214                                errors.add(new TestError(this, Severity.WARNING, ROLE_VERIF_PROBLEM_MSG,
Note: See TracChangeset for help on using the changeset viewer.