Index: /trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java	(revision 8530)
@@ -499,5 +499,5 @@
      */
     public void cancelOutstandingTasks() {
-        for(Runnable r: downloadJobExecutor.getQueue()) {
+        for (Runnable r: downloadJobExecutor.getQueue()) {
             if (downloadJobExecutor.remove(r) && r instanceof JCSCachedTileLoaderJob) {
                 ((JCSCachedTileLoaderJob<?, ?>) r).handleJobCancellation();
Index: /trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java	(revision 8530)
@@ -20,6 +20,5 @@
  *
  * @author Wiktor Niesiobędzki
- * @since TODO
- *
+ * @since 8526
  */
 public class CachedAttributionBingAerialTileSource extends BingAerialTileSource {
@@ -71,3 +70,2 @@
     }
 }
-
Index: /trunk/src/org/openstreetmap/josm/data/imagery/CachedTileLoaderFactory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/CachedTileLoaderFactory.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/CachedTileLoaderFactory.java	(revision 8530)
@@ -17,6 +17,5 @@
  *
  * @author Wiktor Niesiobędzki
- * @since TODO
- *
+ * @since 8526
  */
 public abstract class CachedTileLoaderFactory implements TileLoaderFactory {
@@ -59,5 +58,5 @@
         try {
             return getLoader(listener, cacheName,
-                    Main.pref.getInteger("socket.timeout.connect",15) * 1000,
+                    Main.pref.getInteger("socket.timeout.connect", 15) * 1000,
                     Main.pref.getInteger("socket.timeout.read", 30) * 1000,
                     headers,
@@ -69,4 +68,5 @@
     }
 
-    protected abstract TileLoader getLoader(TileLoaderListener listener, String cacheName, int connectTimeout, int readTimeout, Map<String, String> headers, String cacheDir) throws IOException;
+    protected abstract TileLoader getLoader(TileLoaderListener listener, String cacheName, int connectTimeout, int readTimeout,
+            Map<String, String> headers, String cacheDir) throws IOException;
 }
Index: /trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java	(revision 8530)
@@ -160,5 +160,5 @@
      * queue from default.
      *
-     * @param downloadExecutor
+     * @param downloadExecutor download executor that will be used to download tiles
      */
     public void setDownloadExecutor(ThreadPoolExecutor downloadExecutor) {
@@ -172,4 +172,3 @@
         return downloadExecutor;
     }
-
 }
Index: /trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java	(revision 8530)
@@ -34,6 +34,5 @@
  *
  * @author Wiktor Niesiobędzki
- * @since TODO
- *
+ * @since 8526
  */
 public class TemplatedWMSTileSource extends TMSTileSource implements TemplatedTileSource {
@@ -53,5 +52,4 @@
     private static final String PATTERN_HEIGHT  = "\\{height\\}";
 
-
     private static final NumberFormat latLonFormat = new DecimalFormat("###0.0000000", new DecimalFormatSymbols(Locale.US));
 
@@ -62,5 +60,5 @@
     /**
      * Creates a tile source based on imagery info
-     * @param info
+     * @param info imagery info
      */
     public TemplatedWMSTileSource(ImageryInfo info) {
@@ -106,5 +104,4 @@
         double s = se.getY();
         double e = se.getX();
-
 
         if (!serverProjections.contains(myProjCode) && serverProjections.contains("EPSG:4326") && "EPSG:3857".equals(myProjCode)) {
@@ -167,10 +164,10 @@
 
     @Override
-    public int LonToX(double lon, int zoom) {
-        throw new UnsupportedOperationException("Not implemented");
-    }
-
-    @Override
-    public int LatToY(double lat, int zoom) {
+    public int lonToX(double lon, int zoom) {
+        throw new UnsupportedOperationException("Not implemented");
+    }
+
+    @Override
+    public int latToY(double lat, int zoom) {
         throw new UnsupportedOperationException("Not implemented");
     }
@@ -298,5 +295,5 @@
     /**
      * Checks if url is acceptable by this Tile Source
-     * @param url
+     * @param url URL to check
      */
     public static void checkUrl(String url) {
@@ -324,5 +321,5 @@
         Matcher matcher = pattern.matcher(this.baseUrl);
         while (matcher.find()) {
-            headers.put(matcher.group(1),matcher.group(2));
+            headers.put(matcher.group(1), matcher.group(2));
             matcher.appendReplacement(output, "");
         }
@@ -337,5 +334,4 @@
                         topLeftCorner.north() - y * scale
                         );
-
     }
 
@@ -372,5 +368,3 @@
         return (int) Math.ceil(Math.abs(max.getX() - min.getX()) / scale);
     }
-
-
 }
Index: /trunk/src/org/openstreetmap/josm/data/imagery/TileLoaderFactory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/TileLoaderFactory.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/TileLoaderFactory.java	(revision 8530)
@@ -11,6 +11,5 @@
  *
  * @author Wiktor Niesiobędzki
- * @since TODO
- *
+ * @since 8526
  */
 public interface TileLoaderFactory {
@@ -28,4 +27,3 @@
      */
     TileLoader makeTileLoader(TileLoaderListener listener, Map<String, String> headers);
-
 }
Index: /trunk/src/org/openstreetmap/josm/data/imagery/WMSCachedTileLoader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/WMSCachedTileLoader.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/WMSCachedTileLoader.java	(revision 8530)
@@ -15,11 +15,10 @@
  *
  * @author Wiktor Niesiobędzki
- * @since TODO
- *
+ * @since 8526
  */
 public class WMSCachedTileLoader extends TMSCachedTileLoader {
 
     /** limit of concurrent connections to WMS tile source (per source) */
-    public static IntegerProperty THREAD_LIMIT = new IntegerProperty("imagery.wms.simultaneousConnections", 3);
+    public static final IntegerProperty THREAD_LIMIT = new IntegerProperty("imagery.wms.simultaneousConnections", 3);
 
     /**
Index: /trunk/src/org/openstreetmap/josm/data/imagery/WMSCachedTileLoaderJob.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/WMSCachedTileLoaderJob.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/WMSCachedTileLoaderJob.java	(revision 8530)
@@ -15,6 +15,5 @@
  *
  * @author Wiktor Niesiobędzki
- * @since TODO
- *
+ * @since 8526
  */
 public class WMSCachedTileLoaderJob extends TMSCachedTileLoaderJob {
@@ -45,4 +44,3 @@
         return null;
     }
-
 }
Index: /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 8530)
@@ -681,8 +681,8 @@
                 max = null;
             } else {
-                int y1 = tileSource.LatToY(bbox.getMinLat(), MAX_ZOOM);
-                int y2 = tileSource.LatToY(bbox.getMaxLat(), MAX_ZOOM);
-                int x1 = tileSource.LonToX(bbox.getMinLon(), MAX_ZOOM);
-                int x2 = tileSource.LonToX(bbox.getMaxLon(), MAX_ZOOM);
+                int y1 = tileSource.latToY(bbox.getMinLat(), MAX_ZOOM);
+                int y2 = tileSource.latToY(bbox.getMaxLat(), MAX_ZOOM);
+                int x1 = tileSource.lonToX(bbox.getMinLon(), MAX_ZOOM);
+                int x2 = tileSource.lonToX(bbox.getMaxLon(), MAX_ZOOM);
 
                 min = new Point(Math.min(x1, x2), Math.min(y1, y2));
Index: /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 8530)
@@ -80,12 +80,12 @@
 
 /**
- *
  * Base abstract class that supports displaying images provided by TileSource. It might be TMS source, WMS or WMTS
  *
  * It implements all standard functions of tilesource based layers: autozoom,  tile reloads, layer saving, loading,etc.
  *
+ * @author Upliner
  * @author Wiktor Niesiobędzki
- * @since TODO
- *
+ * @since 3715
+ * @since 8526 (copied from TMSLayer)
  */
 public abstract class AbstractTileSourceLayer extends ImageryLayer implements ImageObserver, TileLoaderListener, ZoomChangeListener {
@@ -135,11 +135,10 @@
     /**
      * Creates Tile Source based Imagery Layer based on Imagery Info
-     * @param info
-     * @param tileSource
+     * @param info imagery info
      */
     public AbstractTileSourceLayer(ImageryInfo info) {
         super(info);
 
-        if(!isProjectionSupported(Main.getProjection())) {
+        if (!isProjectionSupported(Main.getProjection())) {
             JOptionPane.showMessageDialog(Main.parent,
                     tr("This layer do not support the projection {0}.\n{1}\n"
@@ -160,5 +159,5 @@
     /**
      *
-     * @param info
+     * @param info imagery info
      * @return TileSource for specified ImageryInfo
      * @throws IllegalArgumentException when Imagery is not supported by layer
@@ -185,6 +184,4 @@
             tileLoader = new OsmTileLoader(this);
     }
-
-
 
     @Override
@@ -219,8 +216,7 @@
         tileCache.clear();
         if (tileLoader instanceof CachedTileLoader) {
-            ((CachedTileLoader)tileLoader).clearCache(tileSource);
-        }
-    }
-
+            ((CachedTileLoader) tileLoader).clearCache(tileSource);
+        }
+    }
 
     /**
@@ -262,5 +258,5 @@
     }
 
-    private final int getBestZoom() {
+    private int getBestZoom() {
         double factor = getScaleFactor(1); // check the ratio between area of tilesize at zoom 1 to current view
         double result = Math.log(factor)/Math.log(2)/2+1;
@@ -275,5 +271,5 @@
          * getScaleFactor(...) is supposed to be between 0.75 and 3
          */
-        int intResult = (int)Math.floor(result);
+        int intResult = (int) Math.floor(result);
         if (intResult > getMaxZoomLvl())
             return getMaxZoomLvl();
@@ -283,7 +279,73 @@
     }
 
-
-    private final static boolean actionSupportLayers(List<Layer> layers) {
+    private static boolean actionSupportLayers(List<Layer> layers) {
         return layers.size() == 1 && layers.get(0) instanceof TMSLayer;
+    }
+
+    private final class ShowTileInfoAction extends AbstractAction {
+        private final TileHolder clickedTileHolder;
+
+        private ShowTileInfoAction(TileHolder clickedTileHolder) {
+            super(tr("Show Tile Info"));
+            this.clickedTileHolder = clickedTileHolder;
+        }
+
+        private String getSizeString(int size) {
+            StringBuilder ret = new StringBuilder();
+            return ret.append(size).append("x").append(size).toString();
+        }
+
+        private JTextField createTextField(String text) {
+            JTextField ret = new JTextField(text);
+            ret.setEditable(false);
+            ret.setBorder(BorderFactory.createEmptyBorder());
+            return ret;
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent ae) {
+            Tile clickedTile = clickedTileHolder.getTile();
+            if (clickedTile != null) {
+                ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Tile Info"), new String[]{tr("OK")});
+                JPanel panel = new JPanel(new GridBagLayout());
+                Rectangle displaySize = tileToRect(clickedTile);
+                String url = "";
+                try {
+                    url = clickedTile.getUrl();
+                } catch (IOException e) {
+                    // silence exceptions
+                    if (Main.isTraceEnabled()) {
+                        Main.trace(e.getMessage());
+                    }
+                }
+
+                String[][] content = {
+                        {"Tile name", clickedTile.getKey()},
+                        {"Tile url", url},
+                        {"Tile size", getSizeString(clickedTile.getTileSource().getTileSize()) },
+                        {"Tile display size", new StringBuilder().append(displaySize.width).append("x").append(displaySize.height).toString()},
+                };
+
+                for (String[] entry: content) {
+                    panel.add(new JLabel(tr(entry[0]) + ":"), GBC.std());
+                    panel.add(GBC.glue(5, 0), GBC.std());
+                    panel.add(createTextField(entry[1]), GBC.eol().fill(GBC.HORIZONTAL));
+                }
+
+                for (Entry<String, String> e: clickedTile.getMetadata().entrySet()) {
+                    panel.add(new JLabel(tr("Metadata ") + tr(e.getKey()) + ":"), GBC.std());
+                    panel.add(GBC.glue(5, 0), GBC.std());
+                    String value = e.getValue();
+                    if ("lastModification".equals(e.getKey()) || "expirationTime".equals(e.getKey())) {
+                        value = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(Long.parseLong(value)));
+                    }
+                    panel.add(createTextField(value), GBC.eol().fill(GBC.HORIZONTAL));
+
+                }
+                ed.setIcon(JOptionPane.INFORMATION_MESSAGE);
+                ed.setContent(panel);
+                ed.showDialog();
+            }
+        }
     }
 
@@ -292,4 +354,5 @@
             super(tr("Auto Zoom"));
         }
+
         @Override
         public void actionPerformed(ActionEvent ae) {
@@ -302,9 +365,9 @@
             return item;
         }
+
         @Override
         public boolean supportLayers(List<Layer> layers) {
             return actionSupportLayers(layers);
         }
-
     }
 
@@ -313,7 +376,8 @@
             super(tr("Auto load tiles"));
         }
+
         @Override
         public void actionPerformed(ActionEvent ae) {
-            autoLoad= !autoLoad;
+            autoLoad = !autoLoad;
         }
 
@@ -323,4 +387,5 @@
             return item;
         }
+
         @Override
         public boolean supportLayers(List<Layer> layers) {
@@ -333,4 +398,5 @@
             super(tr("Load All Tiles"));
         }
+
         @Override
         public void actionPerformed(ActionEvent ae) {
@@ -356,4 +422,5 @@
             super(tr("Zoom to native resolution"));
         }
+
         @Override
         public void actionPerformed(ActionEvent ae) {
@@ -368,4 +435,5 @@
             super(tr("Change resolution"));
         }
+
         @Override
         public void actionPerformed(ActionEvent ae) {
@@ -374,8 +442,8 @@
     }
 
-    /*
+    /**
      * Simple class to keep clickedTile within hookUpMapView
      */
-    private class TileHolder {
+    private static final class TileHolder {
         private Tile t = null;
 
@@ -432,61 +500,5 @@
         }));
 
-        tileOptionMenu.add(new JMenuItem(new AbstractAction(
-                tr("Show Tile Info")) {
-            private String getSizeString(int size) {
-                StringBuilder ret = new StringBuilder();
-                return ret.append(size).append("x").append(size).toString();
-            }
-
-            private JTextField createTextField(String text) {
-                JTextField ret = new JTextField(text);
-                ret.setEditable(false);
-                ret.setBorder(BorderFactory.createEmptyBorder());
-                return ret;
-            }
-
-            @Override
-            public void actionPerformed(ActionEvent ae) {
-                Tile clickedTile = clickedTileHolder.getTile();
-                if (clickedTile != null) {
-                    ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Tile Info"), new String[]{tr("OK")});
-                    JPanel panel = new JPanel(new GridBagLayout());
-                    Rectangle displaySize = tileToRect(clickedTile);
-                    String url = "";
-                    try {
-                        url = clickedTile.getUrl();
-                    } catch (IOException e) {
-                        // silence exceptions
-                    }
-
-                    String[][] content = {
-                            {"Tile name", clickedTile.getKey()},
-                            {"Tile url", url},
-                            {"Tile size", getSizeString(clickedTile.getTileSource().getTileSize()) },
-                            {"Tile display size", new StringBuilder().append(displaySize.width).append("x").append(displaySize.height).toString()},
-                    };
-
-                    for (String[] entry: content) {
-                        panel.add(new JLabel(tr(entry[0]) + ":"), GBC.std());
-                        panel.add(GBC.glue(5,0), GBC.std());
-                        panel.add(createTextField(entry[1]), GBC.eol().fill(GBC.HORIZONTAL));
-                    }
-
-                    for (Entry<String, String> e: clickedTile.getMetadata().entrySet()) {
-                        panel.add(new JLabel(tr("Metadata ") + tr(e.getKey()) + ":"), GBC.std());
-                        panel.add(GBC.glue(5,0), GBC.std());
-                        String value = e.getValue();
-                        if ("lastModification".equals(e.getKey()) || "expirationTime".equals(e.getKey())) {
-                            value = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(Long.parseLong(value)));
-                        }
-                        panel.add(createTextField(value), GBC.eol().fill(GBC.HORIZONTAL));
-
-                    }
-                    ed.setIcon(JOptionPane.INFORMATION_MESSAGE);
-                    ed.setContent(panel);
-                    ed.showDialog();
-                }
-            }
-        }));
+        tileOptionMenu.add(new JMenuItem(new ShowTileInfoAction(clickedTileHolder)));
 
         tileOptionMenu.add(new JMenuItem(new LoadAllTilesAction()));
@@ -586,8 +598,8 @@
      */
     public static int checkMaxZoomLvl(int maxZoomLvl, TileSource ts) {
-        if(maxZoomLvl > MAX_ZOOM) {
+        if (maxZoomLvl > MAX_ZOOM) {
             maxZoomLvl = MAX_ZOOM;
         }
-        if(maxZoomLvl < PROP_MIN_ZOOM_LVL.get()) {
+        if (maxZoomLvl < PROP_MIN_ZOOM_LVL.get()) {
             maxZoomLvl = PROP_MIN_ZOOM_LVL.get();
         }
@@ -605,8 +617,8 @@
      */
     public static int checkMinZoomLvl(int minZoomLvl, TileSource ts) {
-        if(minZoomLvl < MIN_ZOOM) {
+        if (minZoomLvl < MIN_ZOOM) {
             minZoomLvl = MIN_ZOOM;
         }
-        if(minZoomLvl > PROP_MAX_ZOOM_LVL.get()) {
+        if (minZoomLvl > PROP_MAX_ZOOM_LVL.get()) {
             minZoomLvl = getMaxZoomLvl(ts);
         }
@@ -617,5 +629,4 @@
     }
 
-
     /**
      * @param ts TileSource for which we want to know maximum zoom level
@@ -634,8 +645,7 @@
     }
 
-
     /**
      * Sets maximum zoom level, that layer will attempt show
-     * @param maxZoomLvl
+     * @param maxZoomLvl maximum zoom level
      */
     public static void setMaxZoomLvl(int maxZoomLvl) {
@@ -646,5 +656,5 @@
     /**
      * Sets minimum zoom level, that layer will attempt show
-     * @param minZoomLvl
+     * @param minZoomLvl minimum zoom level
      */
     public static void setMinZoomLvl(int minZoomLvl) {
@@ -652,5 +662,4 @@
         PROP_MIN_ZOOM_LVL.put(minZoomLvl);
     }
-
 
     /**
@@ -664,5 +673,5 @@
         }
         if (tileLoader instanceof TMSCachedTileLoader) {
-            ((TMSCachedTileLoader)tileLoader).cancelOutstandingTasks();
+            ((TMSCachedTileLoader) tileLoader).cancelOutstandingTasks();
         }
         needRedraw = true;
@@ -687,5 +696,5 @@
         boolean zia = currentZoomLevel < this.getMaxZoomLvl();
         if (Main.isDebugEnabled()) {
-            Main.debug("zoomIncreaseAllowed(): " + zia + " " + currentZoomLevel + " vs. " + this.getMaxZoomLvl() );
+            Main.debug("zoomIncreaseAllowed(): " + zia + " " + currentZoomLevel + " vs. " + this.getMaxZoomLvl());
         }
         return zia;
@@ -812,6 +821,5 @@
         TileSet ts = getVisibleTileSet();
 
-        // if there is more than 18 tiles on screen in any direction, do not
-        // load all tiles!
+        // if there is more than 18 tiles on screen in any direction, do not load all tiles!
         if (ts.tooLarge()) {
             Main.warn("Not downloading all tiles because there is more than 18 tiles on an axis!");
@@ -884,6 +892,5 @@
 
         // If a border is specified, only draw the intersection
-        // if what we have combined with what we are supposed
-        // to draw.
+        // if what we have combined with what we are supposed to draw.
         if (border != null) {
             target = source.intersection(border);
@@ -906,12 +913,11 @@
         int screen_x_offset = target.x - source.x;
         int screen_y_offset = target.y - source.y;
-        // And how many pixels into the image itself does that
-        // correlate to?
-        int img_x_offset = (int)(screen_x_offset * imageXScaling + 0.5);
-        int img_y_offset = (int)(screen_y_offset * imageYScaling + 0.5);
+        // And how many pixels into the image itself does that correlate to?
+        int img_x_offset = (int) (screen_x_offset * imageXScaling + 0.5);
+        int img_y_offset = (int) (screen_y_offset * imageYScaling + 0.5);
         // Now calculate the other corner of the image that we need
         // by scaling the 'target' rectangle's dimensions.
-        int img_x_end = img_x_offset + (int)(target.getWidth() * imageXScaling + 0.5);
-        int img_y_end = img_y_offset + (int)(target.getHeight() * imageYScaling + 0.5);
+        int img_x_end = img_x_offset + (int) (target.getWidth() * imageXScaling + 0.5);
+        int img_y_end = img_y_offset + (int) (target.getHeight() * imageYScaling + 0.5);
 
         if (Main.isDebugEnabled()) {
@@ -951,7 +957,5 @@
         // that we do not draw in missedTiles.  ts.allExistingTiles() by
         // default will only return already-existing tiles.  However, we
-        // need to return *all* tiles to the callers, so force creation
-        // here.
-        //boolean forceTileCreation = true;
+        // need to return *all* tiles to the callers, so force creation here.
         for (Tile tile : ts.allTilesCreate()) {
             Image img = getLoadedTileImage(tile);
@@ -975,7 +979,7 @@
         Color oldColor = g.getColor();
         g.setColor(Color.black);
-        g.drawString(text,x+1,y+1);
+        g.drawString(text, x+1, y+1);
         g.setColor(oldColor);
-        g.drawString(text,x,y);
+        g.drawString(text, x, y);
     }
 
@@ -1004,5 +1008,5 @@
         if (tile.hasError() && showErrors) {
             myDrawString(g, tr("Error") + ": " + tr(tile.getErrorMessage()), p.x + 2, texty);
-            texty += 1 + fontHeight;
+            //texty += 1 + fontHeight;
         }
 
@@ -1048,8 +1052,8 @@
     private Coordinate getShiftedCoord(EastNorth en) {
         LatLon ll = getShiftedLatLon(en);
-        return new Coordinate(ll.lat(),ll.lon());
-    }
-
-    private final TileSet nullTileSet = new TileSet((LatLon)null, (LatLon)null, 0);
+        return new Coordinate(ll.lat(), ll.lon());
+    }
+
+    private final TileSet nullTileSet = new TileSet((LatLon) null, (LatLon) null, 0);
     private final class TileSet {
         int x0, x1, y0, y1;
@@ -1060,5 +1064,5 @@
          */
         private TileSet(EastNorth topLeft, EastNorth botRight, int zoom) {
-            this(getShiftedLatLon(topLeft), getShiftedLatLon(botRight),zoom);
+            this(getShiftedLatLon(topLeft), getShiftedLatLon(botRight), zoom);
         }
 
@@ -1178,4 +1182,5 @@
                     return Math.abs(t.getXtile() - centerX) + Math.abs(t.getYtile() - centerY);
                 }
+
                 @Override
                 public int compare(Tile o1, Tile o2) {
@@ -1186,5 +1191,4 @@
             };
         }
-
 
         private void loadAllTiles(boolean force) {
@@ -1208,5 +1212,4 @@
         }
     }
-
 
     private static class TileSetInfo {
@@ -1248,4 +1251,5 @@
             this.tileSetInfos = new TileSetInfo[maxZoom - minZoom + 1];
         }
+
         public TileSet getTileSet(int zoom) {
             if (zoom < minZoom)
@@ -1316,5 +1320,5 @@
             }
             // Do binary search between currentZoomLevel and displayZoomLevel
-            while (zoom > displayZoomLevel && !tsi.hasVisibleTiles && tsi.hasOverzoomedTiles){
+            while (zoom > displayZoomLevel && !tsi.hasVisibleTiles && tsi.hasOverzoomedTiles) {
                 zoom = (zoom + displayZoomLevel)/2;
                 tsi = dts.getTileSetInfo(zoom);
@@ -1422,9 +1426,9 @@
             myDrawString(g, tr("Pixel scale: {0}", getScaleFactor(currentZoomLevel)), 50, 170);
             myDrawString(g, tr("Best zoom: {0}", getBestZoom()), 50, 185);
-            if(tileLoader instanceof TMSCachedTileLoader) {
-                TMSCachedTileLoader cachedTileLoader = (TMSCachedTileLoader)tileLoader;
+            if (tileLoader instanceof TMSCachedTileLoader) {
+                TMSCachedTileLoader cachedTileLoader = (TMSCachedTileLoader) tileLoader;
                 int offset = 185;
-                for(String part: cachedTileLoader.getStats().split("\n")) {
-                    myDrawString(g, tr("Cache stats: {0}", part), 50, offset+=15);
+                for (String part: cachedTileLoader.getStats().split("\n")) {
+                    myDrawString(g, tr("Cache stats: {0}", part), 50, offset += 15);
                 }
 
@@ -1495,5 +1499,5 @@
     @Override
     public String getToolTipText() {
-        if(autoLoad) {
+        if (autoLoad) {
             return tr("{0} ({1}), automatically downloading in zoom {2}", this.getClass().getSimpleName(), getName(), currentZoomLevel);
         } else {
@@ -1553,8 +1557,7 @@
         public void cancel() {
             if (tileLoader instanceof TMSCachedTileLoader) {
-                ((TMSCachedTileLoader)tileLoader).cancelOutstandingTasks();
-            }
-        }
-
+                ((TMSCachedTileLoader) tileLoader).cancelOutstandingTasks();
+            }
+        }
 
         @Override
@@ -1581,11 +1584,11 @@
      * To prevent accidental clear of the queue, new download executor is created with separate queue
      *
-     * @param precacheTask
-     * @param points
+     * @param precacheTask Task responsible for precaching imagery
+     * @param points lat/lon coordinates to download
      * @param bufferX how many units in current Coordinate Reference System to cover in X axis in both sides
      * @param bufferY how many units in current Coordinate Reference System to cover in Y axis in both sides
      */
     public void downloadAreaToCache(final PrecacheTask precacheTask, List<LatLon> points, double bufferX, double bufferY) {
-        final Set<Tile> requestedTiles = new ConcurrentSkipListSet <>(new Comparator<Tile>() {
+        final Set<Tile> requestedTiles = new ConcurrentSkipListSet<>(new Comparator<Tile>() {
             public int compare(Tile o1, Tile o2) {
                 return String.CASE_INSENSITIVE_ORDER.compare(o1.getKey(), o2.getKey());
@@ -1604,6 +1607,6 @@
             int maxX = Math.min(curTile.getXIndex() + 1, minTile.getXIndex());
 
-            for (int x= minX; x<=maxX; x++) {
-                for (int y= minY; y<=maxY; y++) {
+            for (int x = minX; x <= maxX; x++) {
+                for (int y = minY; y <= maxY; y++) {
                     requestedTiles.add(new Tile(tileSource, x, y, currentZoomLevel));
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java	(revision 8530)
@@ -79,4 +79,5 @@
     /**
      * Constructs a new {@code ImageryLayer}.
+     * @param info imagery info
      */
     public ImageryLayer(ImageryInfo info) {
Index: /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 8530)
@@ -23,5 +23,4 @@
 import org.openstreetmap.josm.data.projection.Projection;
 
-
 /**
  * Class that displays a slippy map layer.
@@ -34,10 +33,12 @@
  */
 public class TMSLayer extends AbstractTileSourceLayer {
-    private static final String PREFERENCE_PREFIX   = "imagery.tms";
+    private static final String PREFERENCE_PREFIX = "imagery.tms";
 
     /** minimum zoom level for TMS layer */
-    public static final IntegerProperty PROP_MIN_ZOOM_LVL = new IntegerProperty(PREFERENCE_PREFIX + ".min_zoom_lvl", AbstractTileSourceLayer.PROP_MIN_ZOOM_LVL.get());
+    public static final IntegerProperty PROP_MIN_ZOOM_LVL = new IntegerProperty(PREFERENCE_PREFIX + ".min_zoom_lvl",
+            AbstractTileSourceLayer.PROP_MIN_ZOOM_LVL.get());
     /** maximum zoom level for TMS layer */
-    public static final IntegerProperty PROP_MAX_ZOOM_LVL = new IntegerProperty(PREFERENCE_PREFIX + ".max_zoom_lvl", AbstractTileSourceLayer.PROP_MAX_ZOOM_LVL.get());
+    public static final IntegerProperty PROP_MAX_ZOOM_LVL = new IntegerProperty(PREFERENCE_PREFIX + ".max_zoom_lvl",
+            AbstractTileSourceLayer.PROP_MAX_ZOOM_LVL.get());
     /** shall TMS layers be added to download dialog */
     public static final BooleanProperty PROP_ADD_TO_SLIPPYMAP_CHOOSER = new BooleanProperty(PREFERENCE_PREFIX + ".add_to_slippymap_chooser", true);
@@ -79,5 +80,5 @@
     protected Map<String, String> getHeaders(TileSource tileSource) {
         if (tileSource instanceof TemplatedTMSTileSource) {
-            return ((TemplatedTMSTileSource)tileSource).getHeaders();
+            return ((TemplatedTMSTileSource) tileSource).getHeaders();
         }
         return null;
Index: /trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java	(revision 8530)
@@ -58,5 +58,5 @@
             public void projectionChanged(Projection oldValue, Projection newValue) {
                 if (!oldValue.equals(newValue) && tileSource instanceof TemplatedWMSTileSource) {
-                    ((TemplatedWMSTileSource)tileSource).initProjection(newValue);
+                    ((TemplatedWMSTileSource) tileSource).initProjection(newValue);
                 }
 
@@ -96,5 +96,4 @@
     }
 
-
     @Override
     protected TileSource getTileSource(ImageryInfo info) throws IllegalArgumentException {
@@ -127,5 +126,4 @@
     }
 
-
     /**
      * Checks that WMS layer is a grabber-compatible one (HTML or WMS).
@@ -153,5 +151,5 @@
     protected Map<String, String> getHeaders(TileSource tileSource) {
         if (tileSource instanceof TemplatedWMSTileSource) {
-            return ((TemplatedWMSTileSource)tileSource).getHeaders();
+            return ((TemplatedWMSTileSource) tileSource).getHeaders();
         }
         return null;
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 8530)
@@ -145,6 +145,5 @@
         activeSourcesModel = new ActiveSourcesModel(selectionModel);
         tblActiveSources = new JTable(activeSourcesModel) {
-            // some kind of hack to prevent the table from scrolling slightly to the
-            // right when clicking on the text
+            // some kind of hack to prevent the table from scrolling slightly to the right when clicking on the text
             @Override
             public void scrollRectToVisible(Rectangle aRect) {
Index: /trunk/src/org/openstreetmap/josm/io/WMSLayerImporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/WMSLayerImporter.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/io/WMSLayerImporter.java	(revision 8530)
@@ -41,5 +41,4 @@
     }
 
-
     @Override
     public void importData(File file, ProgressMonitor progressMonitor) throws IOException, IllegalDataException {
@@ -61,6 +60,6 @@
                 double pixelPerDegree = ois.readDouble();
 
-                String name = (String)ois.readObject();
-                String extendedUrl = (String)ois.readObject();
+                String name = (String) ois.readObject();
+                String extendedUrl = (String) ois.readObject();
 
                 info = new ImageryInfo(name);
@@ -68,10 +67,10 @@
                 info.setPixelPerDegree(pixelPerDegree);
                 info.setTileSize(imageSize);
-            } else if (sfv == WMSLayerExporter.CURRENT_FILE_VERSION){
+            } else if (sfv == WMSLayerExporter.CURRENT_FILE_VERSION) {
                 zoomTo = (EastNorth) ois.readObject();
 
                 @SuppressWarnings("unchecked")
                 ImageryPreferenceEntry entry = Preferences.deserializeStruct(
-                        (Map<String, String>)ois.readObject(),
+                        (Map<String, String>) ois.readObject(),
                         ImageryPreferenceEntry.class);
                 info = new ImageryInfo(entry);
Index: /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java	(revision 8529)
+++ /trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java	(revision 8530)
@@ -49,13 +49,13 @@
             AbstractTileSourceLayer tsLayer = (AbstractTileSourceLayer) layer;
             if (attributes.containsKey("automatic-downloading")) {
-                tsLayer.autoLoad = new Boolean(attributes.get("automatic-downloading")).booleanValue();
+                tsLayer.autoLoad = Boolean.valueOf(attributes.get("automatic-downloading"));
             }
 
             if (attributes.containsKey("automatically-change-resolution")) {
-                tsLayer.autoZoom = new Boolean(attributes.get("automatically-change-resolution")).booleanValue();
+                tsLayer.autoZoom = Boolean.valueOf(attributes.get("automatically-change-resolution"));
             }
 
             if (attributes.containsKey("show-errors")) {
-                tsLayer.showErrors = new Boolean(attributes.get("show-errors")).booleanValue();
+                tsLayer.showErrors = Boolean.valueOf(attributes.get("show-errors"));
             }
         }
Index: /trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 8529)
+++ /trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 8530)
@@ -77,5 +77,4 @@
     }
 
-
     private void verifyMercatorTile(TemplatedWMSTileSource source, int x, int y, int z) {
         TemplatedTMSTileSource verifier = new TemplatedTMSTileSource(testImageryTMS);
@@ -97,5 +96,6 @@
                     getTileLatLon(source, tileIndex.getXIndex() + 1, tileIndex.getYIndex() + 1, z)
                     );
-            assertTrue(location.toDisplayString() + " not within " + bbox.toString() + " for tile " + z + "/" + tileIndex.getXIndex() + "/" + tileIndex.getYIndex(),
+            assertTrue(location.toDisplayString() + " not within " + bbox.toString() +
+                    " for tile " + z + "/" + tileIndex.getXIndex() + "/" + tileIndex.getYIndex(),
                     bbox.bounds(location));
         }
@@ -109,4 +109,5 @@
         return new LatLon(source.tileXYToLatLon(new Tile(source, x, y, z)));
     }
+
     private void verifyTileSquarness(TemplatedWMSTileSource source, int x, int y, int z) {
         Projection proj = Main.getProjection();
@@ -116,8 +117,5 @@
         double x_size = Math.abs(min.getX() - max.getX());
         assertEquals(x_size, y_size, 1e-05);
-
     }
-
-
 
     private TemplatedWMSTileSource getSource() {
