Index: /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 9179)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 9180)
@@ -170,5 +170,5 @@
      * @throws IllegalArgumentException when Imagery is not supported by layer
      */
-    protected abstract AbstractTMSTileSource getTileSource(ImageryInfo info) throws IllegalArgumentException;
+    protected abstract AbstractTMSTileSource getTileSource(ImageryInfo info);
 
     protected Map<String, String> getHeaders(TileSource tileSource) {
@@ -266,4 +266,6 @@
     /**
      * Returns average number of screen pixels per tile pixel for current mapview
+     * @param zoom zoom level
+     * @return average number of screen pixels per tile pixel
      */
     private double getScaleFactor(int zoom) {
@@ -874,10 +876,15 @@
     }
 
-    /*
-     * This can and will return null for tiles that are not
-     * already in the cache.
+    /**
+     * Returns tile at given position.
+     * This can and will return null for tiles that are not already in the cache.
+     * @param x tile number on the x axis of the tile to be retrieved
+     * @param y tile number on the y axis of the tile to be retrieved
+     * @param zoom zoom level of the tile to be retrieved
+     * @return tile at given position
      */
     private Tile getTile(int x, int y, int zoom) {
-        if (x < tileSource.getTileXMin(zoom) || x > tileSource.getTileXMax(zoom) || y < tileSource.getTileYMin(zoom) || y > tileSource.getTileYMax(zoom))
+        if (x < tileSource.getTileXMin(zoom) || x > tileSource.getTileXMax(zoom)
+         || y < tileSource.getTileYMin(zoom) || y > tileSource.getTileYMax(zoom))
             return null;
         return tileCache.getTile(tileSource, x, y, zoom);
@@ -1166,4 +1173,7 @@
         /**
          * Create a TileSet by EastNorth bbox taking a layer shift in account
+         * @param topLeft top-left lat/lon
+         * @param botRight bottom-right lat/lon
+         * @param zoom zoom level
          */
         private TileSet(EastNorth topLeft, EastNorth botRight, int zoom) {
@@ -1173,4 +1183,7 @@
         /**
          * Create a TileSet by known LatLon bbox without layer shift correction
+         * @param topLeft top-left lat/lon
+         * @param botRight bottom-right lat/lon
+         * @param zoom zoom level
          */
         private TileSet(LatLon topLeft, LatLon botRight, int zoom) {
@@ -1543,6 +1556,9 @@
 
     /**
-     * This isn't very efficient, but it is only used when the
-     * user right-clicks on the map.
+     * Returns tile for a pixel position.<p>
+     * This isn't very efficient, but it is only used when the user right-clicks on the map.
+     * @param px pixel X coordinate
+     * @param py pixel Y coordinate
+     * @return Tile at pixel position
      */
     private Tile getTileForPixelpos(int px, int py) {
@@ -1576,6 +1592,8 @@
         if (clickedTile == null)
             return null;
-        /*Main.debug("Clicked on tile: " + clickedTile.getXtile() + " " + clickedTile.getYtile() +
-                " currentZoomLevel: " + currentZoomLevel);*/
+        if (Main.isTraceEnabled()) {
+            Main.trace("Clicked on tile: " + clickedTile.getXtile() + " " + clickedTile.getYtile() +
+                " currentZoomLevel: " + currentZoomLevel);
+        }
         return clickedTile;
     }
