Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/FeatureAdapter.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/FeatureAdapter.java	(revision 31437)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/FeatureAdapter.java	(revision 31438)
@@ -11,8 +11,12 @@
 public final class FeatureAdapter {
 
+    private static BrowserAdapter browserAdapter = new DefaultBrowserAdapter();
+    private static TranslationAdapter translationAdapter = new DefaultTranslationAdapter();
+    private static LoggingAdapter loggingAdapter = new DefaultLoggingAdapter();
+
     private FeatureAdapter() {
         // private constructor for utility classes
     }
-    
+
     public interface BrowserAdapter {
         void openLink(String url);
@@ -27,8 +31,4 @@
         Logger getLogger(String name);
     }
-
-    private static BrowserAdapter browserAdapter = new DefaultBrowserAdapter();
-    private static TranslationAdapter translationAdapter = new DefaultTranslationAdapter();
-    private static LoggingAdapter loggingAdapter = new DefaultLoggingAdapter();
 
     public static void registerBrowserAdapter(BrowserAdapter browserAdapter) {
@@ -51,5 +51,5 @@
         return translationAdapter.tr(text, objects);
     }
-    
+
     public static Logger getLogger(String name) {
         return loggingAdapter.getLogger(name);
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31437)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31438)
@@ -373,5 +373,5 @@
      */
     public ICoordinate getPosition() {
-        return tileSource.XYToLatLon(center, zoom);
+        return tileSource.xyToLatLon(center, zoom);
     }
 
@@ -400,5 +400,5 @@
         int x = center.x + mapPointX - getWidth() / 2;
         int y = center.y + mapPointY - getHeight() / 2;
-        return tileSource.XYToLatLon(x, y, zoom);
+        return tileSource.xyToLatLon(x, y, zoom);
     }
 
@@ -547,6 +547,6 @@
         int tilex = center.x / tilesize;
         int tiley = center.y / tilesize;
-        int off_x = (center.x % tilesize);
-        int off_y = (center.y % tilesize);
+        int off_x = center.x % tilesize;
+        int off_y = center.y % tilesize;
 
         int w2 = getWidth() / 2;
@@ -599,5 +599,5 @@
                         if (scrollWrapEnabled) {
                             // in case tilex is out of bounds, grab the tile to use for wrapping
-                            int tilexWrap = (((tilex % gridLength) + gridLength) % gridLength);
+                            int tilexWrap = ((tilex % gridLength) + gridLength) % gridLength;
                             tile = tileController.getTile(tilexWrap, tiley, zoom);
                         } else {
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java	(revision 31437)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java	(revision 31438)
@@ -22,17 +22,4 @@
 
     private static int workerThreadMaxCount = 8;
-
-    private final BlockingDeque<TileJob> jobQueue = new LinkedBlockingDeque<>();
-
-    private JobDispatcher() {
-        addWorkerThread().firstThread = true;
-    }
-
-    /**
-     * @return the singelton instance of the {@link JobDispatcher}
-     */
-    public static JobDispatcher getInstance() {
-        return instance;
-    }
 
     /**
@@ -64,4 +51,17 @@
     private int workerThreadId = 0;
 
+    private final BlockingDeque<TileJob> jobQueue = new LinkedBlockingDeque<>();
+
+    private JobDispatcher() {
+        addWorkerThread().firstThread = true;
+    }
+
+    /**
+     * @return the singelton instance of the {@link JobDispatcher}
+     */
+    public static JobDispatcher getInstance() {
+        return instance;
+    }
+
     /**
      * Removes all jobs from the queue that are currently not being processed.
@@ -73,4 +73,5 @@
     /**
      * Function to set the maximum number of workers for tile loading.
+     * @param workers maximum number of workers
      */
     public static void setMaxWorkers(int workers) {
@@ -180,4 +181,3 @@
         }
     }
-
 }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmMercator.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmMercator.java	(revision 31437)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmMercator.java	(revision 31438)
@@ -66,5 +66,5 @@
 
     public int falseNorthing(int aZoomlevel) {
-        return (-1 * getMaxPixels(aZoomlevel) / 2);
+        return -1 * getMaxPixels(aZoomlevel) / 2;
     }
 
