Index: applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java	(revision 30459)
+++ applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java	(revision 30532)
@@ -21,7 +21,4 @@
  *  <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne.
  */
-
-
-
 public class EdgeWeightedDigraph {
     private final int V;
@@ -32,4 +29,5 @@
      * Create an empty edge-weighted digraph with V vertices.
      */
+    @SuppressWarnings("unchecked")
     public EdgeWeightedDigraph(int V) {
         if (V < 0) throw new RuntimeException("Number of vertices must be nonnegative");
@@ -102,5 +100,4 @@
     }
 
-
    /**
      * Add the edge e to this digraph.
@@ -111,5 +108,4 @@
         E++;
     }
-
 
    /**
@@ -144,6 +140,4 @@
     }
 
-
-
    /**
      * Return a string representation of this graph.
@@ -162,13 +156,3 @@
         return s.toString();
     }
-
-    /**
-     * Test client.
-     */
-//    public static void main(String[] args) {
-//        In in = new In(args[0]);
-//        EdgeWeightedDigraph G = new EdgeWeightedDigraph(in);
-//        StdOut.println(G);
-//    }
-
 }
Index: applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/IndexMinPQ.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/IndexMinPQ.java	(revision 30459)
+++ applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/IndexMinPQ.java	(revision 30532)
@@ -19,4 +19,5 @@
     private Key[] keys;      // keys[i] = priority of i
 
+    @SuppressWarnings("unchecked")
     public IndexMinPQ(int NMAX) {
         keys = (Key[]) new Comparable[NMAX + 1];    // make this of length NMAX??
@@ -186,35 +187,3 @@
         }
     }
-
-
-//    public static void main(String[] args) {
-//        // insert a bunch of strings
-//        String[] strings = { "it", "was", "the", "best", "of", "times", "it", "was", "the", "worst" };
-//
-//        IndexMinPQ<String> pq = new IndexMinPQ<String>(strings.length);
-//        for (int i = 0; i < strings.length; i++) {
-//            pq.insert(i, strings[i]);
-//        }
-//
-//        // delete and print each key
-//        while (!pq.isEmpty()) {
-//            int i = pq.delMin();
-//            StdOut.println(i + " " + strings[i]);
-//        }
-//        StdOut.println();
-//
-//        // reinsert the same strings
-//        for (int i = 0; i < strings.length; i++) {
-//            pq.insert(i, strings[i]);
-//        }
-//
-//        // print each key using the iterator
-//        for (int i : pq) {
-//            StdOut.println(i + " " + strings[i]);
-//        }
-//        while (!pq.isEmpty()) {
-//            pq.delMin();
-//        }
-//
-//    }
 }
Index: applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/ChooseURLAction.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/ChooseURLAction.java	(revision 30459)
+++ applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/ChooseURLAction.java	(revision 30532)
@@ -54,5 +54,5 @@
         }
         final JLabel label1=new JLabel(tr("Please select one of custom URLs (configured in Preferences)"));
-        final JList list1=new JList(names);
+        final JList<String> list1=new JList<>(names);
         final JTextField editField=new JTextField();
         final JCheckBox check1=new JCheckBox(tr("Ask every time"));
Index: applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java	(revision 30459)
+++ applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java	(revision 30532)
@@ -8,4 +8,5 @@
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -13,5 +14,4 @@
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import javax.swing.JOptionPane;
@@ -24,4 +24,5 @@
 import org.openstreetmap.josm.command.DeleteCommand;
 import org.openstreetmap.josm.command.MoveCommand;
+import org.openstreetmap.josm.corrector.UserCancelException;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Node;
@@ -29,14 +30,11 @@
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
-import org.openstreetmap.josm.data.osm.RelationToChildReference;
 import org.openstreetmap.josm.data.osm.TagCollection;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.DefaultNameFormatter;
+import org.openstreetmap.josm.gui.Notification;
 import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog;
-import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil;
 
 import edu.princeton.cs.algs4.AssignmentProblem;
