Index: /trunk/src/org/openstreetmap/josm/io/OsmExporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmExporter.java	(revision 7560)
+++ /trunk/src/org/openstreetmap/josm/io/OsmExporter.java	(revision 7561)
@@ -22,4 +22,8 @@
 import org.openstreetmap.josm.tools.Utils;
 
+/**
+ * Exports data to an .Osm file.
+ * @since 1949
+ */
 public class OsmExporter extends FileExporter {
 
@@ -31,4 +35,8 @@
     }
 
+    /**
+     * Constructs a new {@code OsmExporter}.
+     * @param filter The extension file filter
+     */
     public OsmExporter(ExtensionFileFilter filter) {
         super(filter);
@@ -47,13 +55,25 @@
     }
 
+    /**
+     * Exports OSM data to the given file.
+     * @param file Output file
+     * @param layer Data layer. Must be an instance of {@link OsmDataLayer}.
+     * @param noBackup if {@code true}, the potential backup file created if the output file already exists will be deleted
+     *                 after a successful export
+     * @throws IllegalArgumentException if {@code layer} is not an instance of {@code OsmDataLayer}
+     */
     public void exportData(File file, Layer layer, boolean noBackup) throws IllegalArgumentException {
-        if (layer instanceof OsmDataLayer) {
-            save(file, (OsmDataLayer) layer, noBackup);
-        } else
+        checkOsmDataLayer(layer);
+        save(file, (OsmDataLayer) layer, noBackup);
+    }
+
+    protected static final void checkOsmDataLayer(Layer layer) throws IllegalArgumentException {
+        if (!(layer instanceof OsmDataLayer)) {
             throw new IllegalArgumentException(MessageFormat.format("Expected instance of OsmDataLayer. Got ''{0}''.", layer
                     .getClass().getName()));
+        }
     }
 
-    protected OutputStream getOutputStream(File file) throws FileNotFoundException, IOException {
+    protected static OutputStream getOutputStream(File file) throws FileNotFoundException, IOException {
         return Compression.getCompressedFileOutputStream(file);
     }
