Index: /trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java	(revision 10964)
+++ /trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java	(revision 10965)
@@ -201,5 +201,5 @@
         IDiskCacheAttributes ret;
         removeStaleFiles(cachePath + File.separator + cacheName, USE_BLOCK_CACHE.get() ? "_INDEX_v2" : "_BLOCK_v2");
-        cacheName = cacheName + (USE_BLOCK_CACHE.get() ? "_BLOCK_v2" : "_INDEX_v2");
+        String newCacheName = cacheName + (USE_BLOCK_CACHE.get() ? "_BLOCK_v2" : "_INDEX_v2");
 
         if (USE_BLOCK_CACHE.get()) {
@@ -211,5 +211,5 @@
              * wants to reduce the file size, (s)he may just go to preferences and there it should be handled (by removing old file)
              */
-            File diskCacheFile = new File(cachePath + File.separator + cacheName + ".data");
+            File diskCacheFile = new File(cachePath + File.separator + newCacheName + ".data");
             if (diskCacheFile.exists()) {
                 blockAttr.setMaxKeySize((int) Math.max(maxDiskObjects, diskCacheFile.length()/1024));
@@ -231,5 +231,5 @@
             ret.setDiskPath(cachePath);
         }
-        ret.setCacheName(cacheName);
+        ret.setCacheName(newCacheName);
 
         return ret;
Index: /trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java	(revision 10964)
+++ /trunk/src/org/openstreetmap/josm/data/projection/proj/ObliqueMercator.java	(revision 10965)
@@ -414,12 +414,12 @@
         double up = (vp * cosgamma0 + sp * singamma0) / (0.5 * (qp + temp));
         if (Math.abs(Math.abs(up) - 1.0) < EPSILON) {
-            x = 0.0;
-            y = up < 0.0 ? -Math.PI / 2.0 : Math.PI / 2.0;
+            return new double[] {
+                up < 0.0 ? -(Math.PI / 2.0) : (Math.PI / 2.0),
+                0.0};
         } else {
-            y = Math.pow(e / Math.sqrt((1. + up) / (1. - up)), 1.0 / b);  //calculate t
-            y = cphi2(y);
-            x = -Math.atan2(sp * cosgamma0 - vp * singamma0, Math.cos(bra * u)) / b;
-        }
-        return new double[] {y, x};
+            return new double[] {
+                cphi2(Math.pow(e / Math.sqrt((1. + up) / (1. - up)), 1.0 / b)), //calculate t
+                -Math.atan2(sp * cosgamma0 - vp * singamma0, Math.cos(bra * u)) / b};
+        }
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java	(revision 10964)
+++ /trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java	(revision 10965)
@@ -157,17 +157,17 @@
             return false;
         }
-        domain = unicodeToASCII(domain);
+        String asciiDomain = unicodeToASCII(domain);
         // hosts must be equally reachable via punycode and Unicode
         // Unicode is never shorter than punycode, so check punycode
         // if domain did not convert, then it will be caught by ASCII
         // checks in the regexes below
-        if (domain.length() > MAX_DOMAIN_LENGTH) {
+        if (asciiDomain.length() > MAX_DOMAIN_LENGTH) {
             return false;
         }
-        String[] groups = domainRegex.match(domain);
+        String[] groups = domainRegex.match(asciiDomain);
         if (groups != null && groups.length > 0) {
             return isValidTld(groups[0]);
         }
-        return allowLocal && hostnameRegex.isValid(domain);
+        return allowLocal && hostnameRegex.isValid(asciiDomain);
     }
 
@@ -183,15 +183,15 @@
             return false;
         }
-        domain = unicodeToASCII(domain);
+        String asciiDomain = unicodeToASCII(domain);
         // hosts must be equally reachable via punycode and Unicode
         // Unicode is never shorter than punycode, so check punycode
         // if domain did not convert, then it will be caught by ASCII
         // checks in the regexes below
-        if (domain.length() > MAX_DOMAIN_LENGTH) {
+        if (asciiDomain.length() > MAX_DOMAIN_LENGTH) {
             return false;
         }
-        String[] groups = domainRegex.match(domain);
+        String[] groups = domainRegex.match(asciiDomain);
         return (groups != null && groups.length > 0)
-                || hostnameRegex.isValid(domain);
+                || hostnameRegex.isValid(asciiDomain);
     }
 