-import org.openstreetmap.josm.gui.Notification;
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -45,5 +43,4 @@
  */
 public final class ReplaceGeometryUtils {
-    private static final String TITLE = tr("Replace Geometry");
     /**
      * Replace new or uploaded object with new object
@@ -168,10 +165,10 @@
 
         // merge tags
-        Collection<Command> tagResolutionCommands = getTagConflictResolutionCommands(subjectNode, referenceObject);
-        if (tagResolutionCommands == null) {
+        try {
+            commands.addAll(getTagConflictResolutionCommands(subjectNode, referenceObject));
+        } catch (UserCancelException e) {
             // user canceled tag merge dialog
             return null;
         }
-        commands.addAll(tagResolutionCommands);
 
         // replace sacrificial node in way with node that is being upgraded
@@ -254,10 +251,10 @@
                 
         // merge tags
-        Collection<Command> tagResolutionCommands = getTagConflictResolutionCommands(referenceWay, subjectWay);
-        if (tagResolutionCommands == null) {
+        try {
+            commands.addAll(getTagConflictResolutionCommands(referenceWay, subjectWay));
+        } catch (UserCancelException e) {
             // user canceled tag merge dialog
             return null;
         }
-        commands.addAll(tagResolutionCommands);
         
         // Prepare a list of nodes that are not used anywhere except in the way
@@ -452,47 +449,13 @@
      * @param source object tags are merged from
      * @param target object tags are merged to
-     * @return
-     */
-    protected static List<Command> getTagConflictResolutionCommands(OsmPrimitive source, OsmPrimitive target) {
-        // determine if the same key in each object has different values
-        boolean keysWithMultipleValues;
-        Set<OsmPrimitive> set = new HashSet<OsmPrimitive>();
-        set.add(source);
-        set.add(target);
-        TagCollection tagCol = TagCollection.unionOfAllPrimitives(set);
-        Set<String> keys = tagCol.getKeysWithMultipleValues();
-        keysWithMultipleValues = !keys.isEmpty();
-            
+     * @return The list of {@link Command commands} needed to apply resolution actions.
+     * @throws UserCancelException If the user cancelled a dialog.
+     */
+    protected static List<Command> getTagConflictResolutionCommands(OsmPrimitive source, OsmPrimitive target) throws UserCancelException {
         Collection<OsmPrimitive> primitives = Arrays.asList(source, target);
-        
-        Set<RelationToChildReference> relationToNodeReferences = RelationToChildReference.getRelationToChildReferences(primitives);
-
-        // build the tag collection
-        TagCollection tags = TagCollection.unionOfAllPrimitives(primitives);
-        TagConflictResolutionUtil.combineTigerTags(tags);
-        TagConflictResolutionUtil.normalizeTagCollectionBeforeEditing(tags, primitives);
-        TagCollection tagsToEdit = new TagCollection(tags);
-        TagConflictResolutionUtil.completeTagCollectionForEditing(tagsToEdit);
-
         // launch a conflict resolution dialog, if necessary
-        CombinePrimitiveResolverDialog dialog = CombinePrimitiveResolverDialog.getInstance();
-        dialog.getTagConflictResolverModel().populate(tagsToEdit, tags.getKeysWithMultipleValues());
-        dialog.getRelationMemberConflictResolverModel().populate(relationToNodeReferences);
-        dialog.setTargetPrimitive(target);
-        dialog.prepareDefaultDecisions();
-
-        // conflict resolution is necessary if there are conflicts in the merged tags
-        // or if both objects have relation memberships
-        if (keysWithMultipleValues || 
-                (!RelationToChildReference.getRelationToChildReferences(source).isEmpty() &&
-                 !RelationToChildReference.getRelationToChildReferences(target).isEmpty())) {
-            dialog.setVisible(true);
-            if (dialog.isCanceled()) {
-                return null;
-            }
-        }
-        return dialog.buildResolutionCommands();
-    }
-
+        return CombinePrimitiveResolverDialog.launchIfNecessary(
+                TagCollection.unionOfAllPrimitives(primitives), primitives, Collections.singleton(target));
+    }
     
     /**
