Changeset 35084 in osm for applications
- Timestamp:
- 2019-08-11T18:00:56+02:00 (5 years ago)
- Location:
- applications/editors/josm/plugins/reverter
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/build.xml
r35082 r35084 2 2 <project name="reverter" default="dist" basedir="."> 3 3 <!-- enter the SVN commit message --> 4 <property name="commit.message" value="Reverter: fix possible NPE"/>4 <property name="commit.message" value="Reverter: fix deleted/redacted relation members"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 6 <property name="plugin.main.version" value="14946"/> -
applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java
r34953 r35084 50 50 51 51 private void addChangeCommandIfNotEquals(OsmPrimitive target, OsmPrimitive newTarget, boolean nominal) { 52 if (!target.hasEqualSemanticAttributes(newTarget) ) {52 if (!target.hasEqualSemanticAttributes(newTarget) || target.isDeleted() != newTarget.isDeleted() || target.isVisible() != newTarget.isVisible()) { 53 53 cmds.add(new ChangeCommand(target, newTarget)); 54 54 if (nominal) { … … 149 149 for (RelationMember sourceMember : source.getMembers()) { 150 150 OsmPrimitive targetMember = getMergeTarget(sourceMember.getMember()); 151 if (targetMember.isDeleted() && sourceMember.getMember().isIncomplete() 152 && !conflicts.hasConflictForMy(targetMember)) { 153 conflicts.add(new Conflict<>(targetMember, sourceMember.getMember(), true)); 154 OsmPrimitive undeletedTargetMember; 155 switch(targetMember.getType()) { 156 case NODE: undeletedTargetMember = new Node((Node) targetMember); break; 157 case WAY: undeletedTargetMember = new Way((Way) targetMember); break; 158 case RELATION: undeletedTargetMember = new Relation((Relation) targetMember); break; 159 default: throw new AssertionError(); 151 if (!targetMember.isDeleted() || nominalRevertedPrimitives.contains(targetMember)) { 152 newMembers.add(new RelationMember(sourceMember.getRole(), targetMember)); 153 } else { 154 if (!sourceMember.getMember().isIncomplete() && !conflicts.hasConflictForMy(targetMember)) { 155 conflicts.add(new Conflict<>(targetMember, sourceMember.getMember(), true)); 156 OsmPrimitive undeletedTargetMember; 157 switch(targetMember.getType()) { 158 case NODE: undeletedTargetMember = new Node((Node) sourceMember.getMember()); break; 159 case WAY: undeletedTargetMember = new Way((Way) sourceMember.getMember()); break; 160 case RELATION: undeletedTargetMember = new Relation((Relation) sourceMember.getMember()); break; 161 default: throw new AssertionError(); 162 } 163 undeletedTargetMember.setDeleted(false); 164 addChangeCommandIfNotEquals(targetMember, undeletedTargetMember, false); 165 newMembers.add(new RelationMember(sourceMember.getRole(), targetMember)); 166 } else { 167 Logging.info("Skipping target relation member "+targetMember+" for source member "+sourceMember.getMember()+" while reverting relation "+source); 160 168 } 161 undeletedTargetMember.setDeleted(false); 162 addChangeCommandIfNotEquals(targetMember, undeletedTargetMember, false); 163 } 164 newMembers.add(new RelationMember(sourceMember.getRole(), targetMember)); 169 } 165 170 } 166 171 Relation newRelation = new Relation(target); -
applications/editors/josm/plugins/reverter/src/reverter/OsmServerMultiObjectReader.java
r35078 r35084 90 90 rdr.addData(in); 91 91 } catch (IOException | IllegalDataException | OsmTransferException e) { 92 Logging. error(e);92 Logging.warn(e); 93 93 } finally { 94 94 rdr.callback = null;
Note:
See TracChangeset
for help on using the changeset viewer.