Index: trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java	(revision 7413)
+++ trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java	(revision 7414)
@@ -25,7 +25,11 @@
 /**
  * Exports data to gpx.
+ * @since 78
  */
 public class GpxExportAction extends DiskAccessAction {
 
+    /**
+     * Constructs a new {@code GpxExportAction}.
+     */
     public GpxExportAction() {
         super(tr("Export to GPX..."), "exportgpx", tr("Export the data to GPX file."),
@@ -95,5 +99,4 @@
     /**
      * Refreshes the enabled state
-     *
      */
     @Override
Index: trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 7413)
+++ trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 7414)
@@ -23,4 +23,5 @@
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -95,7 +96,10 @@
  *
  * @author imi
+ * @since 17
  */
 public class OsmDataLayer extends AbstractModifiableLayer implements Listener, SelectionChangedListener {
+    /** Property used to know if this layer has to be saved on disk */
     public static final String REQUIRES_SAVE_TO_DISK_PROP = OsmDataLayer.class.getName() + ".requiresSaveToDisk";
+    /** Property used to know if this layer has to be uploaded */
     public static final String REQUIRES_UPLOAD_TO_SERVER_PROP = OsmDataLayer.class.getName() + ".requiresUploadToServer";
 
@@ -232,8 +236,16 @@
     }
 
+    /**
+     * Replies background color for downloaded areas.
+     * @return background color for downloaded areas. Black by default
+     */
     public static Color getBackgroundColor() {
         return Main.pref.getColor(marktr("background"), Color.BLACK);
     }
 
+    /**
+     * Replies background color for non-downloaded areas.
+     * @return background color for non-downloaded areas. Yellow by default
+     */
     public static Color getOutsideColor() {
         return Main.pref.getColor(marktr("outside downloaded area"), Color.YELLOW);
@@ -257,5 +269,8 @@
 
     /**
-     * Construct a OsmDataLayer.
+     * Construct a new {@code OsmDataLayer}.
+     * @param data OSM data
+     * @param name Layer name
+     * @param associatedFile Associated .osm file (can be null)
      */
     public OsmDataLayer(final DataSet data, final String name, final File associatedFile) {
@@ -524,9 +539,21 @@
     }
 
+    /**
+     * Converts given OSM dataset to GPX data.
+     * @param data OSM dataset
+     * @param file output .gpx file
+     * @return GPX data
+     */
     public static GpxData toGpxData(DataSet data, File file) {
         GpxData gpxData = new GpxData();
         gpxData.storageFile = file;
         HashSet<Node> doneNodes = new HashSet<>();
-        for (Way w : data.getWays()) {
+        waysToGpxData(data.getWays(), gpxData, doneNodes);
+        nodesToGpxData(data.getNodes(), gpxData, doneNodes);
+        return gpxData;
+    }
+
+    private static void waysToGpxData(Collection<Way> ways, GpxData gpxData, HashSet<Node> doneNodes) {
+        for (Way w : ways) {
             if (!w.isUsable()) {
                 continue;
@@ -562,7 +589,12 @@
             gpxData.tracks.add(new ImmutableGpxTrack(trk, trkAttr));
         }
-
-        for (Node n : data.getNodes()) {
-            if (n.isIncomplete() || n.isDeleted() || doneNodes.contains(n)) {
+    }
+
+    private static void nodesToGpxData(Collection<Node> nodes, GpxData gpxData, HashSet<Node> doneNodes) {
+        List<Node> sortedNodes = new ArrayList<>(nodes);
+        sortedNodes.removeAll(doneNodes);
+        Collections.sort(sortedNodes);
+        for (Node n : sortedNodes) {
+            if (n.isIncomplete() || n.isDeleted()) {
                 continue;
             }
@@ -583,12 +615,21 @@
             gpxData.waypoints.add(wpt);
         }
-        return gpxData;
-    }
-
+    }
+
+    /**
+     * Converts OSM data behind this layer to GPX data.
+     * @return GPX data
+     */
     public GpxData toGpxData() {
         return toGpxData(data, getAssociatedFile());
     }
 
+    /**
+     * Action that converts this OSM layer to a GPX layer.
+     */
     public class ConvertToGpxLayerAction extends AbstractAction {
+        /**
+         * Constructs a new {@code ConvertToGpxLayerAction}.
+         */
         public ConvertToGpxLayerAction() {
             super(tr("Convert to GPX layer"), ImageProvider.get("converttogpx"));
@@ -602,4 +643,9 @@
     }
 
+    /**
+     * Determines if this layer contains data at the given coordinate.
+     * @param coor the coordinate
+     * @return {@code true} if data sources bounding boxes contain {@code coor}
+     */
     public boolean containsPoint(LatLon coor) {
         // we'll assume that if this has no data sources
@@ -619,5 +665,5 @@
 
     /**
-     * replies the set of conflicts currently managed in this layer
+     * Replies the set of conflicts currently managed in this layer.
      *
      * @return the set of conflicts currently managed in this layer
@@ -643,4 +689,7 @@
     }
 
+    /**
+     * Actions run after data has been downloaded to this layer.
+     */
     public void onPostDownloadFromServer() {
         setRequiresSaveToFile(true);
@@ -708,8 +757,6 @@
     @Override
     public void projectionChanged(Projection oldValue, Projection newValue) {
-        /*
-         * No reprojection required. The dataset itself is registered as projection
-         * change listener and already got notified.
-         */
+         // No reprojection required. The dataset itself is registered as projection
+         // change listener and already got notified.
     }
 
@@ -719,4 +766,8 @@
     }
 
+    /**
+     * Sets the "discouraged upload" flag.
+     * @param uploadDiscouraged {@code true} if upload of data managed by this layer is discouraged. This feature allows to use "private" data layers.
+     */
     public final void setUploadDiscouraged(boolean uploadDiscouraged) {
         if (uploadDiscouraged ^ isUploadDiscouraged()) {
Index: trunk/src/org/openstreetmap/josm/io/GpxExporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 7413)
+++ trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 7414)
@@ -37,6 +37,11 @@
 import org.openstreetmap.josm.tools.GBC;
 
+/**
+ * Exports data to a .gpx file. Data may be native GPX or OSM data which will be converted.
+ * @since 1949
+ */
 public class GpxExporter extends FileExporter implements GpxConstants {
-    private static final String warningGpl = "<html><font color='red' size='-2'>"
+
+    private static final String GPL_WARNING = "<html><font color='red' size='-2'>"
         + tr("Note: GPL is not compatible with the OSM license. Do not upload GPL licensed tracks.") + "</html>";
 
@@ -74,6 +79,5 @@
         GpxData gpxData;
         // At this moment, we only need to know the attributes of the GpxData,
-        // conversion of OsmDataLayer (if needed) will be done after the dialog
-        // is closed.
+        // conversion of OsmDataLayer (if needed) will be done after the dialog is closed.
         if (layer instanceof GpxLayer) {
             gpxData = ((GpxLayer) layer).data;
@@ -175,5 +179,4 @@
         }
 
-        
         try (OutputStream fo = Compression.getCompressedFileOutputStream(file)) {
             new GpxWriter(fo).write(gpxData);
@@ -194,5 +197,5 @@
         copyrightLabel.setEnabled(enable);
         copyrightYearLabel.setEnabled(enable);
-        warning.setText(enable ? warningGpl : "<html><font size='-2'>&nbsp;</html");
+        warning.setText(enable ? GPL_WARNING : "<html><font size='-2'>&nbsp;</html");
 
         if (enable) {
@@ -220,9 +223,4 @@
     /**
      * Add all those listeners to handle the enable state of the fields.
-     * @param copyrightYearLabel
-     * @param copyrightLabel
-     * @param emailLabel
-     * @param nameLabel
-     * @param warning
      */
     private static void addDependencies(
@@ -299,5 +297,5 @@
                     return;
                 final String[] urls = {
-                        "https://creativecommons.org/licenses/by-sa/2.5",
+                        "https://creativecommons.org/licenses/by-sa/3.0",
                         "http://opendatacommons.org/licenses/odbl/1.0",
                         "public domain",
@@ -329,4 +327,3 @@
         return Main.main.getCurrentDataSet();
     }
-
 }
