Changeset 30737 in osm for applications/editors/josm/plugins/reverter
- Timestamp:
- 2014-10-18T23:07:52+02:00 (10 years ago)
- 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 145 145 */ 146 146 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>())); 148 148 // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement() 149 149 Collections.reverse(cmtHistory); -
applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java
r30307 r30737 70 70 private DataSet nds; // Dataset that contains new objects downloaded by reverter 71 71 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<>(); 77 77 78 78 //// Handling missing objects … … 280 280 switch (p.getType()) { 281 281 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); 283 283 case CLOSEDWAY: 284 284 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); 286 286 case MULTIPOLYGON: 287 287 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); 289 289 default: throw new AssertionError(); 290 290 } … … 348 348 // Create a set of objects to be deleted 349 349 350 HashSet<OsmPrimitive> toDelete = new HashSet< OsmPrimitive>();350 HashSet<OsmPrimitive> toDelete = new HashSet<>(); 351 351 // Mark objects that has visible=false to be deleted 352 352 for (OsmPrimitive p : nds.allPrimitives()) { … … 365 365 // Check reversion against current dataset and create necessary conflicts 366 366 367 HashSet<OsmPrimitive> conflicted = new HashSet< OsmPrimitive>();367 HashSet<OsmPrimitive> conflicted = new HashSet<>(); 368 368 369 369 for (Conflict<? extends OsmPrimitive> conflict : merger.getConflicts()) { -
applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java
r30008 r30737 33 33 private final DataSet targetDataSet; 34 34 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<>(); 37 37 38 38 /** … … 98 98 Way target = (Way)getMergeTarget(source); 99 99 100 Collection<Conflict<OsmPrimitive>> localConflicts = new ArrayList< Conflict<OsmPrimitive>>();100 Collection<Conflict<OsmPrimitive>> localConflicts = new ArrayList<>(); 101 101 102 List<Node> newNodes = new ArrayList< Node>(source.getNodesCount());102 List<Node> newNodes = new ArrayList<>(source.getNodesCount()); 103 103 for (Node sourceNode : source.getNodes()) { 104 104 Node targetNode = (Node)getMergeTarget(sourceNode); … … 142 142 if (!source.isVisible()) return; 143 143 Relation target = (Relation) getMergeTarget(source); 144 LinkedList<RelationMember> newMembers = new LinkedList< RelationMember>();144 LinkedList<RelationMember> newMembers = new LinkedList<>(); 145 145 for (RelationMember sourceMember : source.getMembers()) { 146 146 OsmPrimitive targetMember = getMergeTarget(sourceMember.getMember()); 147 147 if (targetMember.isDeleted() && sourceMember.getMember().isIncomplete() 148 148 && !conflicts.hasConflictForMy(targetMember)) { 149 conflicts.add(new Conflict< OsmPrimitive>(targetMember, sourceMember.getMember(), true));149 conflicts.add(new Conflict<>(targetMember, sourceMember.getMember(), true)); 150 150 OsmPrimitive undeletedTargetMember; 151 151 switch(targetMember.getType()) { -
applications/editors/josm/plugins/reverter/src/reverter/corehacks/ChangesetDataSet.java
r23273 r30737 30 30 } 31 31 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<>(); 35 35 36 36 /** … … 145 145 public Set<HistoryOsmPrimitive> getPrimitivesByModificationType(ChangesetModificationType cmt) throws IllegalArgumentException { 146 146 CheckParameterUtil.ensureParameterNotNull(cmt,"cmt"); 147 HashSet<HistoryOsmPrimitive> ret = new HashSet< HistoryOsmPrimitive>();147 HashSet<HistoryOsmPrimitive> ret = new HashSet<>(); 148 148 for (Entry<PrimitiveId, ChangesetModificationType> entry: modificationTypes.entrySet()) { 149 149 if (entry.getValue().equals(cmt)) { -
applications/editors/josm/plugins/reverter/src/reverter/corehacks/OsmServerChangesetReader.java
r30436 r30737 134 134 monitor.beginTask(trn("Downloading {0} changeset ...", "Downloading {0} changesets ...",ids.size(),ids.size())); 135 135 monitor.setTicksCount(ids.size()); 136 List<Changeset> ret = new ArrayList< Changeset>();136 List<Changeset> ret = new ArrayList<>(); 137 137 int i=0; 138 138 for (Iterator<Integer> it = ids.iterator(); it.hasNext(); ) {
Note:
See TracChangeset
for help on using the changeset viewer.