@@ -204,11 +204,11 @@
      */
     public boolean isValidTld(String tld) {
-        tld = unicodeToASCII(tld);
-        if (allowLocal && isValidLocalTld(tld)) {
+        String asciiTld = unicodeToASCII(tld);
+        if (allowLocal && isValidLocalTld(asciiTld)) {
             return true;
         }
-        return isValidInfrastructureTld(tld)
-                || isValidGenericTld(tld)
-                || isValidCountryCodeTld(tld);
+        return isValidInfrastructureTld(asciiTld)
+                || isValidGenericTld(asciiTld)
+                || isValidCountryCodeTld(asciiTld);
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10964)
+++ /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10965)
@@ -442,9 +442,9 @@
     public static void addLayerChangeListener(LayerChangeListener listener, boolean initialFire) {
         if (listener != null) {
-            initialFire = initialFire && (Main.isDisplayingMapView() || fireDeprecatedListenerOnAdd);
-
-            LayerChangeAdapter adapter = new LayerChangeAdapter(listener, initialFire);
-            Main.getLayerManager().addLayerChangeListener(adapter, initialFire);
-            if (initialFire) {
+            boolean doInitialFire = initialFire && (Main.isDisplayingMapView() || fireDeprecatedListenerOnAdd);
+
+            LayerChangeAdapter adapter = new LayerChangeAdapter(listener, doInitialFire);
+            Main.getLayerManager().addLayerChangeListener(adapter, doInitialFire);
+            if (doInitialFire) {
                 Main.getLayerManager().addAndFireActiveLayerChangeListener(adapter);
             } else {
Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 10964)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 10965)
@@ -550,22 +550,23 @@
      * Zoom to the given coordinate and scale.
      *
-     * @param newCenter The center x-value (easting) to zoom to.
-     * @param newScale The scale to use.
+     * @param center The center x-value (easting) to zoom to.
+     * @param scale The scale to use.
      * @param initial true if this call initializes the viewport.
      */
-    public void zoomTo(EastNorth newCenter, double newScale, boolean initial) {
+    public void zoomTo(EastNorth center, double scale, boolean initial) {
         Bounds b = getProjection().getWorldBoundsLatLon();
         ProjectionBounds pb = getProjection().getWorldBoundsBoxEastNorth();
+        double newScale = scale;
         int width = getWidth();
         int height = getHeight();
 
         // make sure, the center of the screen is within projection bounds
-        double east = newCenter.east();
-        double north = newCenter.north();
+        double east = center.east();
+        double north = center.north();
         east = Math.max(east, pb.minEast);
         east = Math.min(east, pb.maxEast);
         north = Math.max(north, pb.minNorth);
         north = Math.min(north, pb.maxNorth);
-        newCenter = new EastNorth(east, north);
+        EastNorth newCenter = new EastNorth(east, north);
 
         // don't zoom out too much, the world bounds should be at least
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java	(revision 10964)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java	(revision 10965)
@@ -71,5 +71,5 @@
                 firstGroupIdx = i;
             }
-            lastWct = wct;
+            return wct;
         }
         return lastWct;
Index: /trunk/src/org/openstreetmap/josm/gui/layer/imagery/ColorfulImageProcessor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/imagery/ColorfulImageProcessor.java	(revision 10964)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/imagery/ColorfulImageProcessor.java	(revision 10965)
@@ -77,9 +77,10 @@
 
         @Override
-        public BufferedImage filter(BufferedImage src, BufferedImage dest) {
+        public BufferedImage filter(BufferedImage src, BufferedImage dst) {
             if (src.getWidth() == 0 || src.getHeight() == 0) {
                 return src;
             }
 
+            BufferedImage dest = dst;
             if (dest == null) {
                 dest = createCompatibleDestImage(src, null);
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java	(revision 10964)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java	(revision 10965)
@@ -803,9 +803,9 @@
 
         protected static Method getMethod(String id) {
-            id = id.replaceAll("-|_", "");
+            String cleanId = id.replaceAll("-|_", "");
             for (Method method : PseudoClasses.class.getDeclaredMethods()) {
                 // for backwards compatibility, consider :sameTags == :same-tags == :same_tags (#11150)
                 final String methodName = method.getName().replaceAll("-|_", "");
-                if (methodName.equalsIgnoreCase(id)) {
+                if (methodName.equalsIgnoreCase(cleanId)) {
                     return method;
                 }
Index: /trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java	(revision 10964)
+++ /trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java	(revision 10965)
@@ -130,9 +130,8 @@
     }
 
-    protected void scanLocalPluginRepository(ProgressMonitor monitor, File pluginsDirectory) {
+    protected void scanLocalPluginRepository(ProgressMonitor progressMonitor, File pluginsDirectory) {
         if (pluginsDirectory == null)
             return;
-        if (monitor == null)
-            monitor = NullProgressMonitor.INSTANCE;
+        ProgressMonitor monitor = progressMonitor != null ? progressMonitor : NullProgressMonitor.INSTANCE;
         try {
             monitor.beginTask("");
