Index: /trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java	(revision 9967)
+++ /trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java	(revision 9968)
@@ -198,5 +198,5 @@
         Arrays.sort(angles, new PolarNodeComparator());
         int[] count = distributeNodes(angles,
-                numberOfNodesInCircle >= nodes.size() ? numberOfNodesInCircle - nodes.size() : 0);
+                numberOfNodesInCircle >= nodes.size() ? (numberOfNodesInCircle - nodes.size()) : 0);
 
         // now we can start doing things to OSM data
Index: /trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java	(revision 9967)
+++ /trunk/src/org/openstreetmap/josm/actions/ExtensionFileFilter.java	(revision 9968)
@@ -319,5 +319,5 @@
             defaultExtension,
             description + (!extensionsForDescription.isEmpty()
-                ? " (" + Utils.join(", ", extensionsForDescription) + ")"
+                ? (" (" + Utils.join(", ", extensionsForDescription) + ")")
                 : "")
             );
Index: /trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java	(revision 9967)
+++ /trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java	(revision 9968)
@@ -76,7 +76,7 @@
         protected boolean isHeterogeneousSource() {
             int count = 0;
-            count = !getSourcePrimitivesByType(OsmPrimitiveType.NODE).isEmpty() ? count + 1 : count;
-            count = !getSourcePrimitivesByType(OsmPrimitiveType.WAY).isEmpty() ? count + 1 : count;
-            count = !getSourcePrimitivesByType(OsmPrimitiveType.RELATION).isEmpty() ? count + 1 : count;
+            count = !getSourcePrimitivesByType(OsmPrimitiveType.NODE).isEmpty() ? (count + 1) : count;
+            count = !getSourcePrimitivesByType(OsmPrimitiveType.WAY).isEmpty() ? (count + 1) : count;
+            count = !getSourcePrimitivesByType(OsmPrimitiveType.RELATION).isEmpty() ? (count + 1) : count;
             return count > 1;
         }
