Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31438)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31439)
@@ -250,4 +250,7 @@
     /**
      * Sets the displayed map pane and zoom level so that all chosen map elements are visible.
+     * @param markers whether to consider markers
+     * @param rectangles whether to consider rectangles
+     * @param polygons whether to consider polygons
      */
     public void setDisplayToFitMapElements(boolean markers, boolean rectangles, boolean polygons) {
@@ -262,8 +265,8 @@
             return;
 
-        int x_min = Integer.MAX_VALUE;
-        int y_min = Integer.MAX_VALUE;
-        int x_max = Integer.MIN_VALUE;
-        int y_max = Integer.MIN_VALUE;
+        int xMin = Integer.MAX_VALUE;
+        int yMin = Integer.MAX_VALUE;
+        int xMax = Integer.MIN_VALUE;
+        int yMax = Integer.MIN_VALUE;
         int mapZoomMax = tileController.getTileSource().getMaxZoom();
 
@@ -273,8 +276,8 @@
                     if (marker.isVisible()) {
                         Point p = tileSource.latLonToXY(marker.getCoordinate(), mapZoomMax);
-                        x_max = Math.max(x_max, p.x);
-                        y_max = Math.max(y_max, p.y);
-                        x_min = Math.min(x_min, p.x);
-                        y_min = Math.min(y_min, p.y);
+                        xMax = Math.max(xMax, p.x);
+                        yMax = Math.max(yMax, p.y);
+                        xMin = Math.min(xMin, p.x);
+                        yMin = Math.min(yMin, p.y);
                     }
                 }
@@ -288,8 +291,8 @@
                         Point bottomRight = tileSource.latLonToXY(rectangle.getBottomRight(), mapZoomMax);
                         Point topLeft = tileSource.latLonToXY(rectangle.getTopLeft(), mapZoomMax);
-                        x_max = Math.max(x_max, bottomRight.x);
-                        y_max = Math.max(y_max, topLeft.y);
-                        x_min = Math.min(x_min, topLeft.x);
-                        y_min = Math.min(y_min, bottomRight.y);
+                        xMax = Math.max(xMax, bottomRight.x);
+                        yMax = Math.max(yMax, topLeft.y);
+                        xMin = Math.min(xMin, topLeft.x);
+                        yMin = Math.min(yMin, bottomRight.y);
                     }
                 }
@@ -303,8 +306,8 @@
                         for (ICoordinate c : polygon.getPoints()) {
                             Point p = tileSource.latLonToXY(c, mapZoomMax);
-                            x_max = Math.max(x_max, p.x);
-                            y_max = Math.max(y_max, p.y);
-                            x_min = Math.min(x_min, p.x);
-                            y_min = Math.min(y_min, p.y);
+                            xMax = Math.max(xMax, p.x);
+                            yMax = Math.max(yMax, p.y);
+                            xMin = Math.min(xMin, p.x);
+                            yMin = Math.min(yMin, p.y);
                         }
                     }
@@ -316,6 +319,6 @@
         int width = Math.max(0, getWidth());
         int newZoom = mapZoomMax;
-        int x = x_max - x_min;
-        int y = y_max - y_min;
+        int x = xMax - xMin;
+        int y = yMax - yMin;
         while (x > width || y > height) {
             newZoom--;
@@ -323,6 +326,6 @@
             y >>= 1;
         }
-        x = x_min + (x_max - x_min) / 2;
-        y = y_min + (y_max - y_min) / 2;
+        x = xMin + (xMax - xMin) / 2;
+        y = yMin + (yMax - yMin) / 2;
         int z = 1 << (mapZoomMax - newZoom);
         x /= z;
@@ -416,9 +419,19 @@
         p.translate(-(center.x - getWidth() / 2), -(center.y - getHeight() /2));
 
-        if (checkOutside) {
-            if (p.x < 0 || p.y < 0 || p.x > getWidth() || p.y > getHeight())
-                return null;
+        if (checkOutside && (p.x < 0 || p.y < 0 || p.x > getWidth() || p.y > getHeight())) {
+            return null;
         }
         return p;
+    }
+
+    /**
+     * Calculates the position on the map of a given coordinate
+     *
+     * @param lat latitude
+     * @param lon longitude
+     * @return point on the map or <code>null</code> if the point is not visible
+     */
+    public Point getMapPosition(double lat, double lon) {
+        return getMapPosition(lat, lon, true);
     }
 
@@ -435,7 +448,6 @@
         Point p = tileSource.latLonToXY(lat, lon, zoom);
         int y = p.y - center.y - getHeight() / 2;
-        if (checkOutside) {
-            if (y < 0 || y > getHeight())
-                return null;
+        if (checkOutside && (y < 0 || y > getHeight())) {
+            return null;
         }
         return y;
@@ -455,7 +467,6 @@
         int y = tileSource.latToY(lat + offset, zoom);
         y -= center.y - getHeight() / 2;
-        if (checkOutside) {
-            if (y < 0 || y > getHeight())
-                return null;
+        if (checkOutside && (y < 0 || y > getHeight())) {
+            return null;
         }
         return y;
@@ -465,16 +476,6 @@
      * Calculates the position on the map of a given coordinate
      *
-     * @param lat latitude
-     * @param lon longitude
-     * @return point on the map or <code>null</code> if the point is not visible
-     */
-    public Point getMapPosition(double lat, double lon) {
-        return getMapPosition(lat, lon, true);
-    }
-
-    /**
-     * Calculates the position on the map of a given coordinate
-     *
      * @param marker MapMarker object that define the x,y coordinate
+     * @param p coordinate
      * @return Integer the radius in pixels
      */
@@ -669,4 +670,6 @@
     /**
      * Paint a single marker.
+     * @param g Graphics used for painting
+     * @param marker marker to paint
      */
     protected void paintMarker(Graphics g, MapMarker marker) {
@@ -702,4 +705,6 @@
     /**
      * Paint a single rectangle.
+     * @param g Graphics used for painting
+     * @param rectangle rectangle to paint
      */
     protected void paintRectangle(Graphics g, MapRectangle rectangle) {
@@ -732,5 +737,4 @@
                         rectangle.paint(g, pTopLeft, pBottomRight);
                     }
-
                 }
             }
@@ -740,4 +744,6 @@
     /**
      * Paint a single polygon.
+     * @param g Graphics used for painting
+     * @param polygon polygon to paint
      */
     protected void paintPolygon(Graphics g, MapPolygon polygon) {
@@ -1087,4 +1093,5 @@
     /**
      * Return tile information caching class
+     * @return tile cache
      * @see TileController#getTileCache()
      */
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31438)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31439)
@@ -90,4 +90,5 @@
      * Tries to get tiles of a lower or higher zoom level (one or two level
      * difference) from cache and use it as a placeholder until the tile has been loaded.
+     * @param cache Tile cache
      */
     public void loadPlaceholderFromCache(TileCache cache) {
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileJob.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileJob.java	(revision 31438)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileJob.java	(revision 31439)
@@ -26,5 +26,5 @@
     /**
      * submits download job to backend.
-     * @param force true if the load should skip all the caches (local & remote)
+     * @param force true if the load should skip all the caches (local &amp; remote)
      */
     void submit(boolean force);
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 31438)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 31439)
@@ -59,4 +59,5 @@
     /**
      * Constructs a new {@code BingAerialTileSource}.
+     * @param info imagery info
      */
     public BingAerialTileSource(TileSourceInfo info) {
