Changeset 23273 in osm
- Timestamp:
- 2010-09-19T19:27:21+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/reverter
- Files:
-
- 4 added
- 3 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/build.xml
r22533 r23273 31 31 32 32 <!-- enter the SVN commit message --> 33 <property name="commit.message" value=" update to josm latest" />33 <property name="commit.message" value="fix #j5160, update MultiOsmReader, some refactoring, some small bugfixes" /> 34 34 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 35 35 <property name="plugin.main.version" value="3403" /> -
applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java
r23192 r23273 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.util.Collections; 5 6 import java.util.HashSet; 6 7 import java.util.Iterator; … … 15 16 import org.openstreetmap.josm.data.coor.LatLon; 16 17 import org.openstreetmap.josm.data.osm.Changeset; 17 import org.openstreetmap.josm.data.osm.ChangesetDataSet;18 18 import org.openstreetmap.josm.data.osm.DataSet; 19 19 import org.openstreetmap.josm.data.osm.Node; … … 24 24 import org.openstreetmap.josm.data.osm.SimplePrimitiveId; 25 25 import org.openstreetmap.josm.data.osm.Way; 26 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetDataSetEntry;27 import org.openstreetmap.josm.data.osm.ChangesetDataSet.ChangesetModificationType;28 26 import org.openstreetmap.josm.data.osm.history.HistoryNode; 29 27 import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive; … … 34 32 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 35 33 import org.openstreetmap.josm.io.MultiFetchServerObjectReader; 36 import org.openstreetmap.josm.io.OsmServerChangesetReader;37 34 import org.openstreetmap.josm.io.OsmTransferException; 35 36 import reverter.corehacks.ChangesetDataSet; 37 import reverter.corehacks.OsmServerChangesetReader; 38 import reverter.corehacks.ChangesetDataSet.ChangesetDataSetEntry; 39 import reverter.corehacks.ChangesetDataSet.ChangesetModificationType; 38 40 39 41 /** … … 167 169 try { 168 170 for (HistoryOsmPrimitive entry : updated) { 169 rdr.ReadObject(entry.getPrimitiveId(), (int)entry.getVersion()-1,171 rdr.ReadObject(entry.getPrimitiveId(), cds.getEarliestVersion(entry.getPrimitiveId())-1, 170 172 progressMonitor.createSubTaskMonitor(1, true)); 171 173 if (progressMonitor.isCancelled()) return; 172 174 } 173 175 for (HistoryOsmPrimitive entry : deleted) { 174 rdr.ReadObject(entry.getPrimitiveId(), (int)entry.getVersion()-1,176 rdr.ReadObject(entry.getPrimitiveId(), cds.getEarliestVersion(entry.getPrimitiveId())-1, 175 177 progressMonitor.createSubTaskMonitor(1, true)); 176 178 if (progressMonitor.isCancelled()) return; 177 179 } 178 180 nds = rdr.parseOsm(progressMonitor.createSubTaskMonitor(1, true)); 179 addMissingIds(nds.allPrimitives()); 181 for (OsmPrimitive p : nds.allPrimitives()) { 182 if (!p.isIncomplete()) addMissingIds(Collections.singleton(p)); 183 } 180 184 } finally { 181 185 progressMonitor.finishTask(); … … 246 250 RelationMember historyMember = historyMembers.get(i); 247 251 if (!currentMember.getRole().equals(historyMember.getRole())) return false; 248 if ( currentMember.getMember().getPrimitiveId().equals(new SimplePrimitiveId(252 if (!currentMember.getMember().getPrimitiveId().equals(new SimplePrimitiveId( 249 253 historyMember.getPrimitiveId(),historyMember.getPrimitiveType()))) return false; 250 254 } … … 263 267 ////////////////////////////////////////////////////////////////////////// 264 268 // Create commands to restore/update all affected objects 265 DataSet ToCmd merger = new DataSetToCmd(nds,ds);269 DataSetCommandMerger merger = new DataSetCommandMerger(nds,ds); 266 270 LinkedList<Command> cmds = merger.getCommandList(); 267 271 -
applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java
r22411 r23273 23 23 * 24 24 */ 25 final class DataSet ToCmd{25 final class DataSetCommandMerger { 26 26 27 27 /** the collection of conflicts created during merging */ … … 36 36 * constructor 37 37 */ 38 public DataSet ToCmd(DataSet sourceDataSet, DataSet targetDataSet) {38 public DataSetCommandMerger(DataSet sourceDataSet, DataSet targetDataSet) { 39 39 this.sourceDataSet = sourceDataSet; 40 40 this.targetDataSet = targetDataSet; -
applications/editors/josm/plugins/reverter/src/reverter/OsmServerMultiObjectReader.java
r21634 r23273 13 13 import org.openstreetmap.josm.io.OsmTransferException; 14 14 import org.xml.sax.SAXException; 15 16 import reverter.corehacks.MultiOsmReader; 15 17 16 18 public class OsmServerMultiObjectReader extends OsmServerReader { -
applications/editors/josm/plugins/reverter/src/reverter/corehacks/MultiOsmReader.java
r23271 r23273 1 package reverter ;1 package reverter.corehacks; 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; … … 57 57 * The dataset to add parsed objects to. 58 58 */ 59 private DataSet ds = new DataSet();59 private final DataSet ds = new DataSet(); 60 60 61 61 /** … … 97 97 * Data structure for the remaining way objects 98 98 */ 99 private Map<Long, Collection<Long>> ways = new HashMap<Long, Collection<Long>>();99 private final Map<Long, Collection<Long>> ways = new HashMap<Long, Collection<Long>>(); 100 100 101 101 /** 102 102 * Data structure for relation objects 103 103 */ 104 private Map<Long, Collection<RelationMemberData>> relations = new HashMap<Long, Collection<RelationMemberData>>();104 private final Map<Long, Collection<RelationMemberData>> relations = new HashMap<Long, Collection<RelationMemberData>>(); 105 105 106 106 private class Parser extends DefaultHandler { … … 121 121 private long currentExternalId; 122 122 private String generator; 123 private Storage<String> internedStrings = new Storage<String>();123 private final Storage<String> internedStrings = new Storage<String>(); 124 124 125 125 // Memory optimization - see #2312 … … 372 372 } else if (action.equals("delete")) { 373 373 current.setDeleted(true); 374 current.setModified( true);374 current.setModified(current.isVisible()); 375 375 } else if (action.equals("modify")) { 376 376 current.setModified(true);
Note:
See TracChangeset
for help on using the changeset viewer.