Index: /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 9967)
+++ /trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 9968)
@@ -614,11 +614,5 @@
                         String role = rm.getRole();
                         if ("from".equals(role) || "to".equals(role)) {
-                            OsmPrimitive via = null;
-                            for (RelationMember rmv : r.getMembers()) {
-                                if ("restriction".equals(type) && "via".equals(rmv.getRole())
-                                        || "destination_sign".equals(type) && rmv.hasRole("sign", "intersection")) {
-                                    via = rmv.getMember();
-                                }
-                            }
+                            OsmPrimitive via = findVia(r, type);
                             List<Node> nodes = new ArrayList<>();
                             if (via != null) {
@@ -751,4 +745,14 @@
     }
 
+    static OsmPrimitive findVia(Relation r, String type) {
+        for (RelationMember rmv : r.getMembers()) {
+            if (("restriction".equals(type) && "via".equals(rmv.getRole()))
+             || ("destination_sign".equals(type) && rmv.hasRole("sign", "intersection"))) {
+                return rmv.getMember();
+            }
+        }
+        return null;
+    }
+
     /**
      * Splits the way {@code way} at the nodes in {@code atNodes} and replies
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 9967)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 9968)
@@ -535,5 +535,5 @@
                 // existing way or make a new way of its own? The "alt" modifier means that the
                 // user wants a new way.
-                Way way = alt ? null : (selectedWay != null) ? selectedWay : getWayForNode(n0);
+                Way way = alt ? null : (selectedWay != null ? selectedWay : getWayForNode(n0));
                 Way wayToSelect;
 
@@ -1565,5 +1565,5 @@
                     e0 = p0.east();
                     n0 = p0.north();
-                    buildLabelText((nearestAngle <= 180) ? nearestAngle : nearestAngle-360);
+                    buildLabelText((nearestAngle <= 180) ? nearestAngle : (nearestAngle-360));
 
                     phi = (nearestAngle + activeBaseHeading) * Math.PI / 180;
Index: /trunk/test/unit/org/openstreetmap/josm/actions/PasteTagsActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/PasteTagsActionTest.java	(revision 9968)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/PasteTagsActionTest.java	(revision 9968)
@@ -0,0 +1,55 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.actions;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.actions.PasteTagsAction.TagPaster;
+import org.openstreetmap.josm.data.osm.NodeData;
+import org.openstreetmap.josm.data.osm.PrimitiveData;
+import org.openstreetmap.josm.data.osm.RelationData;
+import org.openstreetmap.josm.data.osm.WayData;
+
+/**
+ * Unit tests for class {@link PasteTagsAction}.
+ */
+public class PasteTagsActionTest {
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    private static boolean isHeterogeneousSource(PrimitiveData... t) {
+        return new TagPaster(Arrays.asList(t), null).isHeterogeneousSource();
+    }
+
+    /**
+     * Unit test of {@link TagPaster#isHeterogeneousSource}.
+     */
+    @Test
+    public void testTagPasterIsHeterogeneousSource() {
+        // 0 item
+        assertFalse(isHeterogeneousSource());
+        // 1 item
+        assertFalse(isHeterogeneousSource(new NodeData()));
+        assertFalse(isHeterogeneousSource(new WayData()));
+        assertFalse(isHeterogeneousSource(new RelationData()));
+        // 2 items of same type
+        assertFalse(isHeterogeneousSource(new NodeData(), new NodeData()));
+        assertFalse(isHeterogeneousSource(new WayData(), new WayData()));
+        assertFalse(isHeterogeneousSource(new RelationData(), new RelationData()));
+        // 2 items of different type
+        assertTrue(isHeterogeneousSource(new NodeData(), new WayData()));
+        assertTrue(isHeterogeneousSource(new NodeData(), new RelationData()));
+        assertTrue(isHeterogeneousSource(new WayData(), new RelationData()));
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java	(revision 9967)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/SplitWayActionTest.java	(revision 9968)
@@ -3,4 +3,5 @@
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
@@ -102,4 +103,39 @@
     }
 
+    /**
+     * Unit test of {@link SplitWayAction#findVia}.
+     */
+    @Test
+    public void testFindVia() {
+        // empty relation
+        assertNull(SplitWayAction.findVia(new Relation(), null));
+        // restriction relation without via member
+        Relation r = new Relation();
+        r.addMember(new RelationMember("", new Node()));
+        assertNull(SplitWayAction.findVia(r, "restriction"));
+        // restriction relation with via member
+        r = new Relation();
+        OsmPrimitive via = new Node();
+        r.addMember(new RelationMember("via", via));
+        assertEquals(via, SplitWayAction.findVia(r, "restriction"));
+        // destination_sign relation without sign nor intersection
+        r = new Relation();
+        r.addMember(new RelationMember("", new Node()));
+        assertNull(SplitWayAction.findVia(r, "destination_sign"));
+        // destination_sign with sign
+        r = new Relation();
+        via = new Node();
+        r.addMember(new RelationMember("sign", via));
+        assertEquals(via, SplitWayAction.findVia(r, "destination_sign"));
+        // destination_sign with intersection
+        r = new Relation();
+        via = new Node();
+        r.addMember(new RelationMember("intersection", via));
+        assertEquals(via, SplitWayAction.findVia(r, "destination_sign"));
+    }
+
+    /**
+     * Unit tests of route relations.
+     */
     @Test
     public void testRouteRelation() {
@@ -143,5 +179,4 @@
         dataSet.setSelected(Arrays.asList(w2, n3, n4, n5));
 
-
         final SplitWayAction.Strategy strategy = new SplitWayAction.Strategy() {
 
@@ -174,5 +209,4 @@
         assertFirstLastNodeIs(((Way) route.getMemberPrimitivesList().get(5)), n6);
         assertFirstLastNodeIs(((Way) route.getMemberPrimitivesList().get(5)), n7);
-
     }
 
