Ignore:
Timestamp:
2014-10-18T23:07:52+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix Java 7 / unused code warnings

Location:
applications/editors/josm/plugins/reverter/src/reverter
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reverter/src/reverter/ChangesetIdQuery.java

    r29353 r30737  
    145145     */
    146146    protected void restoreChangesetsHistory(HistoryComboBox cbHistory) {
    147         List<String> cmtHistory = new LinkedList<String>(Main.pref.getCollection(getClass().getName() + ".changesetsHistory", new LinkedList<String>()));
     147        List<String> cmtHistory = new LinkedList<>(Main.pref.getCollection(getClass().getName() + ".changesetsHistory", new LinkedList<String>()));
    148148        // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    149149        Collections.reverse(cmtHistory);
  • applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java

    r30307 r30737  
    7070    private DataSet nds; // Dataset that contains new objects downloaded by reverter
    7171
    72     private final HashSet<PrimitiveId> missing = new HashSet<PrimitiveId>();
    73 
    74     private final HashSet<HistoryOsmPrimitive> created = new HashSet<HistoryOsmPrimitive>();
    75     private final HashSet<HistoryOsmPrimitive> updated = new HashSet<HistoryOsmPrimitive>();
    76     private final HashSet<HistoryOsmPrimitive> deleted = new HashSet<HistoryOsmPrimitive>();
     72    private final HashSet<PrimitiveId> missing = new HashSet<>();
     73
     74    private final HashSet<HistoryOsmPrimitive> created = new HashSet<>();
     75    private final HashSet<HistoryOsmPrimitive> updated = new HashSet<>();
     76    private final HashSet<HistoryOsmPrimitive> deleted = new HashSet<>();
    7777
    7878    //// Handling missing objects
     
    280280        switch (p.getType()) {
    281281        case NODE:
    282             return new Conflict<Node>((Node)p,new Node((Node)p), isMyDeleted);
     282            return new Conflict<>((Node)p,new Node((Node)p), isMyDeleted);
    283283        case CLOSEDWAY:
    284284        case WAY:
    285             return new Conflict<Way>((Way)p,new Way((Way)p), isMyDeleted);
     285            return new Conflict<>((Way)p,new Way((Way)p), isMyDeleted);
    286286        case MULTIPOLYGON:
    287287        case RELATION:
    288             return new Conflict<Relation>((Relation)p,new Relation((Relation)p), isMyDeleted);
     288            return new Conflict<>((Relation)p,new Relation((Relation)p), isMyDeleted);
    289289        default: throw new AssertionError();
    290290        }
     
    348348        // Create a set of objects to be deleted
    349349
    350         HashSet<OsmPrimitive> toDelete = new HashSet<OsmPrimitive>();
     350        HashSet<OsmPrimitive> toDelete = new HashSet<>();
    351351        // Mark objects that has visible=false to be deleted
    352352        for (OsmPrimitive p : nds.allPrimitives()) {
     
    365365        // Check reversion against current dataset and create necessary conflicts
    366366
    367         HashSet<OsmPrimitive> conflicted = new HashSet<OsmPrimitive>();
     367        HashSet<OsmPrimitive> conflicted = new HashSet<>();
    368368
    369369        for (Conflict<? extends OsmPrimitive> conflict : merger.getConflicts()) {
  • applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java

    r30008 r30737  
    3333    private final DataSet targetDataSet;
    3434
    35     private final List<Command> cmds = new LinkedList<Command>();
    36     private final List<OsmPrimitive> nominalRevertedPrimitives = new LinkedList<OsmPrimitive>();
     35    private final List<Command> cmds = new LinkedList<>();
     36    private final List<OsmPrimitive> nominalRevertedPrimitives = new LinkedList<>();
    3737
    3838    /**
     
    9898        Way target = (Way)getMergeTarget(source);
    9999       
    100         Collection<Conflict<OsmPrimitive>> localConflicts = new ArrayList<Conflict<OsmPrimitive>>();
     100        Collection<Conflict<OsmPrimitive>> localConflicts = new ArrayList<>();
    101101
    102         List<Node> newNodes = new ArrayList<Node>(source.getNodesCount());
     102        List<Node> newNodes = new ArrayList<>(source.getNodesCount());
    103103        for (Node sourceNode : source.getNodes()) {
    104104            Node targetNode = (Node)getMergeTarget(sourceNode);
     
    142142        if (!source.isVisible()) return;
    143143        Relation target = (Relation) getMergeTarget(source);
    144         LinkedList<RelationMember> newMembers = new LinkedList<RelationMember>();
     144        LinkedList<RelationMember> newMembers = new LinkedList<>();
    145145        for (RelationMember sourceMember : source.getMembers()) {
    146146            OsmPrimitive targetMember = getMergeTarget(sourceMember.getMember());
    147147            if (targetMember.isDeleted() && sourceMember.getMember().isIncomplete()
    148148                    && !conflicts.hasConflictForMy(targetMember)) {
    149                 conflicts.add(new Conflict<OsmPrimitive>(targetMember, sourceMember.getMember(), true));
     149                conflicts.add(new Conflict<>(targetMember, sourceMember.getMember(), true));
    150150                OsmPrimitive undeletedTargetMember;
    151151                switch(targetMember.getType()) {
  • applications/editors/josm/plugins/reverter/src/reverter/corehacks/ChangesetDataSet.java

    r23273 r30737  
    3030    }
    3131
    32     final private Map<PrimitiveId, Integer> earliestVersions = new HashMap<PrimitiveId, Integer>();
    33     final private Map<PrimitiveId, HistoryOsmPrimitive> primitives = new HashMap<PrimitiveId, HistoryOsmPrimitive>();
    34     final private Map<PrimitiveId, ChangesetModificationType> modificationTypes = new HashMap<PrimitiveId, ChangesetModificationType>();
     32    final private Map<PrimitiveId, Integer> earliestVersions = new HashMap<>();
     33    final private Map<PrimitiveId, HistoryOsmPrimitive> primitives = new HashMap<>();
     34    final private Map<PrimitiveId, ChangesetModificationType> modificationTypes = new HashMap<>();
    3535
    3636    /**
     
    145145    public Set<HistoryOsmPrimitive> getPrimitivesByModificationType(ChangesetModificationType cmt) throws IllegalArgumentException {
    146146        CheckParameterUtil.ensureParameterNotNull(cmt,"cmt");
    147         HashSet<HistoryOsmPrimitive> ret = new HashSet<HistoryOsmPrimitive>();
     147        HashSet<HistoryOsmPrimitive> ret = new HashSet<>();
    148148        for (Entry<PrimitiveId, ChangesetModificationType> entry: modificationTypes.entrySet()) {
    149149            if (entry.getValue().equals(cmt)) {
  • applications/editors/josm/plugins/reverter/src/reverter/corehacks/OsmServerChangesetReader.java

    r30436 r30737  
    134134            monitor.beginTask(trn("Downloading {0} changeset ...", "Downloading {0} changesets ...",ids.size(),ids.size()));
    135135            monitor.setTicksCount(ids.size());
    136             List<Changeset> ret = new ArrayList<Changeset>();
     136            List<Changeset> ret = new ArrayList<>();
    137137            int i=0;
    138138            for (Iterator<Integer> it = ids.iterator(); it.hasNext(); ) {
Note: See TracChangeset for help on using the changeset viewer.