Index: /trunk/src/org/openstreetmap/josm/actions/CopyAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 5952)
+++ /trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 5953)
@@ -18,6 +18,13 @@
 import org.openstreetmap.josm.tools.Utils;
 
+/**
+ * Copy OSM primitives to clipboard in order to paste them, or their tags, somewhere else.  
+ * @since 404
+ */
 public final class CopyAction extends JosmAction {
 
+    /**
+     * Constructs a new {@code CopyAction}.
+     */
     public CopyAction() {
         super(tr("Copy"), "copy",
@@ -35,4 +42,9 @@
     }
 
+    /**
+     * Copies the given primitive ids to the clipboard.
+     * @param source The OSM data layer source
+     * @param primitives The OSM primitives to copy
+     */
     public static void copy(OsmDataLayer source, Collection<OsmPrimitive> primitives) {
         /* copy ids to the clipboard */
Index: /trunk/src/org/openstreetmap/josm/actions/PasteAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/PasteAction.java	(revision 5952)
+++ /trunk/src/org/openstreetmap/josm/actions/PasteAction.java	(revision 5953)
@@ -30,6 +30,13 @@
 import org.openstreetmap.josm.tools.Shortcut;
 
+/**
+ * Paste OSM primitives from clipboard to the current edit layer.
+ * @since 404
+ */
 public final class PasteAction extends JosmAction implements PasteBufferChangedListener {
 
+    /**
+     * Constructs a new {@code PasteAction}.
+     */
     public PasteAction() {
         super(tr("Paste"), "paste", tr("Paste contents of paste buffer."),
@@ -45,5 +52,11 @@
     }
 
-    public  void pasteData(PrimitiveDeepCopy pasteBuffer, Layer source, ActionEvent e) {
+    /**
+     * Paste OSM primitives from the given paste buffer and OSM data layer source to the current edit layer.
+     * @param pasteBuffer The paste buffer containing primitive ids to copy
+     * @param source The OSM data layer used to look for primitive ids
+     * @param e The ActionEvent that triggered this operation
+     */
+    public void pasteData(PrimitiveDeepCopy pasteBuffer, Layer source, ActionEvent e) {
         /* Find the middle of the pasteBuffer area */
         double maxEast = -1E100, minEast = 1E100, maxNorth = -1E100, minNorth = 1E100;
@@ -87,4 +100,5 @@
         // Make a copy of pasteBuffer and map from old id to copied data id
         List<PrimitiveData> bufferCopy = new ArrayList<PrimitiveData>();
+        List<PrimitiveData> toSelect = new ArrayList<PrimitiveData>();
         Map<Long, Long> newNodeIds = new HashMap<Long, Long>();
         Map<Long, Long> newWayIds = new HashMap<Long, Long>();
@@ -104,4 +118,7 @@
             }
             bufferCopy.add(copy);
+            if (pasteBuffer.getDirectlyAdded().contains(data)) {
+                toSelect.add(copy);
+            }
         }
 
@@ -148,5 +165,5 @@
         /* Now execute the commands to add the duplicated contents of the paste buffer to the map */
 
-        Main.main.undoRedo.add(new AddPrimitivesCommand(bufferCopy));
+        Main.main.undoRedo.add(new AddPrimitivesCommand(bufferCopy, toSelect));
         Main.map.mapView.repaint();
     }
Index: /trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java	(revision 5952)
+++ /trunk/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java	(revision 5953)
@@ -16,30 +16,61 @@
 import org.openstreetmap.josm.data.osm.PrimitiveData;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 
 /**
  * Add primitives to a data layer.
- *
+ * @since 2305
  */
 public class AddPrimitivesCommand extends Command {
 
     private List<PrimitiveData> data = new ArrayList<PrimitiveData>();
+    private Collection<PrimitiveData> toSelect = new ArrayList<PrimitiveData>();
 
     // only filled on undo
     private List<OsmPrimitive> createdPrimitives = null;
+    private Collection<OsmPrimitive> createdPrimitivesToSelect = null;
 
+    /**
+     * Constructs a new {@code AddPrimitivesCommand} to add data to the current edit layer.
+     * @param data The OSM primitives data to add. Must not be {@code null}
+     */
     public AddPrimitivesCommand(List<PrimitiveData> data) {
-        this.data.addAll(data);
+        this(data, data);
+    }
+
+    /**
+     * Constructs a new {@code AddPrimitivesCommand} to add data to the current edit layer.
+     * @param data The OSM primitives to add. Must not be {@code null}
+     * @param toSelect The OSM primitives to select at the end. Can be {@code null}
+     * @since 5953
+     */
+    public AddPrimitivesCommand(List<PrimitiveData> data, List<PrimitiveData> toSelect) {
+        init(data, toSelect);
+    }
+
+    /**
+     * Constructs a new {@code AddPrimitivesCommand} to add data to the given layer.
+     * @param data The OSM primitives data to add. Must not be {@code null}
+     * @param toSelect The OSM primitives to select at the end. Can be {@code null}
+     * @param layer The target data layer. Must not be {@code null}
+     */
+    public AddPrimitivesCommand(List<PrimitiveData> data, List<PrimitiveData> toSelect, OsmDataLayer layer) {
+        super(layer);
+        init(data, toSelect);
     }
     
-    public AddPrimitivesCommand(List<PrimitiveData> data, OsmDataLayer layer) {
-        super(layer);
+    private final void init(List<PrimitiveData> data, List<PrimitiveData> toSelect) {
+        CheckParameterUtil.ensureParameterNotNull(data, "data");
         this.data.addAll(data);
+        if (toSelect != null) {
+            this.toSelect.addAll(toSelect);
+        }
     }
 
-    @SuppressWarnings("null")
     @Override public boolean executeCommand() {
-        List<OsmPrimitive> newPrimitives;
+        Collection<OsmPrimitive> primitivesToSelect;
         if (createdPrimitives == null) { // first time execution
-            newPrimitives = new ArrayList<OsmPrimitive>(data.size());
+            List<OsmPrimitive> newPrimitives = new ArrayList<OsmPrimitive>(data.size());
+            primitivesToSelect = new ArrayList<OsmPrimitive>(toSelect.size());
 
             for (PrimitiveData pd : data) {
@@ -56,7 +87,10 @@
                 }
                 newPrimitives.add(primitive);
+                if (toSelect.contains(pd)) {
+                    primitivesToSelect.add(primitive);
+                }
             }
 
-            //Then load ways and relations
+            // Then load ways and relations
             for (int i=0; i<newPrimitives.size(); i++) {
                 if (!(newPrimitives.get(i) instanceof Node)) {
@@ -70,8 +104,8 @@
                 getLayer().data.addPrimitive(osm);
             }
-            newPrimitives = createdPrimitives;
+            primitivesToSelect = createdPrimitivesToSelect;
         }
 
-        getLayer().data.setSelected(newPrimitives);
+        getLayer().data.setSelected(primitivesToSelect);
         return true;
     }
@@ -82,7 +116,12 @@
         if (createdPrimitives == null) {
             createdPrimitives = new ArrayList<OsmPrimitive>(data.size());
+            createdPrimitivesToSelect = new ArrayList<OsmPrimitive>(toSelect.size());
             
-            for (PrimitiveData p : data) {
-                createdPrimitives.add(ds.getPrimitiveById(p));
+            for (PrimitiveData pd : data) {
+                OsmPrimitive p = ds.getPrimitiveById(pd);
+                createdPrimitives.add(p);
+                if (toSelect.contains(pd)) {
+                    createdPrimitivesToSelect.add(p);
+                }
             }
             createdPrimitives = PurgeCommand.topoSort(createdPrimitives);
@@ -92,4 +131,5 @@
             }
             data = null;
+            toSelect = null;
             
         } else {
