Changeset 10593 in josm


Ignore:
Timestamp:
2016-07-23T00:26:24+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11390 - sonar - squid:S2293 - improved use of diamond operator thanks to Java 8 (JEP 101: http://openjdk.java.net/jeps/101)

Location:
trunk/src/org/openstreetmap/josm
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java

    r10469 r10593  
    940940        }
    941941        if (existing != null)
    942             return new ArrayList<Collection<String>>(existing.getValue());
     942            return new ArrayList<>(existing.getValue());
    943943        else
    944             return defaults.getValue() == null ? null : new ArrayList<Collection<String>>(defaults.getValue());
     944            return defaults.getValue() == null ? null : new ArrayList<>(defaults.getValue());
    945945    }
    946946
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java

    r10378 r10593  
    156156        mode = Mode.RESOLVING_ONE_TAGCOLLECTION_ONLY;
    157157        tagsForAllPrimitives = tagsForAllPrimitives == null ? new TagCollection() : tagsForAllPrimitives;
    158         sourceStatistics = sourceStatistics == null ? new HashMap<OsmPrimitiveType, Integer>() : sourceStatistics;
    159         targetStatistics = targetStatistics == null ? new HashMap<OsmPrimitiveType, Integer>() : targetStatistics;
     158        sourceStatistics = sourceStatistics == null ? new HashMap<>() : sourceStatistics;
     159        targetStatistics = targetStatistics == null ? new HashMap<>() : targetStatistics;
    160160
    161161        // init the resolver
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java

    r10217 r10593  
    162162        decisions.clear();
    163163        relations = relations == null ? Collections.<Relation>emptyList() : relations;
    164         memberPrimitives = memberPrimitives == null ? new LinkedList<OsmPrimitive>() : memberPrimitives;
     164        memberPrimitives = memberPrimitives == null ? new LinkedList<>() : memberPrimitives;
    165165        for (Relation r : relations) {
    166166            for (OsmPrimitive p: memberPrimitives) {
     
    180180     */
    181181    public void populate(Collection<RelationToChildReference> references) {
    182         references = references == null ? new LinkedList<RelationToChildReference>() : references;
     182        references = references == null ? new LinkedList<>() : references;
    183183        decisions.clear();
    184184        this.relations = new HashSet<>(references.size());
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java

    r10217 r10593  
    133133        this.tags = tags;
    134134        displayedKeys = new ArrayList<>();
    135         this.keysWithConflicts = keysWithConflicts == null ? new HashSet<String>() : keysWithConflicts;
     135        this.keysWithConflicts = keysWithConflicts == null ? new HashSet<>() : keysWithConflicts;
    136136        decisions = new HashMap<>();
    137137        rebuild();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r10452 r10593  
    473473            boolean isDblClick = isDoubleClick(e);
    474474
    475             Collection<OsmPrimitive> sel = isDblClick ? new HashSet<OsmPrimitive>(40) : null;
     475            Collection<OsmPrimitive> sel = isDblClick ? new HashSet<>(40) : null;
    476476
    477477            boolean hasFixes = setSelection(sel, isDblClick);
     
    576576        FixTask(Collection<TestError> testErrors) {
    577577            super(tr("Fixing errors ..."), false /* don't ignore exceptions */);
    578             this.testErrors = testErrors == null ? new ArrayList<TestError>() : testErrors;
     578            this.testErrors = testErrors == null ? new ArrayList<>() : testErrors;
    579579        }
    580580
  • trunk/src/org/openstreetmap/josm/gui/preferences/DefaultTabPreferenceSetting.java

    r8510 r10593  
    4242        this.title = title;
    4343        this.tabpane = tabpane;
    44         this.subSettingMap = tabpane != null ? new HashMap<SubPreferenceSetting, Component>() : null;
     44        this.subSettingMap = tabpane != null ? new HashMap<>() : null;
    4545    }
    4646
Note: See TracChangeset for help on using the changeset viewer.