Index: trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 9230)
@@ -82,4 +82,5 @@
     /**
      * Open a list of files. The complete list will be passed to batch importers.
+     * Filenames will not be saved in history.
      * @param fileList A list of files
      */
@@ -88,4 +89,9 @@
     }
 
+    /**
+     * Open a list of files. The complete list will be passed to batch importers.
+     * @param fileList A list of files
+     * @param recordHistory {@code true} to save filename in history (default: false)
+     */
     public static void openFiles(List<File> fileList, boolean recordHistory) {
         OpenFileTask task = new OpenFileTask(fileList, null);
@@ -94,4 +100,7 @@
     }
 
+    /**
+     * Task to open files.
+     */
     public static class OpenFileTask extends PleaseWaitRunnable {
         private final List<File> files;
@@ -103,4 +112,10 @@
         private boolean recordHistory;
 
+        /**
+         * Constructs a new {@code OpenFileTask}.
+         * @param files files to open
+         * @param fileFilter file filter
+         * @param title message for the user
+         */
         public OpenFileTask(final List<File> files, final FileFilter fileFilter, final String title) {
             super(title, false /* don't ignore exception */);
@@ -130,4 +145,9 @@
         }
 
+        /**
+         * Constructs a new {@code OpenFileTask}.
+         * @param files files to open
+         * @param fileFilter file filter
+         */
         public OpenFileTask(List<File> files, FileFilter fileFilter) {
             this(files, fileFilter, tr("Opening files"));
@@ -135,6 +155,6 @@
 
         /**
-         * save filename in history (for list of recently opened files)
-         * default: false
+         * Sets whether to save filename in history (for list of recently opened files).
+         * @param recordHistory {@code true} to save filename in history (default: false)
          */
         public void setRecordHistory(boolean recordHistory) {
@@ -142,4 +162,8 @@
         }
 
+        /**
+         * Determines if filename must be saved in history (for list of recently opened files).
+         * @return {@code true} if filename must be saved in history
+         */
         public boolean isRecordHistory() {
             return recordHistory;
@@ -319,4 +343,9 @@
         }
 
+        /**
+         * Import data files with the given importer.
+         * @param importer file importer
+         * @param files data files to import
+         */
         public void importData(FileImporter importer, List<File> files) {
             if (importer.isBatchImporter()) {
Index: trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java	(revision 9230)
@@ -199,4 +199,5 @@
     /**
      * Collect groups of ways with common nodes in order to orthogonalize each group separately.
+     * @param wayDataList list of ways
      * @return groups of ways with common nodes
      */
@@ -246,4 +247,6 @@
      *      - The same for vertical segments.
      *  5. Rotate back.
+     * @param wayDataList list of ways
+     * @param headingNodes list of heading nodes
      * @return list of commands to perform
      * @throws InvalidUserInputException if selected ways have an angle different from 90 or 180 degrees
@@ -398,5 +401,5 @@
 
     /**
-     * Class contains everything we need to know about a singe way.
+     * Class contains everything we need to know about a single way.
      */
     private static class WayData {
@@ -477,4 +480,5 @@
     /**
      * Make sure angle (up to 2*Pi) is in interval [ 0, 2*Pi ).
+     * @param a angle
      * @return correct angle
      */
@@ -491,4 +495,5 @@
     /**
      * Make sure angle (up to 2*Pi) is in interval ( -Pi, Pi ].
+     * @param a angle
      * @return correct angle
      */
@@ -513,4 +518,7 @@
         /**
          * Rotate counter-clock-wise.
+         * @param pivot pivot
+         * @param en original east/north
+         * @param angle angle, in radians
          * @return new east/north
          */
@@ -541,4 +549,6 @@
      * Recognize angle to be approximately 0, 90, 180 or 270 degrees.
      * returns an integral value, corresponding to a counter clockwise turn.
+     * @param a angle, in radians
+     * @param deltaMax maximum tolerance, in radians
      * @return an integral value, corresponding to a counter clockwise turn
      * @throws RejectedAngleException in case of invalid angle
Index: trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java	(revision 9230)
@@ -59,4 +59,9 @@
         private final List<Tag> tags = new ArrayList<>();
 
+        /**
+         * Constructs a new {@code TagPaster}.
+         * @param source source primitives
+         * @param target target primitives
+         */
         public TagPaster(Collection<PrimitiveData> source, Collection<OsmPrimitive> target) {
             this.source = source;
@@ -69,5 +74,5 @@
          * @return true if the source for tag pasting is heterogeneous
          */
-        protected boolean isHeteogeneousSource() {
+        protected boolean isHeterogeneousSource() {
             int count = 0;
             count = !getSourcePrimitivesByType(OsmPrimitiveType.NODE).isEmpty() ? count + 1 : count;
@@ -230,7 +235,11 @@
         }
 
+        /**
+         * Performs the paste operation.
+         * @return list of tags
+         */
         public List<Tag> execute() {
             tags.clear();
-            if (isHeteogeneousSource()) {
+            if (isHeterogeneousSource()) {
                 pasteFromHeterogeneousSource();
             } else {
@@ -258,6 +267,10 @@
     }
 
-    /** Paste tags from arbitrary text, not using JOSM buffer
+    /**
+     * Paste tags from arbitrary text, not using JOSM buffer
+     * @param selection selected primitives
+     * @param text text containing tags
      * @return true if action was successful
+     * @see TextTagParser#readTagsFromText
      */
     public static boolean pasteTagsFromText(Collection<OsmPrimitive> selection, String text) {
@@ -278,5 +291,6 @@
     }
 
-    /** Paste tags from JOSM buffer
+    /**
+     * Paste tags from JOSM buffer
      * @param selection objects that will have the tags
      * @return false if JOSM buffer was empty
@@ -297,4 +311,5 @@
     /**
      * Create and execute SequenceCommand with descriptive title
+     * @param selection selected primitives
      * @param commands the commands to perform in a sequential command
      */
Index: trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 9230)
@@ -32,6 +32,8 @@
 
     /**
+     * Constructs a new {@code RenameLayerAction}.
      * @param file The file of the original location of this layer.
      *      If null, no possibility to "rename the file as well" is provided.
+     * @param layer layer to rename
      */
     public RenameLayerAction(File file, Layer layer) {
Index: trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java	(revision 9230)
@@ -27,4 +27,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.data.projection.Ellipsoid;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
@@ -217,4 +218,5 @@
      * @param to the upper index
      * @param threshold the max error threshold
+     * @param simplifiedNodes list that will contain resulting nodes
      */
     protected void buildSimplifiedNodeList(List<Node> wnew, int from, int to, double threshold, List<Node> simplifiedNodes) {
@@ -228,5 +230,5 @@
         for (int i = from + 1; i < to; i++) {
             Node n = wnew.get(i);
-            double xte = Math.abs(EARTH_RAD
+            double xte = Math.abs(Ellipsoid.WGS84.a
                     * xtd(fromN.getCoor().lat() * Math.PI / 180, fromN.getCoor().lon() * Math.PI / 180, toN.getCoor().lat() * Math.PI
                             / 180, toN.getCoor().lon() * Math.PI / 180, n.getCoor().lat() * Math.PI / 180, n.getCoor().lon() * Math.PI
@@ -253,6 +255,4 @@
     }
 
-    public static final double EARTH_RAD = 6378137.0;
-
     /* From Aviaton Formulary v1.3
      * http://williams.best.vwh.net/avform.htm
Index: trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 9230)
@@ -55,5 +55,4 @@
  * original order.  Selected nodes at the end of a way are ignored.
  */
-
 public class SplitWayAction extends JosmAction {
 
@@ -320,4 +319,5 @@
         /**
          * Returns a strategy which selects the way chunk with the highest node count to keep.
+         * @return strategy which selects the way chunk with the highest node count to keep
          */
         public static Strategy keepLongestChunk() {
@@ -338,4 +338,5 @@
         /**
          * Returns a strategy which selects the first way chunk.
+         * @return strategy which selects the first way chunk
          */
         public static Strategy keepFirstChunk() {
@@ -348,5 +349,4 @@
         }
     }
-
 
     /**
Index: trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 9230)
@@ -165,4 +165,5 @@
      * Assumes there is one tagged Node stored in selectedNode that it will try to unglue.
      * (i.e. copy node and remove all tags from the old one. Relations will not be removed)
+     * @param e event that trigerred the action
      */
     private void unglueNode(ActionEvent e) {
@@ -217,12 +218,11 @@
      * Checks only if the number and type of items selected looks good.
      *
-     * If this method returns "true", selectedNode and selectedWay will
-     * be set.
+     * If this method returns "true", selectedNode and selectedWay will be set.
      *
      * Returns true if either one node is selected or one node and one
      * way are selected and the node is part of the way.
      *
-     * The way will be put into the object variable "selectedWay", the
-     * node into "selectedNode".
+     * The way will be put into the object variable "selectedWay", the node into "selectedNode".
+     * @param selection selected primitives
      * @return true if either one node is selected or one node and one way are selected and the node is part of the way
      */
@@ -255,10 +255,9 @@
      * Checks only if the number and type of items selected looks good.
      *
-     * Returns true if one way and any number of nodes that are part of
-     * that way are selected. Note: "any" can be none, then all nodes of
-     * the way are used.
-     *
-     * The way will be put into the object variable "selectedWay", the
-     * nodes into "selectedNodes".
+     * Returns true if one way and any number of nodes that are part of that way are selected.
+     * Note: "any" can be none, then all nodes of the way are used.
+     *
+     * The way will be put into the object variable "selectedWay", the nodes into "selectedNodes".
+     * @param selection selected primitives
      * @return true if one way and any number of nodes that are part of that way are selected
      */
@@ -298,5 +297,5 @@
      * dupe the given node of the given way
      *
-     * assume that OrginalNode is in the way
+     * assume that originalNode is in the way
      * <ul>
      * <li>the new node will be put into the parameter newNodes.</li>
@@ -304,5 +303,9 @@
      * <li>the changed way will be returned and must be put into cmds by the caller!</li>
      * </ul>
-     * @return new way
+     * @param originalNode original node to duplicate
+     * @param w parent way
+     * @param cmds List of commands that will contain the new "add node" command
+     * @param newNodes List of nodes that will contain the new node
+     * @return new way The modified way. Change command mus be handled by the caller
      */
     private static Way modifyWay(Node originalNode, Way w, List<Command> cmds, List<Node> newNodes) {
@@ -327,4 +330,7 @@
     /**
      * put all newNodes into the same relation(s) that originalNode is in
+     * @param originalNode original node to duplicate
+     * @param cmds List of commands that will contain the new "change relation" commands
+     * @param newNodes List of nodes that contain the new node
      */
     private void fixRelations(Node originalNode, List<Command> cmds, List<Node> newNodes) {
@@ -343,12 +349,16 @@
                         rolesToReAdd = new HashMap<>();
                     }
-                    rolesToReAdd.put(rm.getRole(), i);
+                    if (rolesToReAdd != null) {
+                        rolesToReAdd.put(rm.getRole(), i);
+                    }
                 }
                 i++;
             }
             if (newRel != null) {
-                for (Node n : newNodes) {
-                    for (Map.Entry<String, Integer> role : rolesToReAdd.entrySet()) {
-                        newRel.addMember(role.getValue() + 1, new RelationMember(role.getKey(), n));
+                if (rolesToReAdd != null) {
+                    for (Node n : newNodes) {
+                        for (Map.Entry<String, Integer> role : rolesToReAdd.entrySet()) {
+                            newRel.addMember(role.getValue() + 1, new RelationMember(role.getKey(), n));
+                        }
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java	(revision 9230)
@@ -125,5 +125,5 @@
      * @param url The URL to be confirmed
      * @return The HTML-formatted confirmation message to be shown to user
-     * @since
+     * @since 5691
      */
     String getConfirmationMessage(URL url);
Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java	(revision 9230)
@@ -120,6 +120,6 @@
 
     /**
-     * Replies the set of ids of all complete, non-new primitives (i.e. those with !
-     * primitive.incomplete)
+     * Replies the set of ids of all complete, non-new primitives (i.e. those with !primitive.incomplete)
+     * @param ds data set
      *
      * @return the set of ids of all complete, non-new primitives
@@ -285,5 +285,5 @@
             for (DownloadTask task : tasks) {
                 if (task instanceof AbstractDownloadTask) {
-                    AbstractDownloadTask absTask = (AbstractDownloadTask) task;
+                    AbstractDownloadTask<?> absTask = (AbstractDownloadTask<?>) task;
                     if (absTask.isCanceled() || absTask.isFailed())
                         return;
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 9230)
@@ -256,4 +256,6 @@
      * occurs. We can use AWTEvent to catch those but still lack a proper
      * mouseevent. Instead we copy the previous event and only update the modifiers.
+     * @param e mouse event
+     * @param modifiers mouse modifiers
      */
     private void giveUserFeedback(MouseEvent e, int modifiers) {
@@ -266,4 +268,5 @@
      * calls the cursor and target highlighting routines. Extracts modifiers
      * from mouse event.
+     * @param e mouse event
      */
     private void giveUserFeedback(MouseEvent e) {
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 9230)
@@ -894,6 +894,8 @@
 
     /**
-     * if one of the ends of @param way is given @param node ,
+     * if one of the ends of {@code way} is given {@code  node},
      * then set  currentBaseNode = node and previousNode = adjacent node of way
+     * @param way way to continue
+     * @param node starting node
      */
     private void continueWayFromNode(Way way, Node node) {
@@ -926,4 +928,5 @@
 
     /**
+     * @param n node
      * @return If the node is the end of exactly one way, return this.
      *  <code>null</code> otherwise.
Index: trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java	(revision 9230)
@@ -17,8 +17,7 @@
  *   {@link OsmPrimitive} from the dataset in another layer or the one retrieved from the server.</li>
  * </ul>
- *
- *
+ * @since 1750
  */
-public class  Conflict<T extends OsmPrimitive> {
+public class Conflict<T extends OsmPrimitive> {
     private final T my;
     private final T their;
Index: trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShift.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShift.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShift.java	(revision 9230)
@@ -23,4 +23,5 @@
 
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.projection.Ellipsoid;
 
 /**
@@ -39,5 +40,5 @@
     private static final long serialVersionUID = 1L;
 
-    private static final double METRE_PER_SECOND = 2.0 * Math.PI * 6378137.0 / 3600.0 / 360.0;
+    private static final double METRE_PER_SECOND = 2.0 * Math.PI * Ellipsoid.WGS84.a / 3600.0 / 360.0;
     private static final double RADIANS_PER_SECOND = 2.0 * Math.PI / 3600.0 / 360.0;
     private double lon;
Index: trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java	(revision 9230)
@@ -281,4 +281,5 @@
      * Distributes a "bounding box changed" from one DownloadSelection
      * object to the others, so they may update or clear their input fields.
+     * @param b new current bounds
      *
      * @param eventSource - the DownloadSelection object that fired this notification.
@@ -429,4 +430,8 @@
     }
 
+    /**
+     * Automatically opens the download dialog, if autorun is enabled.
+     * @see #isAutorunEnabled
+     */
     public static void autostartIfNeeded() {
         if (isAutorunEnabled()) {
Index: trunk/src/org/openstreetmap/josm/gui/layer/MapViewPaintable.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/MapViewPaintable.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/gui/layer/MapViewPaintable.java	(revision 9230)
@@ -11,7 +11,8 @@
     /**
      * Paint the dataset using the engine set.
+     * @param g Graphics
      * @param mv The object that can translate GeoPoints to screen coordinates.
+     * @param bbox Bounding box
      */
     void paint(Graphics2D g, MapView mv, Bounds bbox);
-
 }
Index: trunk/src/org/openstreetmap/josm/gui/util/KeyPressReleaseListener.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/KeyPressReleaseListener.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/gui/util/KeyPressReleaseListener.java	(revision 9230)
@@ -5,5 +5,6 @@
 
 /**
- * Interface that is used to detect key pressing and releasing
+ * Interface that is used to detect key pressing and releasing.
+ * @since 7219
  */
 public interface KeyPressReleaseListener {
@@ -11,4 +12,5 @@
      * This is called when key press event is actually pressed
      * (no fake events while holding key)
+     * @param e key event
      */
     void doKeyPressed(KeyEvent e);
@@ -17,4 +19,5 @@
      * This is called when key press event is actually released
      * (no fake events while holding key)
+     * @param e key event
      */
     void doKeyReleased(KeyEvent e);
Index: trunk/src/org/openstreetmap/josm/tools/HttpClient.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 9230)
@@ -437,5 +437,5 @@
     /**
      * Sets whether not to set header {@code Connection=close}
-     * <p/>
+     * <p>
      * This might fix #7640, see
      * <a href='https://web.archive.org/web/20140118201501/http://www.tikalk.com/java/forums/httpurlconnection-disable-keep-alive'>here</a>.
Index: trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 9229)
+++ trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 9230)
@@ -12,4 +12,5 @@
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.projection.Ellipsoid;
 
 public final class OsmUrlToBounds {
@@ -188,7 +189,4 @@
     }
 
-    /** radius of the earth */
-    public static final double R = 6378137.0;
-
     public static Bounds positionToBounds(final double lat, final double lon, final int zoom) {
         int tileSizeInPixels = 256;
@@ -207,18 +205,20 @@
             width = 640;
         }
-        double scale = (1 << zoom) * tileSizeInPixels / (2 * Math.PI * R);
+        double scale = (1 << zoom) * tileSizeInPixels / (2 * Math.PI * Ellipsoid.WGS84.a);
         double deltaX = width / 2.0 / scale;
         double deltaY = height / 2.0 / scale;
-        double x = Math.toRadians(lon) * R;
+        double x = Math.toRadians(lon) * Ellipsoid.WGS84.a;
         double y = mercatorY(lat);
-        return new Bounds(invMercatorY(y - deltaY), Math.toDegrees(x - deltaX) / R, invMercatorY(y + deltaY), Math.toDegrees(x + deltaX) / R);
+        return new Bounds(
+                invMercatorY(y - deltaY), Math.toDegrees(x - deltaX) / Ellipsoid.WGS84.a,
+                invMercatorY(y + deltaY), Math.toDegrees(x + deltaX) / Ellipsoid.WGS84.a);
     }
 
     public static double mercatorY(double lat) {
-        return Math.log(Math.tan(Math.PI/4 + Math.toRadians(lat)/2)) * R;
+        return Math.log(Math.tan(Math.PI/4 + Math.toRadians(lat)/2)) * Ellipsoid.WGS84.a;
     }
 
     public static double invMercatorY(double north) {
-        return Math.toDegrees(Math.atan(Math.sinh(north / R)));
+        return Math.toDegrees(Math.atan(Math.sinh(north / Ellipsoid.WGS84.a)));
     }
 
