Index: trunk/src/org/openstreetmap/josm/command/Command.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/Command.java	(revision 13158)
+++ trunk/src/org/openstreetmap/josm/command/Command.java	(revision 13173)
@@ -20,7 +20,4 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.OsmPrimitiveVisitor;
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 
@@ -129,37 +126,6 @@
     private Map<OsmPrimitive, PrimitiveData> cloneMap = new HashMap<>();
 
-    /**
-     * the layer which this command is applied to
-     * @deprecated to be removed end of 2017. Use {@link #data} instead
-     */
-    @Deprecated
-    private final OsmDataLayer layer;
-
     /** the dataset which this command is applied to */
     private final DataSet data;
-
-    /**
-     * Creates a new command in the context of the current edit layer, if any
-     * @deprecated to be removed end of 2017. Use {@link #Command(DataSet)} instead
-     */
-    @Deprecated
-    public Command() {
-        this.layer = MainApplication.getLayerManager().getEditLayer();
-        this.data = layer != null ? layer.data : Main.main.getEditDataSet();
-    }
-
-    /**
-     * Creates a new command in the context of a specific data layer
-     *
-     * @param layer the data layer. Must not be null.
-     * @throws IllegalArgumentException if layer is null
-     * @deprecated to be removed end of 2017. Use {@link #Command(DataSet)} instead
-     */
-    @Deprecated
-    public Command(OsmDataLayer layer) {
-        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
-        this.layer = layer;
-        this.data = layer.data;
-    }
 
     /**
@@ -172,5 +138,4 @@
     public Command(DataSet data) {
         CheckParameterUtil.ensureParameterNotNull(data, "data");
-        this.layer = null;
         this.data = data;
     }
@@ -182,5 +147,4 @@
      * The layer should be invalidated after execution so that it can be re-painted.
      * @return true
-     * @see #invalidateAffectedLayers()
      */
     public boolean executeCommand() {
@@ -212,18 +176,4 @@
 
     /**
-     * Called when a layer has been removed to have the command remove itself from
-     * any buffer if it is not longer applicable to the dataset (e.g. it was part of
-     * the removed layer)
-     *
-     * @param oldLayer the old layer that was removed
-     * @return true if this command is invalid after that layer is removed.
-     * @deprecated to be removed end of 2017.
-     */
-    @Deprecated
-    public boolean invalidBecauselayerRemoved(Layer oldLayer) {
-        return layer == oldLayer;
-    }
-
-    /**
      * Lets other commands access the original version
      * of the object. Usually for undoing.
@@ -233,14 +183,4 @@
     public PrimitiveData getOrig(OsmPrimitive osm) {
         return cloneMap.get(osm);
-    }
-
-    /**
-     * Replies the layer this command is (or was) applied to.
-     * @return the layer this command is (or was) applied to
-     * @deprecated to be removed end of 2017. Use {@link #getAffectedDataSet} instead
-     */
-    @Deprecated
-    protected OsmDataLayer getLayer() {
-        return layer;
     }
 
@@ -313,5 +253,5 @@
     @Override
     public int hashCode() {
-        return Objects.hash(cloneMap, layer, data);
+        return Objects.hash(cloneMap, data);
     }
 
@@ -322,19 +262,5 @@
         Command command = (Command) obj;
         return Objects.equals(cloneMap, command.cloneMap) &&
-               Objects.equals(layer, command.layer) &&
                Objects.equals(data, command.data);
     }
-
-    /**
-     * Invalidate all layers that were affected by this command.
-     * @see Layer#invalidate()
-     * @deprecated to be removed end of 2017.
-     */
-    @Deprecated
-    public void invalidateAffectedLayers() {
-        OsmDataLayer layer = getLayer();
-        if (layer != null) {
-            layer.invalidate();
-        }
-    }
 }
