[jmapviewer] 01/03: Add patches from upstream SVN repository.
Bas Couwenberg
sebastic at debian.org
Sun Nov 26 17:11:17 UTC 2017
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository jmapviewer.
commit c9a4fdcbc65611ff75c3d56a47383b8bc68f27b4
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Sun Nov 26 17:30:33 2017 +0100
Add patches from upstream SVN repository.
---
debian/changelog | 1 +
debian/patches/series | 2 +
...33762-use-ArrayList-instead-of-LinkedList.patch | 56 ++++++++++++++++++++++
...a-new-method-to-ease-asynchronous-testing.patch | 37 ++++++++++++++
4 files changed, 96 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 2ba5c1f..8939848 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ jmapviewer (2.3+dfsg-2) UNRELEASED; urgency=medium
* Bump Standards-Version to 4.1.0, no changes.
* Strip trailing whitespace from control file.
+ * Add patches from upstream SVN repository.
-- Bas Couwenberg <sebastic at debian.org> Sun, 24 Sep 2017 13:04:54 +0200
diff --git a/debian/patches/series b/debian/patches/series
index 32e8c24..64dad1b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
01-build_less.patch
03-use-installed-library-in-demo.patch
+svn-r33762-use-ArrayList-instead-of-LinkedList.patch
+svn-r33804-add-a-new-method-to-ease-asynchronous-testing.patch
diff --git a/debian/patches/svn-r33762-use-ArrayList-instead-of-LinkedList.patch b/debian/patches/svn-r33762-use-ArrayList-instead-of-LinkedList.patch
new file mode 100644
index 0000000..af4cff8
--- /dev/null
+++ b/debian/patches/svn-r33762-use-ArrayList-instead-of-LinkedList.patch
@@ -0,0 +1,56 @@
+Description: http://errorprone.info/bugpattern/JdkObsolete: use ArrayList instead of LinkedList
+Author: donvip
+Origin: https://trac.openstreetmap.org/changeset/33762/subversion
+
+--- a/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
++++ b/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
+@@ -10,8 +10,8 @@ import java.awt.event.ActionEvent;
+ import java.awt.event.ActionListener;
+ import java.awt.event.MouseEvent;
+ import java.net.URL;
++import java.util.ArrayList;
+ import java.util.Collections;
+-import java.util.LinkedList;
+ import java.util.List;
+
+ import javax.swing.ImageIcon;
+@@ -139,9 +139,9 @@ public class JMapViewer extends JPanel i
+ public JMapViewer(TileCache tileCache) {
+ tileSource = new OsmTileSource.Mapnik();
+ tileController = new TileController(tileSource, tileCache, this);
+- mapMarkerList = Collections.synchronizedList(new LinkedList<MapMarker>());
+- mapPolygonList = Collections.synchronizedList(new LinkedList<MapPolygon>());
+- mapRectangleList = Collections.synchronizedList(new LinkedList<MapRectangle>());
++ mapMarkerList = Collections.synchronizedList(new ArrayList<MapMarker>());
++ mapPolygonList = Collections.synchronizedList(new ArrayList<MapPolygon>());
++ mapRectangleList = Collections.synchronizedList(new ArrayList<MapRectangle>());
+ mapMarkersVisible = true;
+ mapRectanglesVisible = true;
+ mapPolygonsVisible = true;
+@@ -769,7 +769,7 @@ public class JMapViewer extends JPanel i
+ protected void paintPolygon(Graphics g, MapPolygon polygon) {
+ List<? extends ICoordinate> coords = polygon.getPoints();
+ if (coords != null && coords.size() >= 3) {
+- List<Point> points = new LinkedList<>();
++ List<Point> points = new ArrayList<>();
+ for (ICoordinate c : coords) {
+ Point p = getMapPosition(c, false);
+ if (p == null) {
+@@ -781,7 +781,7 @@ public class JMapViewer extends JPanel i
+ if (scrollWrapEnabled) {
+ int tilesize = tileSource.getTileSize();
+ int mapSize = tilesize << zoom;
+- List<Point> pointsWrapped = new LinkedList<>(points);
++ List<Point> pointsWrapped = new ArrayList<>(points);
+ boolean keepWrapping = true;
+ while (keepWrapping) {
+ for (Point p : pointsWrapped) {
+@@ -792,7 +792,7 @@ public class JMapViewer extends JPanel i
+ }
+ polygon.paint(g, pointsWrapped);
+ }
+- pointsWrapped = new LinkedList<>(points);
++ pointsWrapped = new ArrayList<>(points);
+ keepWrapping = true;
+ while (keepWrapping) {
+ for (Point p : pointsWrapped) {
diff --git a/debian/patches/svn-r33804-add-a-new-method-to-ease-asynchronous-testing.patch b/debian/patches/svn-r33804-add-a-new-method-to-ease-asynchronous-testing.patch
new file mode 100644
index 0000000..135f971
--- /dev/null
+++ b/debian/patches/svn-r33804-add-a-new-method-to-ease-asynchronous-testing.patch
@@ -0,0 +1,37 @@
+Description: add a new method to ease asynchronous testing (patch by ris)
+Author: ris
+Origin: https://trac.openstreetmap.org/changeset/33804/subversion
+Bug: http://josm.openstreetmap.de/intertrac/ticket:15539
+
+--- a/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java
++++ b/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java
+@@ -177,6 +177,11 @@ public class OsmTileLoader implements Ti
+ }
+
+ @Override
++ public boolean hasOutstandingTasks() {
++ return jobDispatcher.getTaskCount() > jobDispatcher.getCompletedTaskCount();
++ }
++
++ @Override
+ public void cancelOutstandingTasks() {
+ jobDispatcher.getQueue().clear();
+ }
+--- a/src/org/openstreetmap/gui/jmapviewer/interfaces/TileLoader.java
++++ b/src/org/openstreetmap/gui/jmapviewer/interfaces/TileLoader.java
+@@ -26,4 +26,15 @@ public interface TileLoader {
+ * to loading = false / loaded = false
+ */
+ void cancelOutstandingTasks();
++
++ /**
++ * Determines whether this {@link TileLoader} has tasks which have not completed.
++ * @return whether this {@link TileLoader} has tasks which have not completed. This answer may well be
++ * "approximate" given that many implementations will be using mechanisms where a queue's state can change
++ * during the computation.
++ */
++ default boolean hasOutstandingTasks() {
++ // default implementation supplied just to make transition easier for external implementors
++ throw new UnsupportedOperationException("Not implemented");
++ }
+ }
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/jmapviewer.git
More information about the Pkg-grass-devel
mailing list