Bug#745097: mkgmap: FTBFS with Java 8: name clash: remove(K, V) in MultiHashMap and remove(Object, Object) in HashMap have the same erasure

Emmanuel Bourg ebourg at apache.org
Fri Aug 8 15:58:29 UTC 2014


Control: tags -1 patch

Here is a patch fixing this issue. It renames the remove(K, V) methods
in MultiHashMap and MultiIdentityHashMap which are conflicting with the
new Map.remove(Object, Object) method introduced in Java 8.

-------------- next part --------------
Description: Rename the MultiHashMap and MultiIdentityHashMap remove(K, V) methods
 to avoid a conflict with the new Map.remove(Object, Object) method introduced in Java 8
Author: Emmanuel Bourg <ebourg at apache.org>
Forwarded: no
Bug-Debian: https://bugs.debian.org/745097
--- a/src/uk/me/parabola/mkgmap/osmstyle/RoadMerger.java
+++ b/src/uk/me/parabola/mkgmap/osmstyle/RoadMerger.java
@@ -458,9 +458,9 @@
 		Coord mergePoint = points2.get(0);
 		Coord endPoint= points2.get(points2.size()-1);
 		
-		startPoints.remove(mergePoint, road2);
-		endPoints.remove(endPoint, road2);
-		endPoints.remove(mergePoint, road1);
+		startPoints.removeKeyValue(mergePoint, road2);
+		endPoints.removeKeyValue(endPoint, road2);
+		endPoints.removeKeyValue(mergePoint, road1);
 
 		points1.addAll(points2.subList(1, points2.size()));
 		endPoints.add(endPoint, road1);
--- a/src/uk/me/parabola/util/MultiIdentityHashMap.java
+++ b/src/uk/me/parabola/util/MultiIdentityHashMap.java
@@ -54,7 +54,7 @@
 	    return ( results ? value : null );
 	}
 
-	public V remove(K key, V value )
+	public V removeKeyValue(K key, V value )
 	{
 	    
 	    List<V> values = super.get(key);
--- a/src/uk/me/parabola/mkgmap/filters/LineMergeFilter.java
+++ b/src/uk/me/parabola/mkgmap/filters/LineMergeFilter.java
@@ -29,9 +29,9 @@
 		// Merges the points in the second one
 		List<Coord> points1 = line1.getPoints();
 		List<Coord> points2 = line2.getPoints();
-		startPoints.remove(points1.get(0), line1);
-		endPoints.remove(points1.get(points1.size()-1), line1);
-		startPoints.remove(points2.get(0), line2);
+		startPoints.removeKeyValue(points1.get(0), line1);
+		endPoints.removeKeyValue(points1.get(points1.size()-1), line1);
+		startPoints.removeKeyValue(points2.get(0), line2);
 		startPoints.add(points1.get(0), line2);
 		line2.insertPointsAtStart(points1);
 		linesMerged.remove(line1);
@@ -40,7 +40,7 @@
 	private void addPointsAtStart(MapLine line, List<Coord> additionalPoints) {
 		log.info("merged lines before " + line.getName());
 		List<Coord> points = line.getPoints();
-		startPoints.remove(points.get(0), line);
+		startPoints.removeKeyValue(points.get(0), line);
 		line.insertPointsAtStart(additionalPoints);
 		startPoints.add(points.get(0), line);
 	}
@@ -48,7 +48,7 @@
 	private void addPointsAtEnd(MapLine line, List<Coord> additionalPoints) {
 		log.info("merged lines after " + line.getName());
 		List<Coord> points = line.getPoints();
-		endPoints.remove(points.get(points.size()-1), line);
+		endPoints.removeKeyValue(points.get(points.size()-1), line);
 		line.insertPointsAtEnd(additionalPoints);
 		endPoints.add(points.get(points.size()-1), line);
 	}
--- a/src/uk/me/parabola/util/MultiHashMap.java
+++ b/src/uk/me/parabola/util/MultiHashMap.java
@@ -54,7 +54,7 @@
 	    return ( results ? value : null );
 	}
 
-	public V remove(K key, V value )
+	public V removeKeyValue(K key, V value )
 	{
 	    
 	    List<V> values = super.get(key);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-grass-devel/attachments/20140808/e92c1aa5/attachment-0001.sig>


More information about the Pkg-grass-devel mailing list