@@ -81,8 +81,8 @@
      */
     public double getDistance(int x1, int y1, int x2, int y2, int zoomLevel) {
-        double la1 = YToLat(y1, zoomLevel);
-        double lo1 = XToLon(x1, zoomLevel);
-        double la2 = YToLat(y2, zoomLevel);
-        double lo2 = XToLon(x2, zoomLevel);
+        double la1 = yToLat(y1, zoomLevel);
+        double lo1 = xToLon(x1, zoomLevel);
+        double la2 = yToLat(y2, zoomLevel);
+        double lo2 = xToLon(x2, zoomLevel);
 
         return getDistance(la1, lo1, la2, lo2);
@@ -108,5 +108,5 @@
                 * Math.cos(aEndLong - aStartLong));
 
-        return (EARTH_RADIUS * distance);
+        return EARTH_RADIUS * distance;
     }
 
@@ -126,4 +126,5 @@
      * @param aLongitude
      *            [-180..180]
+     * @param aZoomlevel zoom level
      * @return [0..2^Zoomlevel*TILE_SIZE[
      */
@@ -149,4 +150,5 @@
      * @param aLat
      *            [-90...90]
+     * @param aZoomlevel zoom level
      * @return [0..2^Zoomlevel*TILE_SIZE[
      */
@@ -178,7 +180,8 @@
      * @param aX
      *            [0..2^Zoomlevel*TILE_WIDTH[
+     * @param aZoomlevel zoom level
      * @return ]-180..180[
      */
-    public double XToLon(int aX, int aZoomlevel) {
+    public double xToLon(int aX, int aZoomlevel) {
         return ((360d * aX) / getMaxPixels(aZoomlevel)) - 180.0;
     }
@@ -189,7 +192,8 @@
      * @param aY
      *            [0..2^Zoomlevel*TILE_WIDTH[
+     * @param aZoomlevel zoom level
      * @return [MIN_LAT..MAX_LAT] is about [-85..85]
      */
-    public double YToLat(int aY, int aZoomlevel) {
+    public double yToLat(int aY, int aZoomlevel) {
         aY += falseNorthing(aZoomlevel);
         double latitude = (Math.PI / 2) - (2 * Math.atan(Math.exp(-1.0 * aY / radius(aZoomlevel))));
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31437)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31438)
@@ -33,13 +33,4 @@
      */
     public static final BufferedImage ERROR_IMAGE = loadImage("images/error.png");
-
-    private static BufferedImage loadImage(String path) {
-        try {
-            return ImageIO.read(JMapViewer.class.getResourceAsStream(path));
-        } catch (Exception ex) {
-            ex.printStackTrace();
-            return null;
-        }
-    }
 
     protected TileSource source;
@@ -85,4 +76,13 @@
         this.image = image;
         this.key = getTileKey(source, xtile, ytile, zoom);
+    }
+
+    private static BufferedImage loadImage(String path) {
+        try {
+            return ImageIO.read(JMapViewer.class.getResourceAsStream(path));
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            return null;
+        }
     }
 
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileSource.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileSource.java	(revision 31437)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileSource.java	(revision 31438)
@@ -170,5 +170,5 @@
      * @param aZoomlevel zoom level
      * @return ]-180..180[
-     * @deprecated use {@link #XYToLatLon(int, int, int)} instead
+     * @deprecated use {@link #xyToLatLon(int, int, int)} instead
      */
     @Deprecated
@@ -180,5 +180,5 @@
      * @param aZoomlevel zoom level
      * @return [MIN_LAT..MAX_LAT]
-     * @deprecated use {@link #XYToLatLon(int, int, int)} instead
+     * @deprecated use {@link #xyToLatLon(int, int, int)} instead
      */
     @Deprecated
@@ -190,5 +190,5 @@
      * @return WGS84 Coordinates of given point
      */
-    ICoordinate XYToLatLon(Point point, int zoom);
+    ICoordinate xyToLatLon(Point point, int zoom);
 
     /**
@@ -199,5 +199,5 @@
      * @return WGS84 Coordinates of given point
      */
-    ICoordinate XYToLatLon(int x, int y, int zoom);
+    ICoordinate xyToLatLon(int x, int y, int zoom);
 
     /**
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java	(revision 31437)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java	(revision 31438)
@@ -153,22 +153,22 @@
     @Override
     public double XToLon(int x, int zoom) {
-        return osmMercator.XToLon(x, zoom);
+        return osmMercator.xToLon(x, zoom);
     }
 
     @Override
     public double YToLat(int y, int zoom) {
-        return osmMercator.YToLat(y, zoom);
-    }
-
-    @Override
-    public ICoordinate XYToLatLon(Point point, int zoom) {
-        return XYToLatLon(point.x, point.y, zoom);
-    }
-
-    @Override
-    public ICoordinate XYToLatLon(int x, int y, int zoom) {
+        return osmMercator.yToLat(y, zoom);
+    }
+
+    @Override
+    public ICoordinate xyToLatLon(Point point, int zoom) {
+        return xyToLatLon(point.x, point.y, zoom);
+    }
+
+    @Override
+    public ICoordinate xyToLatLon(int x, int y, int zoom) {
         return new Coordinate(
-                osmMercator.YToLat(y, zoom),
-                osmMercator.XToLon(x, zoom)
+                osmMercator.yToLat(y, zoom),
+                osmMercator.xToLon(x, zoom)
                 );
     }
@@ -199,10 +199,10 @@
     @Override
     public double tileYToLat(int y, int zoom) {
-        return osmMercator.YToLat(y * tileSize, zoom);
+        return osmMercator.yToLat(y * tileSize, zoom);
     }
 
     @Override
     public double tileXToLon(int x, int zoom) {
-        return osmMercator.XToLon(x * tileSize, zoom);
+        return osmMercator.xToLon(x * tileSize, zoom);
     }
 
@@ -220,6 +220,6 @@
     public ICoordinate tileXYToLatLon(int x, int y, int zoom) {
         return new Coordinate(
-                osmMercator.YToLat(y * tileSize, zoom),
-                osmMercator.XToLon(x * tileSize, zoom)
+                osmMercator.yToLat(y * tileSize, zoom),
+                osmMercator.xToLon(x * tileSize, zoom)
                 );
     }
Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java	(revision 31437)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java	(revision 31438)
@@ -21,4 +21,13 @@
     private static final int DEFAULT_MAXZOOM = 14;
     private static final String API_KEY = "4018C5A9AECAD8868ED5DEB2E41D09F7";
+
+    // Latitude to Y and back calculations.
+
+    /** radius of Earth at equator, m */
+    private static double RADIUS_E = 6378137;
+    /** equator length, m */
+    private static double EQUATOR = 40075016.68557849;
+    /** eccentricity of Earth's ellipsoid */
+    private static double E = 0.0818191908426;
 
     private enum ScanexLayer {
@@ -46,4 +55,11 @@
     private ScanexLayer layer = ScanexLayer.IRS;
 
+    /** cached latitude used in {@link #tileYToLat(double, int)} */
+    private double cachedLat = 0;
+
+    /**
+     * Constructs a new {@code ScanexTileSource}.
+     * @param info tile source info
+     */
     public ScanexTileSource(TileSourceInfo info) {
         super(info);
@@ -77,11 +93,4 @@
     }
 
-    /*
-     * Latitude to Y and back calculations.
-     */
-    private static double RADIUS_E = 6378137;   /* radius of Earth at equator, m */
-    private static double EQUATOR = 40075016.68557849; /* equator length, m */
-    private static double E = 0.0818191908426;  /* eccentricity of Earth's ellipsoid */
-
     @Override
     public int latToY(double lat, int zoom) {
@@ -111,8 +120,6 @@
      * Newton's method. We cache previous calculated latitude,
      * because new one is usually close to the old one. In case
-     * if solution gets out of bounds, we reset to a new random
-     * value.
+     * if solution gets out of bounds, we reset to a new random value.
      */
-    private double cachedLat = 0;
     private double tileYToLat(double y, int zoom) {
         double lat0;
@@ -126,5 +133,5 @@
                   r.nextInt((int) (OsmMercator.MAX_LAT - OsmMercator.MIN_LAT));
             }
-        } while ((Math.abs(lat0 - lat) > 0.000001));
+        } while (Math.abs(lat0 - lat) > 0.000001);
 
         cachedLat = lat;
@@ -141,6 +148,6 @@
         double ec = Math.exp((1 - y/zoom)*Math.PI);
 
-        double f = (Math.tan(Math.PI/4+lat/2) -
-            ec * Math.pow(Math.tan(Math.PI/4 + Math.asin(E * sinl)/2), E));
+        double f = Math.tan(Math.PI/4+lat/2) -
+            ec * Math.pow(Math.tan(Math.PI/4 + Math.asin(E * sinl)/2), E);
         double df = 1/(1 - sinl) - ec * E * cosl/((1 - E * sinl) *
             (Math.sqrt(1 - E * E * sinl * sinl)));
