Index: /applications/viewer/jmapviewer/.settings/org.sonar.ide.eclipse.core.prefs
===================================================================
--- /applications/viewer/jmapviewer/.settings/org.sonar.ide.eclipse.core.prefs	(revision 31433)
+++ /applications/viewer/jmapviewer/.settings/org.sonar.ide.eclipse.core.prefs	(revision 31434)
@@ -1,5 +1,5 @@
 eclipse.preferences.version=1
 extraProperties=
-lastAnalysisDate=1438525666226
+lastAnalysisDate=1438527074033
 projectKey=jmapviewer
 serverUrl=https\://josm.openstreetmap.de/sonar
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/AbstractLayer.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/AbstractLayer.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/AbstractLayer.java	(revision 31434)
@@ -11,5 +11,5 @@
     private Style style;
     private Boolean visible;
-    private Boolean visibleTexts = true;
+    private Boolean visibleTexts = Boolean.TRUE;
 
     public AbstractLayer(String name) {
@@ -42,5 +42,5 @@
         setDescription(description);
         setStyle(style);
-        setVisible(true);
+        setVisible(Boolean.TRUE);
 
         if (parent != null) parent.add(this);
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/DefaultMapController.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/DefaultMapController.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/DefaultMapController.java	(revision 31434)
@@ -23,7 +23,4 @@
 
     private static final int MAC_MOUSE_BUTTON3_MASK = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK;
-    public DefaultMapController(JMapViewer map) {
-        super(map);
-    }
 
     private Point lastDragPoint;
@@ -38,4 +35,8 @@
     private boolean wheelZoomEnabled = true;
     private boolean doubleClickZoomEnabled = true;
+
+    public DefaultMapController(JMapViewer map) {
+        super(map);
+    }
 
     @Override
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Demo.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Demo.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Demo.java	(revision 31434)
@@ -202,5 +202,5 @@
         Layer spain = treeMap.addLayer("Spain");
         map().addMapMarker(new MapMarkerCircle(spain, "La Garena", new Coordinate(40.4838, -3.39), .002));
-        spain.setVisible(false);
+        spain.setVisible(Boolean.FALSE);
 
         Layer wales = treeMap.addLayer("UK");
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java	(revision 31434)
@@ -92,4 +92,6 @@
 
     protected transient AttributionSupport attribution = new AttributionSupport();
+
+    protected EventListenerList evtListenerList = new EventListenerList();
 
     /**
@@ -1099,6 +1101,4 @@
     }
 
-    protected EventListenerList evtListenerList = new EventListenerList();
-
     /**
      * @param listener listener to set
@@ -1120,5 +1120,5 @@
      * @param evt event to dispatch
      */
-    void fireJMVEvent(JMVCommandEvent evt) {
+    private void fireJMVEvent(JMVCommandEvent evt) {
         Object[] listeners = evtListenerList.getListenerList();
         for (int i = 0; i < listeners.length; i += 2) {
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewerTree.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewerTree.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewerTree.java	(revision 31434)
@@ -115,5 +115,5 @@
     }
 
-    private void setVisibleTexts(AbstractLayer layer, boolean visible) {
+    private static void setVisibleTexts(AbstractLayer layer, boolean visible) {
         layer.setVisibleTexts(visible);
         if (layer instanceof LayerGroup) {
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JobDispatcher.java	(revision 31434)
@@ -21,4 +21,12 @@
     private static final JobDispatcher instance = new JobDispatcher();
 
+    private static int workerThreadMaxCount = 8;
+
+    private BlockingDeque<TileJob> jobQueue = new LinkedBlockingDeque<>();
+
+    private JobDispatcher() {
+        addWorkerThread().firstThread = true;
+    }
+
     /**
      * @return the singelton instance of the {@link JobDispatcher}
@@ -27,12 +35,4 @@
         return instance;
     }
-
-    private JobDispatcher() {
-        addWorkerThread().firstThread = true;
-    }
-
-    protected BlockingDeque<TileJob> jobQueue = new LinkedBlockingDeque<>();
-
-    private static int workerThreadMaxCount = 8;
 
     /**
@@ -47,20 +47,20 @@
      * Type of queue, FIFO if <code>false</code>, LIFO if <code>true</code>
      */
-    protected boolean modeLIFO = false;
+    private boolean modeLIFO = false;
 
     /**
      * Total number of worker threads currently idle or active
      */
-    protected int workerThreadCount = 0;
+    private int workerThreadCount = 0;
 
     /**
      * Number of worker threads currently idle
      */
-    protected int workerThreadIdleCount = 0;
+    private int workerThreadIdleCount = 0;
 
     /**
      * Just an id for identifying an worker thread instance
      */
-    protected int workerThreadId = 0;
+    private int workerThreadId = 0;
 
     /**
@@ -124,7 +124,11 @@
     public class JobThread extends Thread {
 
-        Runnable job;
-        boolean firstThread = false;
+        private Runnable job;
+        private boolean firstThread = false;
 
+        /**
+         * Constructs a new {@code JobThread}.
+         * @param threadId Thread ID
+         */
         public JobThread(int threadId) {
             super("OSMJobThread " + threadId);
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapMarkerCircle.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapMarkerCircle.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapMarkerCircle.java	(revision 31434)
@@ -21,32 +21,78 @@
 public class MapMarkerCircle extends MapObjectImpl implements MapMarker {
 
-    Coordinate coord;
-    double radius;
-    STYLE markerStyle;
+    private Coordinate coord;
+    private double radius;
+    private STYLE markerStyle;
 
+    /**
+     * Constructs a new {@code MapMarkerCircle}.
+     * @param coord Coordinates of the map marker
+     * @param radius Radius of the map marker position
+     */
     public MapMarkerCircle(Coordinate coord, double radius) {
         this(null, null, coord, radius);
     }
 
+    /**
+     * Constructs a new {@code MapMarkerCircle}.
+     * @param name Name of the map marker
+     * @param coord Coordinates of the map marker
+     * @param radius Radius of the map marker position
+     */
     public MapMarkerCircle(String name, Coordinate coord, double radius) {
         this(null, name, coord, radius);
     }
 
+    /**
+     * Constructs a new {@code MapMarkerCircle}.
+     * @param layer Layer of the map marker
+     * @param coord Coordinates of the map marker
+     * @param radius Radius of the map marker position
+     */
     public MapMarkerCircle(Layer layer, Coordinate coord, double radius) {
         this(layer, null, coord, radius);
     }
 
+    /**
+     * Constructs a new {@code MapMarkerCircle}.
+     * @param lat Latitude of the map marker
+     * @param lon Longitude of the map marker
+     * @param radius Radius of the map marker position
+     */
     public MapMarkerCircle(double lat, double lon, double radius) {
         this(null, null, new Coordinate(lat, lon), radius);
     }
 
+    /**
+     * Constructs a new {@code MapMarkerCircle}.
+     * @param layer Layer of the map marker
+     * @param lat Latitude of the map marker
+     * @param lon Longitude of the map marker
+     * @param radius Radius of the map marker position
+     */
     public MapMarkerCircle(Layer layer, double lat, double lon, double radius) {
         this(layer, null, new Coordinate(lat, lon), radius);
     }
 
+    /**
+     * Constructs a new {@code MapMarkerCircle}.
+     * @param layer Layer of the map marker
+     * @param name Name of the map marker
+     * @param coord Coordinates of the map marker
+     * @param radius Radius of the map marker position
+     */
     public MapMarkerCircle(Layer layer, String name, Coordinate coord, double radius) {
         this(layer, name, coord, radius, STYLE.VARIABLE, getDefaultStyle());
     }
 
+    /**
+     * Constructs a new {@code MapMarkerCircle}.
+     * @param layer Layer of the map marker
+     * @param name Name of the map marker
+     * @param coord Coordinates of the map marker
+     * @param radius Radius of the map marker position
+     * @param markerStyle Marker style (fixed or variable)
+     * @param style Graphical style
+     */
     public MapMarkerCircle(Layer layer, String name, Coordinate coord, double radius, STYLE markerStyle, Style style) {
         super(layer, name, style);
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MemoryTileCache.java	(revision 31434)
@@ -43,9 +43,9 @@
     public synchronized void addTile(Tile tile) {
         CacheEntry entry = createCacheEntry(tile);
-            hash.put(tile.getKey(), entry);
-            lruTiles.addFirst(entry);
-            if (hash.size() > cacheSize) {
-                removeOldEntries();
-            }
+        hash.put(tile.getKey(), entry);
+        lruTiles.addFirst(entry);
+        if (hash.size() > cacheSize) {
+            removeOldEntries();
+        }
     }
 
@@ -116,7 +116,7 @@
      */
     protected static class CacheEntry {
-        Tile tile;
-        CacheEntry next;
-        CacheEntry prev;
+        private Tile tile;
+        private CacheEntry next;
+        private CacheEntry prev;
 
         protected CacheEntry(Tile tile) {
@@ -137,4 +137,7 @@
         protected int elementCount;
 
+        /**
+         * Constructs a new {@code CacheLinkedListElement}.
+         */
         public CacheLinkedListElement() {
             clear();
@@ -208,5 +211,4 @@
             return firstElement;
         }
-
     }
 }
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java	(revision 31434)
@@ -24,6 +24,6 @@
     private final class OsmTileJob implements TileJob {
         private final Tile tile;
-        InputStream input = null;
-        boolean force = false;
+        private InputStream input = null;
+        private boolean force = false;
 
         private OsmTileJob(Tile tile) {
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Style.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Style.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Style.java	(revision 31434)
@@ -60,5 +60,5 @@
     }
 
-    private AlphaComposite getAlphaComposite(Color color) {
+    private static AlphaComposite getAlphaComposite(Color color) {
         return color.getAlpha() == 255 ? OPAQUE : TRANSPARENCY;
     }
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 31434)
@@ -89,19 +89,17 @@
     /**
      * 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.
+     * difference) from cache and use it as a placeholder until the tile has been loaded.
      */
     public void loadPlaceholderFromCache(TileCache cache) {
         BufferedImage tmpImage = new BufferedImage(source.getTileSize(), source.getTileSize(), BufferedImage.TYPE_INT_RGB);
         Graphics2D g = (Graphics2D) tmpImage.getGraphics();
-        // g.drawImage(image, 0, 0, null);
         for (int zoomDiff = 1; zoomDiff < 5; zoomDiff++) {
             // first we check if there are already the 2^x tiles
             // of a higher detail level
-            int zoom_high = zoom + zoomDiff;
-            if (zoomDiff < 3 && zoom_high <= JMapViewer.MAX_ZOOM) {
+            int zoomHigh = zoom + zoomDiff;
+            if (zoomDiff < 3 && zoomHigh <= JMapViewer.MAX_ZOOM) {
                 int factor = 1 << zoomDiff;
-                int xtile_high = xtile << zoomDiff;
-                int ytile_high = ytile << zoomDiff;
+                int xtileHigh = xtile << zoomDiff;
+                int ytileHigh = ytile << zoomDiff;
                 double scale = 1.0 / factor;
                 g.setTransform(AffineTransform.getScaleInstance(scale, scale));
@@ -109,5 +107,5 @@
                 for (int x = 0; x < factor; x++) {
                     for (int y = 0; y < factor; y++) {
-                        Tile tile = cache.getTile(source, xtile_high + x, ytile_high + y, zoom_high);
+                        Tile tile = cache.getTile(source, xtileHigh + x, ytileHigh + y, zoomHigh);
                         if (tile != null && tile.isLoaded()) {
                             paintedTileCount++;
@@ -122,16 +120,16 @@
             }
 
-            int zoom_low = zoom - zoomDiff;
-            if (zoom_low >= JMapViewer.MIN_ZOOM) {
-                int xtile_low = xtile >> zoomDiff;
-                int ytile_low = ytile >> zoomDiff;
-                int factor = (1 << zoomDiff);
+            int zoomLow = zoom - zoomDiff;
+            if (zoomLow >= JMapViewer.MIN_ZOOM) {
+                int xtileLow = xtile >> zoomDiff;
+                int ytileLow = ytile >> zoomDiff;
+                int factor = 1 << zoomDiff;
                 double scale = factor;
                 AffineTransform at = new AffineTransform();
-                int translate_x = (xtile % factor) * source.getTileSize();
-                int translate_y = (ytile % factor) * source.getTileSize();
-                at.setTransform(scale, 0, 0, scale, -translate_x, -translate_y);
+                int translateX = (xtile % factor) * source.getTileSize();
+                int translateY = (ytile % factor) * source.getTileSize();
+                at.setTransform(scale, 0, 0, scale, -translateX, -translateY);
                 g.setTransform(at);
-                Tile tile = cache.getTile(source, xtile_low, ytile_low, zoom_low);
+                Tile tile = cache.getTile(source, xtileLow, ytileLow, zoomLow);
                 if (tile != null && tile.isLoaded()) {
                     tile.paint(g, 0, 0);
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/TileController.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/TileController.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/TileController.java	(revision 31434)
@@ -13,5 +13,5 @@
     protected TileSource tileSource;
 
-    JobDispatcher jobDispatcher;
+    protected JobDispatcher jobDispatcher;
 
     public TileController(TileSource source, TileCache tileCache, TileLoaderListener listener) {
@@ -33,5 +33,5 @@
      */
     public Tile getTile(int tilex, int tiley, int zoom) {
-        int max = (1 << zoom);
+        int max = 1 << zoom;
         if (tilex < 0 || tilex >= max || tiley < 0 || tiley >= max)
             return null;
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxNodeRenderer.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxNodeRenderer.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxNodeRenderer.java	(revision 31434)
@@ -22,11 +22,12 @@
     private final CheckBoxNodePanel panel = new CheckBoxNodePanel();
     private final DefaultTreeCellRenderer defaultRenderer = new DefaultTreeCellRenderer();
-    private final Color selectionForeground, selectionBackground;
-    private final Color textForeground, textBackground;
+    private final Color selectionForeground;
+    private final Color selectionBackground;
+    private final Color textForeground;
+    private final Color textBackground;
 
-    protected CheckBoxNodePanel getPanel() {
-        return panel;
-    }
-
+    /**
+     * Constructs a new {@code CheckBoxNodeRenderer}.
+     */
     public CheckBoxNodeRenderer() {
         final Font fontValue = UIManager.getFont("Tree.font");
@@ -43,7 +44,12 @@
     }
 
+    protected CheckBoxNodePanel getPanel() {
+        return panel;
+    }
+
     public void addNodeListener(MouseAdapter listener) {
         panel.addMouseListener(listener);
     }
+
     // -- TreeCellRenderer methods --
 
@@ -65,5 +71,5 @@
         //panel.label.setText(stringValue);
 
-        panel.setSelected(false);
+        panel.setSelected(Boolean.FALSE);
 
         panel.setEnabled(tree.isEnabled());
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/checkBoxTree/CheckBoxTree.java	(revision 31434)
@@ -90,5 +90,5 @@
 
     public static void main(final String[] args) {
-        final DefaultMutableTreeNode root = new DefaultMutableTreeNode(new CheckBoxNodeData("Root", true));
+        final DefaultMutableTreeNode root = new DefaultMutableTreeNode(new CheckBoxNodeData("Root", Boolean.TRUE));
 
         final DefaultMutableTreeNode accessibility =
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/MapMarker.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/MapMarker.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/MapMarker.java	(revision 31434)
@@ -17,5 +17,8 @@
 public interface MapMarker extends MapObject, ICoordinate{
 
-    public static enum STYLE {FIXED, VARIABLE}
+    public static enum STYLE {
+        FIXED,
+        VARIABLE
+    }
 
     /**
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractOsmTileSource.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractOsmTileSource.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractOsmTileSource.java	(revision 31434)
@@ -26,5 +26,4 @@
     public AbstractOsmTileSource(String name, String base_url, String id) {
         super(new TileSourceInfo(name, base_url, id));
-
     }
 
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java	(revision 31434)
@@ -283,5 +283,5 @@
     }
 
-    private int getTileMax(int zoom) {
+    private static int getTileMax(int zoom) {
         return (int) Math.pow(2.0, zoom) - 1;
     }
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 31434)
@@ -39,5 +39,5 @@
 public class BingAerialTileSource extends AbstractTMSTileSource {
 
-    private static String API_KEY = "Arzdiw4nlOJzRwOz__qailc8NiR31Tt51dN2D7cm57NrnceZnCpgOkmJhNpGoppU";
+    private static final String API_KEY = "Arzdiw4nlOJzRwOz__qailc8NiR31Tt51dN2D7cm57NrnceZnCpgOkmJhNpGoppU";
     private static volatile Future<List<Attribution>> attributions; // volatile is required for getAttribution(), see below.
     private static String imageUrlTemplate;
@@ -57,4 +57,7 @@
     }
 
+    /**
+     * Constructs a new {@code BingAerialTileSource}.
+     */
     public BingAerialTileSource(TileSourceInfo info) {
         super(info);
@@ -62,9 +65,9 @@
 
     protected static class Attribution {
-        String attribution;
-        int minZoom;
-        int maxZoom;
-        Coordinate min;
-        Coordinate max;
+        private String attribution;
+        private int minZoom;
+        private int maxZoom;
+        private Coordinate min;
+        private Coordinate max;
     }
 
@@ -100,5 +103,5 @@
             imageUrlTemplate = xpath.compile("//ImageryMetadata/ImageUrl/text()").evaluate(document);
             imageUrlTemplate = culturePattern.matcher(imageUrlTemplate).replaceAll(Locale.getDefault().toString());
-            imageryZoomMax = Integer.parseInt(xpath.compile("//ImageryMetadata/ZoomMax/text()").evaluate(document));
+            imageryZoomMax = Integer.valueOf(xpath.compile("//ImageryMetadata/ZoomMax/text()").evaluate(document));
 
             NodeList subdomainTxt = (NodeList) xpath.compile("//ImageryMetadata/ImageUrlSubdomains/string/text()")
@@ -137,8 +140,8 @@
                     attr.minZoom = Integer.parseInt(zoomMinXpath.evaluate(areaNode));
 
-                    Double southLat = Double.parseDouble(southLatXpath.evaluate(areaNode));
-                    Double northLat = Double.parseDouble(northLatXpath.evaluate(areaNode));
-                    Double westLon = Double.parseDouble(westLonXpath.evaluate(areaNode));
-                    Double eastLon = Double.parseDouble(eastLonXpath.evaluate(areaNode));
+                    Double southLat = Double.valueOf(southLatXpath.evaluate(areaNode));
+                    Double northLat = Double.valueOf(northLatXpath.evaluate(areaNode));
+                    Double westLon = Double.valueOf(westLonXpath.evaluate(areaNode));
+                    Double eastLon = Double.valueOf(eastLonXpath.evaluate(areaNode));
                     attr.min = new Coordinate(southLat, westLon);
                     attr.max = new Coordinate(northLat, eastLon);
@@ -281,5 +284,5 @@
                             && topLeft.getLat() > attr.min.getLat() && botRight.getLat() < attr.max.getLat()) {
                         a.append(attr.attribution);
-                        a.append(" ");
+                        a.append(' ');
                     }
                 }
@@ -292,5 +295,5 @@
     }
 
-    static String computeQuadTree(int zoom, int tilex, int tiley) {
+    private static String computeQuadTree(int zoom, int tilex, int tiley) {
         StringBuilder k = new StringBuilder();
         for (int i = zoom; i > 0; i--) {
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/OsmTileSource.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/OsmTileSource.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/OsmTileSource.java	(revision 31434)
@@ -16,5 +16,5 @@
         private static final String[] SERVER = {"a", "b", "c"};
 
-        private int SERVER_NUM = 0;
+        private int serverNum = 0;
 
         /**
@@ -27,12 +27,7 @@
         @Override
         public String getBaseUrl() {
-            String url = String.format(this.baseUrl, new Object[] {SERVER[SERVER_NUM]});
-            SERVER_NUM = (SERVER_NUM + 1) % SERVER.length;
+            String url = String.format(this.baseUrl, new Object[] {SERVER[serverNum]});
+            serverNum = (serverNum + 1) % SERVER.length;
             return url;
-        }
-
-        @Override
-        public int getMaxZoom() {
-            return 19;
         }
 
@@ -52,5 +47,5 @@
         private static final String[] SERVER = {"a", "b", "c"};
 
-        private int SERVER_NUM = 0;
+        private int serverNum = 0;
 
         /**
@@ -63,6 +58,6 @@
         @Override
         public String getBaseUrl() {
-            String url = String.format(this.baseUrl, new Object[] {SERVER[SERVER_NUM]});
-            SERVER_NUM = (SERVER_NUM + 1) % SERVER.length;
+            String url = String.format(this.baseUrl, new Object[] {SERVER[serverNum]});
+            serverNum = (serverNum + 1) % SERVER.length;
             return url;
         }
Index: /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java
===================================================================
--- /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java	(revision 31433)
+++ /applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java	(revision 31434)
@@ -10,6 +10,5 @@
  *
  * Earth is assumed an ellipsoid in this projection, unlike
- * sphere in OsmMercator, so latitude calculation differs
- * a lot.
+ * sphere in OsmMercator, so latitude calculation differs a lot.
  *
  * The longitude calculation is the same as in OsmMercator,
@@ -21,5 +20,5 @@
     private static final String DEFAULT_URL = "http://maps.kosmosnimki.ru";
     private static final int DEFAULT_MAXZOOM = 14;
-    private static String API_KEY = "4018C5A9AECAD8868ED5DEB2E41D09F7";
+    private static final String API_KEY = "4018C5A9AECAD8868ED5DEB2E41D09F7";
 
     private enum ScanexLayer {
@@ -45,5 +44,5 @@
 
     /* IRS by default */
-    private ScanexLayer Layer = ScanexLayer.IRS;
+    private ScanexLayer layer = ScanexLayer.IRS;
 
     public ScanexTileSource(TileSourceInfo info) {
@@ -53,5 +52,5 @@
         for (ScanexLayer layer : ScanexLayer.values()) {
             if (url.equalsIgnoreCase(layer.getName())) {
-                this.Layer = layer;
+                this.layer = layer;
                 /*
                  * Override baseUrl and maxZoom in base class.
@@ -77,10 +76,5 @@
         tiley = tmp - tiley - 1;
 
-        return this.Layer.getUri() + "&apikey=" + API_KEY + "&x=" + tilex + "&y=" + tiley + "&z=" + zoom;
-    }
-
-    @Override
-    public TileUpdate getTileUpdate() {
-        return TileUpdate.IfNoneMatch;
+        return this.layer.getUri() + "&apikey=" + API_KEY + "&x=" + tilex + "&y=" + tiley + "&z=" + zoom;
     }
 
@@ -122,12 +116,11 @@
      * value.
      */
-    private double cached_lat = 0;
+    private double cachedLat = 0;
     private double tileYToLat(double y, int zoom) {
-        double lat0, lat;
-
-        lat = cached_lat;
+        double lat0;
+        double lat = cachedLat;
         do {
             lat0 = lat;
-            lat = lat - Math.toDegrees(NextTerm(Math.toRadians(lat), y, zoom));
+            lat = lat - Math.toDegrees(nextTerm(Math.toRadians(lat), y, zoom));
             if (lat > OsmMercator.MAX_LAT || lat < OsmMercator.MIN_LAT) {
                 Random r = new Random();
@@ -137,24 +130,23 @@
         } while ((Math.abs(lat0 - lat) > 0.000001));
 
-        cached_lat = lat;
+        cachedLat = lat;
 
-        return (lat);
+        return lat;
     }
 
     /* Next term in Newton's polynomial */
-    private double NextTerm(double lat, double y, int zoom) {
+    private static double nextTerm(double lat, double y, int zoom) {
         double sinl = Math.sin(lat);
         double cosl = Math.cos(lat);
-        double ec, f, df;
 
         zoom = (int) Math.pow(2.0, zoom - 1);
-        ec = Math.exp((1 - y/zoom)*Math.PI);
+        double ec = Math.exp((1 - y/zoom)*Math.PI);
 
-        f = (Math.tan(Math.PI/4+lat/2) -
+        double f = (Math.tan(Math.PI/4+lat/2) -
             ec * Math.pow(Math.tan(Math.PI/4 + Math.asin(E * sinl)/2), E));
-        df = 1/(1 - sinl) - ec * E * cosl/((1 - E * sinl) *
+        double df = 1/(1 - sinl) - ec * E * cosl/((1 - E * sinl) *
             (Math.sqrt(1 - E * E * sinl * sinl)));
 
-        return (f/df);
+        return f/df;
     }
 }
