Index: /trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java	(revision 13806)
+++ /trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java	(revision 13807)
@@ -417,3 +417,9 @@
      */
     List<? extends IPrimitive> getReferrers();
+
+    /**
+     * Returns the parent data set of this primitive.
+     * @return OsmData this primitive is part of.
+     */
+    OsmData<?, ?, ?, ?> getDataSet();
 }
Index: /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 13806)
+++ /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 13807)
@@ -237,8 +237,5 @@
     }
 
-    /**
-     *
-     * @return DataSet this primitive is part of.
-     */
+    @Override
     public DataSet getDataSet() {
         return dataSet;
Index: /trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java	(revision 13806)
+++ /trunk/src/org/openstreetmap/josm/data/osm/PrimitiveData.java	(revision 13807)
@@ -176,4 +176,9 @@
 
     @Override
+    public OsmData<?, ?, ?, ?> getDataSet() {
+        return null;
+    }
+
+    @Override
     public StyleCache getCachedStyle() {
         return null;
Index: /trunk/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 13806)
+++ /trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 13807)
@@ -571,10 +571,9 @@
     /**
      * Tests if two polygons intersect.
-     * @param <N> type of node
      * @param first List of nodes forming first polygon
      * @param second List of nodes forming second polygon
      * @return intersection kind
      */
-    public static <N extends INode> PolygonIntersection polygonIntersection(List<N> first, List<N> second) {
+    public static PolygonIntersection polygonIntersection(List<? extends INode> first, List<? extends INode> second) {
         Area a1 = getArea(first);
         Area a2 = getArea(second);
@@ -620,15 +619,14 @@
     /**
      * Tests if point is inside a polygon. The polygon can be self-intersecting. In such case the contains function works in xor-like manner.
-     * @param <N> type of node
      * @param polygonNodes list of nodes from polygon path.
      * @param point the point to test
      * @return true if the point is inside polygon.
      */
-    public static <N extends INode> boolean nodeInsidePolygon(N point, List<N> polygonNodes) {
+    public static boolean nodeInsidePolygon(INode point, List<? extends INode> polygonNodes) {
         if (polygonNodes.size() < 2)
             return false;
 
         //iterate each side of the polygon, start with the last segment
-        N oldPoint = polygonNodes.get(polygonNodes.size() - 1);
+        INode oldPoint = polygonNodes.get(polygonNodes.size() - 1);
 
         if (!oldPoint.isLatLonKnown()) {
@@ -637,7 +635,7 @@
 
         boolean inside = false;
-        N p1, p2;
-
-        for (N newPoint : polygonNodes) {
+        INode p1, p2;
+
+        for (INode newPoint : polygonNodes) {
             //skip duplicate points
             if (newPoint.equals(oldPoint)) {
@@ -943,5 +941,5 @@
      * @return {@code true} if the node is inside the multipolygon
      */
-    public static boolean isNodeInsideMultiPolygon(Node node, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) {
+    public static boolean isNodeInsideMultiPolygon(INode node, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) {
         return isPolygonInsideMultiPolygon(Collections.singletonList(node), multiPolygon, isOuterWayAMatch);
     }
@@ -957,5 +955,5 @@
      * @return {@code true} if the polygon formed by nodes is inside the multipolygon
      */
-    public static boolean isPolygonInsideMultiPolygon(List<Node> nodes, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) {
+    public static boolean isPolygonInsideMultiPolygon(List<? extends INode> nodes, Relation multiPolygon, Predicate<Way> isOuterWayAMatch) {
         // Extract outer/inner members from multipolygon
         final Pair<List<JoinedPolygon>, List<JoinedPolygon>> outerInner;
