[Pkg-osm-commits] [SCM] josm branch, master, updated. debian/0.0.svn5267+dfsg1-2-11-gcc30cb5

David Paleino dapal at debian.org
Wed Oct 10 10:18:44 UTC 2012


The following commit has been merged in the master branch:
commit d5a1efbeed674143119af2df604ecc2b88787ea8
Author: David Paleino <dapal at debian.org>
Date:   Wed Oct 10 10:54:00 2012 +0200

    Patches refreshed to match new upstream code
    
    * Patches refreshed to match new upstream code
    * 07-handle_deleted_nodes_without_coordinates.patch dropped, was
      backported from upstream

diff --git a/debian/changelog b/debian/changelog
index 1b40d78..8017c54 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,8 +9,11 @@ josm (0.0.svn5531+dfsg1-1) UNRELEASED; urgency=low
     - fixed exception when merging multiple layers (Closes: #683186)
   * Don't prefer IPv4 stack anymore in josm wrapper script, since
     it seems to be functional now (Closes: #654515)
+  * Patches refreshed to match new upstream code
+  * 07-handle_deleted_nodes_without_coordinates.patch dropped, was
+    backported from upstream
 
- -- David Paleino <dapal at debian.org>  Wed, 10 Oct 2012 10:42:11 +0200
+ -- David Paleino <dapal at debian.org>  Wed, 10 Oct 2012 10:53:39 +0200
 
 josm (0.0.svn5267+dfsg1-2) unstable; urgency=low
 
diff --git a/debian/patches/00-build.patch b/debian/patches/00-build.patch
index 4a5fd5e..04fa38b 100644
--- a/debian/patches/00-build.patch
+++ b/debian/patches/00-build.patch
@@ -56,7 +56,7 @@ JARs and not depend on Internet connection.
          <tstamp>
              <format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss"/>
          </tstamp>
-@@ -59,31 +59,29 @@
+@@ -60,31 +60,29 @@
  Revision: ${version.entry.commit.revision}
  Is-Local-Build: true
  Build-Date: ${build.tstamp}
@@ -94,9 +94,9 @@ JARs and not depend on Internet connection.
              </manifest>
              <zipfileset dir="images" prefix="images"/>
              <zipfileset dir="data" prefix="data"/>
-@@ -109,25 +107,23 @@ Build-Date: ${build.tstamp}
+@@ -110,21 +108,18 @@ Build-Date: ${build.tstamp}
      </target>
-     <target name="javacc">
+     <target name="javacc" depends="init" unless="javacc.notRequired">
          <mkdir dir="${mapcss.dir}/parsergen"/>
 -        <exec append="false" executable="java" failifexecutionfails="true">
 -            <arg value="-cp"/>
@@ -108,9 +108,9 @@ JARs and not depend on Internet connection.
          </exec>
  <!--        <javacc target="${mapcss.dir}/MapCSSParser.jj" javacchome="${javacc.home}" outputdirectory="${mapcss.dir}/parsergen"/>-->
      </target>
-     <target name="compile" depends="javacc,init">
--        <javac srcdir="src" includes="com/**,oauth/**,org/apache/commons/codec/**" destdir="build" target="1.5" source="1.5" debug="on" encoding="iso-8859-1"/>
--        <javac srcdir="src" excludes="com/**,oauth/**,org/apache/commons/codec/**" destdir="build" target="1.5" source="1.5" debug="on" encoding="UTF-8">
+     <target name="compile" depends="init,javacc">
+-        <javac srcdir="src" includes="com/**,oauth/**,org/apache/commons/codec/**" destdir="build" target="1.6" source="1.6" debug="on" includeantruntime="false" encoding="iso-8859-1"/>
+-        <javac srcdir="src" excludes="com/**,oauth/**,org/apache/commons/codec/**" destdir="build" target="1.6" source="1.6" debug="on" includeantruntime="false" encoding="UTF-8">
 +        <javac srcdir="src" classpathref="classpath" excludes="com/**,oauth/**,org/apache/**" destdir="build" target="1.5" source="1.5" debug="on" encoding="UTF-8">
              <compilerarg value="-Xlint:deprecation"/>
              <compilerarg value="-Xlint:unchecked"/>
@@ -118,13 +118,16 @@ JARs and not depend on Internet connection.
 +        <ant target="build" dir="i18n"/>
      </target>
      <target name="init">
+         <uptodate property="javacc.notRequired" targetfile="${mapcss.dir}/parsergen/MapCSSParser.java" >
+@@ -132,6 +127,7 @@ Build-Date: ${build.tstamp}
+         </uptodate>
          <mkdir dir="build"/>
          <mkdir dir="dist"/>
 +        <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${antcontrib.jar}"/>
      </target>
      <target name="javadoc">
          <javadoc destdir="javadoc" 
-@@ -146,6 +142,7 @@ Build-Date: ${build.tstamp}
+@@ -151,6 +147,7 @@ Build-Date: ${build.tstamp}
          <delete dir="build"/>
          <delete dir="dist"/>
          <delete dir="${mapcss.dir}/parsergen"/>
diff --git a/debian/patches/01-bts.patch b/debian/patches/01-bts.patch
index d64788a..b394609 100644
--- a/debian/patches/01-bts.patch
+++ b/debian/patches/01-bts.patch
@@ -24,7 +24,7 @@ bug triaging.
  import javax.swing.BorderFactory;
  import javax.swing.JLabel;
  import javax.swing.JOptionPane;
-@@ -73,6 +76,8 @@ public class AboutAction extends JosmAct
+@@ -74,6 +77,8 @@ public class AboutAction extends JosmAct
          info.add(GBC.glue(0,10), GBC.eol());
          info.add(new JLabel(tr("Version {0}", version.getVersionString())), GBC.eol().fill(GBC.HORIZONTAL).insets(10,0,0,0));
          info.add(GBC.glue(0,5), GBC.eol());
@@ -33,7 +33,7 @@ bug triaging.
          info.add(new JLabel(tr("Last change at {0}",version.getTime())), GBC.eol().fill(GBC.HORIZONTAL).insets(10,0,0,0));
          info.add(GBC.glue(0,5), GBC.eol());
          info.add(new JLabel(tr("Java Version {0}",System.getProperty("java.version"))), GBC.eol().fill(GBC.HORIZONTAL).insets(10,0,0,0));
-@@ -81,7 +86,7 @@ public class AboutAction extends JosmAct
+@@ -82,7 +87,7 @@ public class AboutAction extends JosmAct
          info.add(new UrlLabel("http://josm.openstreetmap.de",2), GBC.eol().fill(GBC.HORIZONTAL));
          info.add(GBC.glue(0,5), GBC.eol());
          info.add(new JLabel(tr("Bug Reports")), GBC.std().insets(10,0,10,0));
@@ -50,9 +50,9 @@ bug triaging.
      private String releaseDescription;
 +    private String debianVersion;
      private String time;
+     private String buildName;
      private boolean isLocalBuild;
- 
-@@ -115,6 +116,8 @@ public class Version {
+@@ -116,6 +117,8 @@ public class Version {
              version = JOSM_UNKNOWN_VERSION;
          }
  
@@ -61,7 +61,7 @@ bug triaging.
          // the last changed data
          //
          time = properties.get("Last Changed Date");
-@@ -160,6 +163,10 @@ public class Version {
+@@ -169,6 +172,10 @@ public class Version {
          return  version == 0 ? tr("UNKNOWN") : Integer.toString(version);
      }
  
diff --git a/debian/patches/02-elemstyles.patch b/debian/patches/02-elemstyles.patch
index e3a42e3..4e01d43 100644
--- a/debian/patches/02-elemstyles.patch
+++ b/debian/patches/02-elemstyles.patch
@@ -8,13 +8,13 @@ the openstreetmap-map-icons-* packages, so they can be used also by other
 applications. This patch points josm to the shared directories.
 
 ---
- src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java |   11 +++++++---
- src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java   |   13 ++++++++++--
- 2 files changed, 19 insertions(+), 5 deletions(-)
+ src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java |   11 ++++++--
+ src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java   |   15 +++++++++++-
+ 2 files changed, 22 insertions(+), 4 deletions(-)
 
 --- josm.orig/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
 +++ josm/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
-@@ -144,14 +144,19 @@ public class MapPaintStyles {
+@@ -176,14 +176,19 @@ public class MapPaintStyles {
          }
  
          if (Main.pref.getBoolean("mappaint.icon.enable-defaults", true)) {
@@ -39,7 +39,7 @@ applications. This patch points josm to the shared directories.
  
 --- josm.orig/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
 +++ josm/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
-@@ -67,6 +67,7 @@ import org.openstreetmap.josm.gui.QuadSt
+@@ -65,6 +65,7 @@ import org.openstreetmap.josm.gui.QuadSt
  import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
  import org.openstreetmap.josm.gui.layer.Layer;
  import org.openstreetmap.josm.gui.layer.OsmDataLayer;
@@ -47,22 +47,24 @@ applications. This patch points josm to the shared directories.
  import org.openstreetmap.josm.gui.preferences.SourceEntry;
  import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference.PresetPrefHelper;
  import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
-@@ -1243,8 +1244,16 @@ public class TaggingPreset extends Abstr
-                 final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
-                 ImageIcon icon = new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true).get();
-                 if (icon == null) {
--                    System.out.println("Could not get presets icon " + iconName);
--                    icon = new ImageIcon(iconName);
-+                    if (iconName.startsWith("styles/standard/")) {
-+                        String realIconName = iconName.replaceAll("styles/standard/", "");
-+                        LinkedList<String> dirs = new LinkedList<String>();
-+                        MapPaintStyles.addDebianDirs(dirs);
-+                        icon = new ImageProvider(realIconName).setDirs(dirs).setId("presets").setArchive(zipIcons).setOptional(true).get();
-+                    }
-+                    if (icon == null) {
-+                        System.out.println("Could not get presets icon " + iconName);
-+                        icon = new ImageIcon(iconName);
-+                    }
-                 }
-                 if (Math.max(icon.getIconHeight(), icon.getIconWidth()) != 16) {
-                     icon = new ImageIcon(icon.getImage().getScaledInstance(16, 16, Image.SCALE_SMOOTH));
+@@ -1265,7 +1266,19 @@ public class TaggingPreset extends Abstr
+ 
+     protected static ImageIcon loadImageIcon(String iconName, File zipIcons) {
+         final Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
+-        return new ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true).get();
++        ImageIcon icon = ImageProvider(iconName).setDirs(s).setId("presets").setArchive(zipIcons).setOptional(true).get();
++        if (icon == null) {
++            if (iconName.startsWith("styles/standard/")) {
++                String realIconName = iconName.replaceAll("styles/standard/", "");
++                LinkedList<String> dirs = new LinkedList<String>();
++                MapPaintStyles.addDebianDirs(dirs);
++                icon = new ImageProvider(realIconName).setDirs(dirs).setId("presets").setArchive(zipIcons).setOptional(true).get();
++            }
++            if (icon == null) {
++                System.out.println("Could not get presets icon " + iconName);
++                icon = new ImageIcon(iconName);
++            }
++        }
+     }
+ 
+     /*
diff --git a/debian/patches/04-fix_images.patch b/debian/patches/04-fix_images.patch
index 51edc10..ed5f2db 100644
--- a/debian/patches/04-fix_images.patch
+++ b/debian/patches/04-fix_images.patch
@@ -9,7 +9,7 @@ Forwarded: not-needed
 
 --- josm.orig/data/defaultpresets.xml
 +++ josm/data/defaultpresets.xml
-@@ -2974,7 +2974,7 @@ Note that for a match, at least one posi
+@@ -3033,7 +3033,7 @@ Note that for a match, at least one posi
              <key key="amenity" value="theatre" />
              <text key="name" text="Name" />
          </item>
@@ -18,7 +18,7 @@ Forwarded: not-needed
              <link href="http://wiki.openstreetmap.org/wiki/Tag:amenity=library"
                    de.href="http://wiki.openstreetmap.org/wiki/DE:Tag:amenity=library"
                    fi.href="http://wiki.openstreetmap.org/wiki/Fi:Tag:amenity=library"
-@@ -3278,7 +3278,7 @@ Note that for a match, at least one posi
+@@ -3337,7 +3337,7 @@ Note that for a match, at least one posi
              <space />
          </item>
          <separator/>
diff --git a/debian/patches/05-fix_version.patch b/debian/patches/05-fix_version.patch
index 31457d8..2e2d88d 100644
--- a/debian/patches/05-fix_version.patch
+++ b/debian/patches/05-fix_version.patch
@@ -10,7 +10,7 @@ Forwarded: not-needed
 
 --- josm.orig/build.xml
 +++ josm/build.xml
-@@ -78,7 +78,7 @@ Debian-Release: ${debian.version}
+@@ -79,7 +79,7 @@ Debian-Release: ${debian.version}
              <!-- add attribute excludes="**/*BZip2*,**/*Bzip2*" to create a non-bzip2 supporting jar -->
              <manifest>
                  <attribute name="Main-class" value="JOSM"/>
@@ -21,10 +21,10 @@ Forwarded: not-needed
  				<attribute name="Class-Path" value="${classpathprop}"/>
 --- josm.orig/src/org/openstreetmap/josm/data/Version.java
 +++ josm/src/org/openstreetmap/josm/data/Version.java
-@@ -205,9 +205,6 @@ public class Version {
-     public String getAgentString() {
-         int v = getVersion();
-         String s = (v == JOSM_UNKNOWN_VERSION) ? "UNKNOWN" : Integer.toString(v);
+@@ -217,9 +217,6 @@ public class Version {
+         if (buildName != null) {
+             s += " " + buildName;
+         }
 -        if (isLocalBuild() && v != JOSM_UNKNOWN_VERSION) {
 -            s += " SVN";
 -        }
diff --git a/debian/patches/06-handle_redacted_objects.patch b/debian/patches/06-handle_redacted_objects.patch
index 3ce0066..7cfc669 100644
--- a/debian/patches/06-handle_redacted_objects.patch
+++ b/debian/patches/06-handle_redacted_objects.patch
@@ -11,9 +11,9 @@ Bug-Debian: http://bugs.debian.org/682315
 
 --- josm.orig/src/org/openstreetmap/josm/data/osm/history/History.java
 +++ josm/src/org/openstreetmap/josm/data/osm/history/History.java
-@@ -230,4 +230,18 @@ public class History{
-     public OsmPrimitiveType getType() {
-         return type;
+@@ -244,4 +244,18 @@ public class History{
+         result += "]";
+         return result;
      }
 +
 +    @Override
@@ -32,9 +32,9 @@ Bug-Debian: http://bugs.debian.org/682315
  }
 --- josm.orig/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
 +++ josm/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
-@@ -161,6 +161,11 @@ public class HistoryBrowserModel extends
-         if (history.getByVersion(primitive.getVersion()) != null)
-             return primitive.isModified();
+@@ -169,6 +169,11 @@ public class HistoryBrowserModel extends
+         if (history.getLatest().getVersion() > primitive.getVersion())
+             return false;
  
 +        // if latest version from history is higher than a non existing primitive version,
 +        // that means this version has been redacted and the primitive cannot be used.
diff --git a/debian/patches/07-handle_deleted_nodes_without_coordinates.patch b/debian/patches/07-handle_deleted_nodes_without_coordinates.patch
deleted file mode 100644
index 0c68898..0000000
--- a/debian/patches/07-handle_deleted_nodes_without_coordinates.patch
+++ /dev/null
@@ -1,503 +0,0 @@
-From: Frederik Ramm <frederik at remote.org>
- Don-vip
-Subject: Handle deleted nodes without coordinates after recent OSM API change
-Origin: upstream, http://josm.openstreetmap.de/changeset/5326/josm
- upstream, http://josm.openstreetmap.de/changeset/5328/josm
- upstream, http://josm.openstreetmap.de/changeset/5332/josm
- upstream, http://josm.openstreetmap.de/changeset/5333/josm
- upstream, http://josm.openstreetmap.de/changeset/5334/josm
- upstream, http://josm.openstreetmap.de/changeset/5346/josm
- upstream, http://josm.openstreetmap.de/changeset/5349/josm
- upstream, http://josm.openstreetmap.de/changeset/5350/josm
- upstream, http://josm.openstreetmap.de/changeset/5351/josm
- upstream, http://josm.openstreetmap.de/changeset/5356/josm
-Bug-Debian: http://bugs.debian.org/682315
-
----
- src/org/openstreetmap/josm/data/osm/DataSetMerger.java                      |   17 +++--
- src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java             |   10 +--
- src/org/openstreetmap/josm/data/osm/Node.java                               |   17 ++---
- src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java |   14 ++--
- src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java         |   27 +++++---
- src/org/openstreetmap/josm/gui/DefaultNameFormatter.java                    |   18 +++--
- src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java          |   14 ++--
- src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java            |   32 +++++++---
- src/org/openstreetmap/josm/io/GeoJSONWriter.java                            |    4 -
- src/org/openstreetmap/josm/io/OsmChangesetContentParser.java                |   13 ++--
- src/org/openstreetmap/josm/io/OsmHistoryReader.java                         |   13 ++--
- src/org/openstreetmap/josm/io/OsmReader.java                                |    6 +
- src/org/openstreetmap/josm/io/OsmWriter.java                                |    4 -
- 13 files changed, 118 insertions(+), 71 deletions(-)
-
---- josm.orig/src/org/openstreetmap/josm/data/osm/Node.java
-+++ josm/src/org/openstreetmap/josm/data/osm/Node.java
-@@ -33,16 +33,12 @@ public final class Node extends OsmPrimi
- 
-     @Override
-     public final void setCoor(LatLon coor) {
--        if(coor != null){
--            updateCoor(coor, null);
--        }
-+        updateCoor(coor, null);
-     }
- 
-     @Override
-     public final void setEastNorth(EastNorth eastNorth) {
--        if(eastNorth != null) {
--            updateCoor(null, eastNorth);
--        }
-+        updateCoor(null, eastNorth);
-     }
- 
-     private void updateCoor(LatLon coor, EastNorth eastNorth) {
-@@ -112,8 +108,11 @@ public final class Node extends OsmPrimi
-             this.lon = ll.lon();
-             this.east = eastNorth.east();
-             this.north = eastNorth.north();
--        } else
--            throw new IllegalArgumentException();
-+        } else {
-+            this.lat = Double.NaN;
-+            this.lon = Double.NaN;
-+            invalidateEastNorthCache();
-+        }
-     }
- 
-     protected Node(long id, boolean allowNegative) {
-@@ -177,7 +176,7 @@ public final class Node extends OsmPrimi
-     @Override
-     void setDataset(DataSet dataSet) {
-         super.setDataset(dataSet);
--        if (!isIncomplete() && (getCoor() == null || getEastNorth() == null))
-+        if (!isIncomplete() && isVisible() && (getCoor() == null || getEastNorth() == null))
-             throw new DataIntegrityProblemException("Complete node with null coordinates: " + toString() + get3892DebugInfo());
-     }
- 
---- josm.orig/src/org/openstreetmap/josm/io/OsmReader.java
-+++ josm/src/org/openstreetmap/josm/io/OsmReader.java
-@@ -177,7 +177,11 @@ public class OsmReader extends AbstractR
- 
-     protected Node parseNode() throws XMLStreamException {
-         NodeData nd = new NodeData();
--        nd.setCoor(new LatLon(Double.parseDouble(parser.getAttributeValue(null, "lat")), Double.parseDouble(parser.getAttributeValue(null, "lon"))));
-+        String lat = parser.getAttributeValue(null, "lat");
-+        String lon = parser.getAttributeValue(null, "lon");
-+        if (lat != null && lon != null) {
-+            nd.setCoor(new LatLon(Double.parseDouble(lat), Double.parseDouble(lon)));
-+        }
-         readCommon(nd);
-         Node n = new Node(nd.getId(), nd.getVersion());
-         n.setVisible(nd.isVisible());
---- josm.orig/src/org/openstreetmap/josm/io/OsmWriter.java
-+++ josm/src/org/openstreetmap/josm/io/OsmWriter.java
-@@ -135,7 +135,9 @@ public class OsmWriter extends XmlWriter
-     public void visit(INode n) {
-         if (n.isIncomplete()) return;
-         addCommon(n, "node");
--        out.print(" lat='"+n.getCoor().lat()+"' lon='"+n.getCoor().lon()+"'");
-+        if (n.getCoor() != null) {
-+            out.print(" lat='"+n.getCoor().lat()+"' lon='"+n.getCoor().lon()+"'");
-+        }
-         if (!withBody) {
-             out.println("/>");
-         } else {
---- josm.orig/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
-+++ josm/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
-@@ -18,6 +18,7 @@ import java.util.Set;
- 
- import org.openstreetmap.josm.Main;
- import org.openstreetmap.josm.data.coor.CoordinateFormat;
-+import org.openstreetmap.josm.data.coor.LatLon;
- import org.openstreetmap.josm.data.osm.Changeset;
- import org.openstreetmap.josm.data.osm.IPrimitive;
- import org.openstreetmap.josm.data.osm.IRelation;
-@@ -178,7 +179,9 @@ public class DefaultNameFormatter implem
-             } else {
-                 preset.nameTemplate.appendText(name, node);
-             }
--            name.append(" \u200E(").append(node.getCoor().latToString(CoordinateFormat.getDefaultFormat())).append(", ").append(node.getCoor().lonToString(CoordinateFormat.getDefaultFormat())).append(")");
-+            if (node.getCoor() != null) {
-+                name.append(" \u200E(").append(node.getCoor().latToString(CoordinateFormat.getDefaultFormat())).append(", ").append(node.getCoor().lonToString(CoordinateFormat.getDefaultFormat())).append(")");
-+            }
-         }
-         decorateNameWithId(name, node);
- 
-@@ -553,11 +556,14 @@ public class DefaultNameFormatter implem
-         } else {
-             sb.append(name);
-         }
--        sb.append(" (")
--        .append(node.getCoords().latToString(CoordinateFormat.getDefaultFormat()))
--        .append(", ")
--        .append(node.getCoords().lonToString(CoordinateFormat.getDefaultFormat()))
--        .append(")");
-+        LatLon coord = node.getCoords();
-+        if (coord != null) {
-+            sb.append(" (")
-+            .append(coord.latToString(CoordinateFormat.getDefaultFormat()))
-+            .append(", ")
-+            .append(coord.lonToString(CoordinateFormat.getDefaultFormat()))
-+            .append(")");
-+        }
-         decorateNameWithId(sb, node);
-         return sb.toString();
-     }
---- josm.orig/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
-+++ josm/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialog.java
-@@ -272,12 +272,14 @@ public class InspectPrimitiveDialog exte
-         }
- 
-         void addCoordinates(Node n) {
--            add(tr("Coordinates: "),
--                    Double.toString(n.getCoor().lat()), ", ",
--                    Double.toString(n.getCoor().lon()));
--            add(tr("Coordinates (projected): "),
--                    Double.toString(n.getEastNorth().east()), ", ",
--                    Double.toString(n.getEastNorth().north()));
-+            if (n.getCoor() != null) {
-+                add(tr("Coordinates: "),
-+                        Double.toString(n.getCoor().lat()), ", ",
-+                        Double.toString(n.getCoor().lon()));
-+                add(tr("Coordinates (projected): "),
-+                        Double.toString(n.getEastNorth().east()), ", ",
-+                        Double.toString(n.getEastNorth().north()));
-+            }
-         }
- 
-         void addReferrers(StringBuilder s, OsmPrimitive o) {
---- josm.orig/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
-+++ josm/src/org/openstreetmap/josm/data/osm/DatasetConsistencyTest.java
-@@ -69,7 +69,7 @@ public class DatasetConsistencyTest {
- 
-     public void checkCompleteNodesWithoutCoordinates() {
-         for (Node node:dataSet.getNodes()) {
--            if (!node.isIncomplete() && (node.getCoor() == null || node.getEastNorth() == null)) {
-+            if (!node.isIncomplete() && node.isVisible() && (node.getCoor() == null || node.getEastNorth() == null)) {
-                 printError("COMPLETE WITHOUT COORDINATES", "%s is not incomplete but has null coordinates", node);
-             }
-         }
-@@ -79,9 +79,11 @@ public class DatasetConsistencyTest {
-         for (Node n:dataSet.getNodes()) {
-             if (!n.isIncomplete() && !n.isDeleted()) {
-                 LatLon c = n.getCoor();
--                BBox box = new BBox(new LatLon(c.lat() - 0.0001, c.lon() - 0.0001), new LatLon(c.lat() + 0.0001, c.lon() + 0.0001));
--                if (!dataSet.searchNodes(box).contains(n)) {
--                    printError("SEARCH NODES", "%s not found using Dataset.searchNodes()", n);
-+                if (c != null) {
-+                    BBox box = new BBox(new LatLon(c.lat() - 0.0001, c.lon() - 0.0001), new LatLon(c.lat() + 0.0001, c.lon() + 0.0001));
-+                    if (!dataSet.searchNodes(box).contains(n)) {
-+                        printError("SEARCH NODES", "%s not found using Dataset.searchNodes()", n);
-+                    }
-                 }
-             }
-         }
---- josm.orig/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
-+++ josm/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
-@@ -14,6 +14,7 @@ import javax.swing.JLabel;
- import javax.swing.JPanel;
- 
- import org.openstreetmap.josm.data.coor.CoordinateFormat;
-+import org.openstreetmap.josm.data.coor.LatLon;
- import org.openstreetmap.josm.data.osm.history.HistoryNode;
- import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
- import org.openstreetmap.josm.gui.NavigatableComponent;
-@@ -255,19 +256,24 @@ public class CoordinateInfoViewer extend
-             HistoryNode node = (HistoryNode)p;
-             HistoryNode oppositeNode = (HistoryNode) opposite;
- 
-+            LatLon coord = node.getCoords();
-+            LatLon oppositeCoord = oppositeNode.getCoords();
-+
-             // display the coordinates
-             //
--            lblLat.setText(node.getCoords().latToString(CoordinateFormat.DECIMAL_DEGREES));
--            lblLon.setText(node.getCoords().lonToString(CoordinateFormat.DECIMAL_DEGREES));
-+            lblLat.setText(coord != null ? coord.latToString(CoordinateFormat.DECIMAL_DEGREES) : tr("(none)"));
-+            lblLon.setText(coord != null ? coord.lonToString(CoordinateFormat.DECIMAL_DEGREES) : tr("(none)"));
- 
-             // update background color to reflect differences in the coordinates
-             //
--            if (node.getCoords().lat() == oppositeNode.getCoords().lat()) {
-+            if (coord == oppositeCoord ||
-+                    (coord != null && oppositeCoord != null && coord.lat() == oppositeCoord.lat())) {
-                 lblLat.setBackground(Color.WHITE);
-             } else {
-                 lblLat.setBackground(BGCOLOR_DIFFERENCE);
-             }
--            if (node.getCoords().lon() == oppositeNode.getCoords().lon()) {
-+            if (coord == oppositeCoord ||
-+                    (coord != null && oppositeCoord != null && coord.lon() == oppositeCoord.lon())) {
-                 lblLon.setBackground(Color.WHITE);
-             } else {
-                 lblLon.setBackground(BGCOLOR_DIFFERENCE);
-@@ -321,15 +327,23 @@ public class CoordinateInfoViewer extend
-             HistoryNode node = (HistoryNode) p;
-             HistoryNode oppositeNode = (HistoryNode) opposite;
- 
-+            LatLon coord = node.getCoords();
-+            LatLon oppositeCoord = oppositeNode.getCoords();
-+
-             // update distance
-             //
--            double distance = node.getCoords().greatCircleDistance(oppositeNode.getCoords());
--            if (distance > 0) {
--                lblDistance.setBackground(BGCOLOR_DIFFERENCE);
-+            if (coord != null && oppositeCoord != null) {
-+                double distance = coord.greatCircleDistance(oppositeNode.getCoords());
-+                if (distance > 0) {
-+                    lblDistance.setBackground(BGCOLOR_DIFFERENCE);
-+                } else {
-+                    lblDistance.setBackground(Color.WHITE);
-+                }
-+                lblDistance.setText(NavigatableComponent.getDistText(distance));
-             } else {
--                lblDistance.setBackground(Color.WHITE);
-+                lblDistance.setBackground(coord != oppositeCoord ? BGCOLOR_DIFFERENCE : Color.WHITE);
-+                lblDistance.setText(tr("(none)"));
-             }
--            lblDistance.setText(NavigatableComponent.getDistText(distance));
-         }
-     }
- }
---- josm.orig/src/org/openstreetmap/josm/io/GeoJSONWriter.java
-+++ josm/src/org/openstreetmap/josm/io/GeoJSONWriter.java
-@@ -103,6 +103,8 @@ public class GeoJSONWriter implements Vi
-     }
- 
-     protected void appendCoord(LatLon c) {
--        out.append("[").append(c.lon()).append(", ").append(c.lat()).append("]");
-+        if (c != null) {
-+            out.append("[").append(c.lon()).append(", ").append(c.lat()).append("]");
-+        }
-     }
- }
---- josm.orig/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
-+++ josm/src/org/openstreetmap/josm/io/OsmChangesetContentParser.java
-@@ -102,16 +102,16 @@ public class OsmChangesetContentParser {
-             return l;
-         }
- 
--        protected Double getMandatoryAttributeDouble(Attributes attr, String name) throws SAXException{
-+        protected Double getAttributeDouble(Attributes attr, String name) throws SAXException{
-             String v = attr.getValue(name);
-             if (v == null) {
--                throwException(tr("Missing mandatory attribute ''{0}''.", name));
-+                return null;
-             }
-             double d = 0.0;
-             try {
-                 d = Double.parseDouble(v);
-             } catch(NumberFormatException e) {
--                throwException(tr("Illegal value for mandatory attribute ''{0}'' of type double. Got ''{1}''.", name, v));
-+                throwException(tr("Illegal value for attribute ''{0}'' of type double. Got ''{1}''.", name, v));
-             }
-             return d;
-         }
-@@ -159,10 +159,11 @@ public class OsmChangesetContentParser {
-             Date timestamp = DateUtils.fromString(v);
-             HistoryOsmPrimitive primitive = null;
-             if (type.equals(OsmPrimitiveType.NODE)) {
--                double lat = getMandatoryAttributeDouble(atts, "lat");
--                double lon = getMandatoryAttributeDouble(atts, "lon");
-+                Double lat = getAttributeDouble(atts, "lat");
-+                Double lon = getAttributeDouble(atts, "lon");
-+                LatLon coor = (lat != null && lon != null) ? new LatLon(lat,lon) : null;
-                 primitive = new HistoryNode(
--                        id,version,visible,user,changesetId,timestamp, new LatLon(lat,lon)
-+                        id,version,visible,user,changesetId,timestamp,coor
-                 );
- 
-             } else if (type.equals(OsmPrimitiveType.WAY)) {
---- josm.orig/src/org/openstreetmap/josm/io/OsmHistoryReader.java
-+++ josm/src/org/openstreetmap/josm/io/OsmHistoryReader.java
-@@ -98,16 +98,16 @@ public class OsmHistoryReader {
-             return l;
-         }
- 
--        protected Double getMandatoryAttributeDouble(Attributes attr, String name) throws SAXException{
-+        protected Double getAttributeDouble(Attributes attr, String name) throws SAXException{
-             String v = attr.getValue(name);
-             if (v == null) {
--                throwException(tr("Missing mandatory attribute ''{0}''.", name));
-+                return null;
-             }
-             double d = 0.0;
-             try {
-                 d = Double.parseDouble(v);
-             } catch(NumberFormatException e) {
--                throwException(tr("Illegal value for mandatory attribute ''{0}'' of type double. Got ''{1}''.", name, v));
-+                throwException(tr("Illegal value for attribute ''{0}'' of type double. Got ''{1}''.", name, v));
-             }
-             return d;
-         }
-@@ -153,10 +153,11 @@ public class OsmHistoryReader {
-             Date timestamp = DateUtils.fromString(v);
-             HistoryOsmPrimitive primitive = null;
-             if (type.equals(OsmPrimitiveType.NODE)) {
--                double lat = getMandatoryAttributeDouble(atts, "lat");
--                double lon = getMandatoryAttributeDouble(atts, "lon");
-+                Double lat = getAttributeDouble(atts, "lat");
-+                Double lon = getAttributeDouble(atts, "lon");
-+                LatLon coord = (lat != null && lon != null) ? new LatLon(lat,lon) : null;
-                 primitive = new HistoryNode(
--                        id,version,visible,user,changesetId,timestamp, new LatLon(lat,lon)
-+                        id,version,visible,user,changesetId,timestamp,coord
-                 );
- 
-             } else if (type.equals(OsmPrimitiveType.WAY)) {
---- josm.orig/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
-+++ josm/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
-@@ -178,8 +178,9 @@ public class DataSetMerger {
- 
-                 List<OsmPrimitive> referrers = target.getReferrers();
-                 if (referrers.isEmpty()) {
--                    target.setDeleted(true);
-+                    resetPrimitive(target);
-                     target.mergeFrom(source);
-+                    target.setDeleted(true);
-                     it.remove();
-                     flag = true;
-                 } else {
-@@ -202,11 +203,7 @@ public class DataSetMerger {
-             // There are some more objects rest in the objectsToDelete set
-             // This can be because of cross-referenced relations.
-             for (OsmPrimitive osm: objectsToDelete) {
--                if (osm instanceof Way) {
--                    ((Way) osm).setNodes(null);
--                } else if (osm instanceof Relation) {
--                    ((Relation) osm).setMembers(null);
--                }
-+                resetPrimitive(osm);
-             }
-             for (OsmPrimitive osm: objectsToDelete) {
-                 osm.setDeleted(true);
-@@ -215,6 +212,14 @@ public class DataSetMerger {
-         }
-     }
- 
-+    private final void resetPrimitive(OsmPrimitive osm) {
-+        if (osm instanceof Way) {
-+            ((Way) osm).setNodes(null);
-+        } else if (osm instanceof Relation) {
-+            ((Relation) osm).setMembers(null);
-+        }
-+    }
-+
-     /**
-      * Merges the node list of a source way onto its target way.
-      *
---- josm.orig/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
-+++ josm/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
-@@ -137,33 +137,33 @@ public class WireframeMapRenderer extend
-            time to iterate through list twice, OTOH does not
-            require changing the colour while painting... */
-         for (final OsmPrimitive osm: data.searchRelations(bbox)) {
--            if (!osm.isDeleted() && !ds.isSelected(osm) && !osm.isDisabledAndHidden()) {
-+            if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden()) {
-                 osm.visit(this);
-             }
-         }
- 
-         for (final OsmPrimitive osm:data.searchWays(bbox)){
--            if (!osm.isDeleted() && !ds.isSelected(osm) && !osm.isDisabledAndHidden() && osm.isTagged()) {
-+            if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden() && osm.isTagged()) {
-                 osm.visit(this);
-             }
-         }
-         displaySegments();
- 
-         for (final OsmPrimitive osm:data.searchWays(bbox)){
--            if (!osm.isDeleted() && !ds.isSelected(osm) && !osm.isDisabledAndHidden() && !osm.isTagged()) {
-+            if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden() && !osm.isTagged()) {
-                 osm.visit(this);
-             }
-         }
-         displaySegments();
-         for (final OsmPrimitive osm : data.getSelected()) {
--            if (!osm.isDeleted()) {
-+            if (osm.isDrawable()) {
-                 osm.visit(this);
-             }
-         }
-         displaySegments();
- 
-         for (final OsmPrimitive osm: data.searchNodes(bbox)) {
--            if (!osm.isDeleted() && !ds.isSelected(osm) && !osm.isDisabledAndHidden())
-+            if (osm.isDrawable() && !ds.isSelected(osm) && !osm.isDisabledAndHidden())
-             {
-                 osm.visit(this);
-             }
-@@ -343,7 +343,7 @@ public class WireframeMapRenderer extend
-         g.setColor(col);
- 
-         for (RelationMember m : r.getMembers()) {
--            if (m.getMember().isIncomplete() || m.getMember().isDeleted()) {
-+            if (m.getMember().isIncomplete() || !m.getMember().isDrawable()) {
-                 continue;
-             }
- 
-@@ -360,7 +360,7 @@ public class WireframeMapRenderer extend
- 
-                 boolean first = true;
-                 for (Node n : m.getWay().getNodes()) {
--                    if (n.isIncomplete() || n.isDeleted()) {
-+                    if (!n.isDrawable()) {
-                         continue;
-                     }
-                     Point p = nc.getPoint(n);
---- josm.orig/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
-+++ josm/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
-@@ -43,35 +43,44 @@ public class DuplicateNode extends Test
- 
-         double precision = Main.pref.getDouble("validator.duplicatenodes.precision", 0.);
- 
--        private LatLon RoundCoord(Node o) {
-+        private LatLon roundCoord(LatLon coor) {
-             return new LatLon(
--                    Math.round(o.getCoor().lat() / precision) * precision,
--                    Math.round(o.getCoor().lon() / precision) * precision
-+                    Math.round(coor.lat() / precision) * precision,
-+                    Math.round(coor.lon() / precision) * precision
-                     );
-         }
- 
-         @SuppressWarnings("unchecked")
-         private LatLon getLatLon(Object o) {
-             if (o instanceof Node) {
-+                LatLon coor = ((Node) o).getCoor();
-+                if (coor == null)
-+                    return null;
-                 if (precision==0)
--                    return ((Node) o).getCoor().getRoundedToOsmPrecision();
--                return RoundCoord((Node) o);
-+                    return coor.getRoundedToOsmPrecision();
-+                return roundCoord(coor);
-             } else if (o instanceof List<?>) {
-+                LatLon coor = ((List<Node>) o).get(0).getCoor();
-+                if (coor == null)
-+                    return null;
-                 if (precision==0)
--                    return ((List<Node>) o).get(0).getCoor().getRoundedToOsmPrecision();
--                return RoundCoord(((List<Node>) o).get(0));
-+                    return coor.getRoundedToOsmPrecision();
-+                return roundCoord(coor);
-             } else
-                 throw new AssertionError();
-         }
- 
-         @Override
-         public boolean equals(Object k, Object t) {
--            return getLatLon(k).equals(getLatLon(t));
-+            LatLon coorK = getLatLon(k);
-+            LatLon coorT = getLatLon(t);
-+            return coorK == coorT || (coorK != null && coorT != null && coorK.equals(coorT));
-         }
- 
-         @Override
-         public int getHashCode(Object k) {
--            return getLatLon(k).hashCode();
-+            LatLon coorK = getLatLon(k);
-+            return coorK == null ? 0 : coorK.hashCode();
-         }
-     }
- 
diff --git a/debian/patches/series b/debian/patches/series
index 8bdaa91..b002fc0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,4 +6,3 @@
 05-fix_version.patch
 #100-fix_SlippyMapBBoxChooser.patch
 06-handle_redacted_objects.patch
-07-handle_deleted_nodes_without_coordinates.patch

-- 
Editor for OpenStreetMap



More information about the Pkg-osm-commits mailing list