Changeset 9971 in josm


Ignore:
Timestamp:
2016-03-12T23:29:58+01:00 (4 years ago)
Author:
Don-vip
Message:

sonar - use diamond operator when possible (some cases cause compilation failures with Java 9)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/relation/AbstractRelationAction.java

    r9072 r9971  
    2020    protected transient Collection<Relation> relations = Collections.<Relation>emptySet();
    2121
     22    @SuppressWarnings("unused")
    2223    protected static final Collection<Relation> getRelations(Collection<? extends OsmPrimitive> primitives) {
    2324        if (primitives == null || primitives.isEmpty()) {
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r9473 r9971  
    370370
    371371        // Diamond operator does not work with Java 9 here
     372        @SuppressWarnings("unused")
    372373        Set<OsmPrimitive> primitivesToDelete = new HashSet<OsmPrimitive>(selection);
    373374
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java

    r9072 r9971  
    383383        if (!isFixable(testError)) return null;
    384384        // Diamond operator does not work with Java 9 here
     385        @SuppressWarnings("unused")
    385386        Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>(testError.getPrimitives());
    386387        Set<Node> nodes = new LinkedHashSet<>(OsmPrimitive.getFilteredList(sel, Node.class));
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r9920 r9971  
    16151615    @Override
    16161616    public Action[] getMenuEntries() {
    1617         ArrayList<Action> actions = new ArrayList<Action>();
     1617        ArrayList<Action> actions = new ArrayList<>();
    16181618        actions.addAll(Arrays.asList(getLayerListEntries()));
    16191619        actions.addAll(Arrays.asList(getCommonEntries()));
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r9941 r9971  
    146146     */
    147147    public ArrayList<Relation> getRecentRelations() {
    148         ArrayList<Relation> list = new ArrayList<Relation>(recentRelations.keySet());
     148        ArrayList<Relation> list = new ArrayList<>(recentRelations.keySet());
    149149        Collections.reverse(list);
    150150        return list;
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r9954 r9971  
    145145    }
    146146
     147    @SuppressWarnings("unused")
    147148    public static <T> Collection<T> filter(Collection<? extends T> collection, Predicate<? super T> predicate) {
    148149        // Diamond operator does not work with Java 9 here
Note: See TracChangeset for help on using the changeset viewer.