Index: /trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 10181)
@@ -287,5 +287,5 @@
         case "download":
 
-            if (lastZoomTime > 0 && System.currentTimeMillis() - lastZoomTime > Main.pref.getLong("zoom.bounds.reset.time", 10*1000)) {
+            if (lastZoomTime > 0 && System.currentTimeMillis() - lastZoomTime > Main.pref.getLong("zoom.bounds.reset.time", 10L*1000L)) {
                 lastZoomTime = -1;
             }
Index: /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/actions/JumpToAction.java	(revision 10181)
@@ -187,5 +187,5 @@
 
             // 10 000 000 = 10 000 * 1000 = World * (km -> m)
-            zm.setText(Double.toString(Math.round(10000000 * Math.pow(2, (-1) * zoomLvl))));
+            zm.setText(Double.toString(Math.round(10000000d * Math.pow(2d, (-1d) * zoomLvl))));
         }
     }
Index: /trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 10181)
@@ -562,5 +562,5 @@
     private static void execCommands(List<Command> cmds, List<Node> newNodes) {
         Main.main.undoRedo.add(new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
-                trn("Dupe into {0} node", "Dupe into {0} nodes", newNodes.size() + 1, newNodes.size() + 1), cmds));
+                trn("Dupe into {0} node", "Dupe into {0} nodes", newNodes.size() + 1L, newNodes.size() + 1L), cmds));
         // select one of the new nodes
         getCurrentDataSet().setSelected(newNodes.get(0));
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 10181)
@@ -1142,5 +1142,5 @@
         Point p2 = mv.getPoint(currentMouseEastNorth);
 
-        double t = Math.atan2(p2.y-p1.y, p2.x-p1.x) + Math.PI;
+        double t = Math.atan2((double) p2.y - p1.y, (double) p2.x - p1.x) + Math.PI;
 
         b.moveTo(p1.x, p1.y);
@@ -1483,5 +1483,5 @@
                 if (absoluteFix) {
                     b.moveTo(p2.x, p2.y);
-                    b.lineTo(2*p1.x-p2.x, 2*p1.y-p2.y); // bi-directional line
+                    b.lineTo(2f*p1.x-p2.x, 2f*p1.y-p2.y); // bi-directional line
                 } else {
                     b.moveTo(p2.x, p2.y);
Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 10181)
@@ -99,5 +99,5 @@
     };
 
-    private static final long MAX_AGE_DEFAULT_PREFERENCES = 60 * 60 * 24 * 50; // 50 days (in seconds)
+    private static final long MAX_AGE_DEFAULT_PREFERENCES = 60L * 60L * 24L * 50L; // 50 days (in seconds)
 
     /**
Index: /trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java	(revision 10181)
@@ -26,4 +26,6 @@
 import org.openstreetmap.josm.tools.HttpClient;
 import org.openstreetmap.josm.tools.Utils;
+
+import sun.net.www.protocol.http.HttpURLConnection;
 
 /**
@@ -340,10 +342,9 @@
             }
 
-
             attributes = parseHeaders(urlConn);
 
             for (int i = 0; i < 5; ++i) {
-                if (urlConn.getResponseCode() == 503) {
-                    Thread.sleep(5000+(new Random()).nextInt(5000));
+                if (urlConn.getResponseCode() == HttpURLConnection.HTTP_UNAVAILABLE) {
+                    Thread.sleep(5000L+(new Random()).nextInt(5000));
                     continue;
                 }
@@ -351,5 +352,5 @@
                 attributes.setResponseCode(urlConn.getResponseCode());
                 byte[] raw;
-                if (urlConn.getResponseCode() == 200) {
+                if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
                     raw = Utils.readBytesFromStream(urlConn.getContent());
                 } else {
Index: /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/coor/LatLon.java	(revision 10181)
@@ -174,5 +174,5 @@
         if (cDms60.equals(sSeconds)) {
             sSeconds = cDms00;
-            sMinutes = cDmsMinuteFormatter.format(tMinutes+1);
+            sMinutes = cDmsMinuteFormatter.format(tMinutes+1L);
         }
         if ("60".equals(sMinutes)) {
Index: /trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java	(revision 10181)
@@ -25,7 +25,7 @@
         // The question is how far we move for each bit being set.
         // In the case of the top level, we move half of the world.
-        double xUnit = X_PARTS/2;
-        double yUnit = Y_PARTS/2;
-        long shift = (NR_LEVELS*2)-2;
+        double xUnit = X_PARTS/2d;
+        double yUnit = Y_PARTS/2d;
+        long shift = (NR_LEVELS*2L)-2L;
 
         double x = 0;
Index: /trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java	(revision 10181)
@@ -119,5 +119,5 @@
             // use well known scale set "GoogleCompatibile" from OGC WMTS spec to calculate number of tiles per zoom level
             // this makes the zoom levels "glued" to standard TMS zoom levels
-            degreesPerTile[zoom] = (SCALE_DENOMINATOR_ZOOM_LEVEL_1 / Math.pow(2, zoom - 1)) * crsScale;
+            degreesPerTile[zoom] = (SCALE_DENOMINATOR_ZOOM_LEVEL_1 / Math.pow(2d, zoom - 1d)) * crsScale;
             TileXY minTileIndex = eastNorthToTileXY(topLeft, zoom);
             tileXMin[zoom] = minTileIndex.getXIndex();
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java	(revision 10181)
@@ -221,8 +221,8 @@
                     int x = (p.x+lastP.x)/2;
                     int y = (p.y+lastP.y)/2;
-                    path.moveTo(x-virtualNodeSize, y);
-                    path.lineTo(x+virtualNodeSize, y);
-                    path.moveTo(x, y-virtualNodeSize);
-                    path.lineTo(x, y+virtualNodeSize);
+                    path.moveTo((float) x-virtualNodeSize, y);
+                    path.lineTo((float) x+virtualNodeSize, y);
+                    path.moveTo(x, (float) y-virtualNodeSize);
+                    path.lineTo(x, (float) y+virtualNodeSize);
                 }
                 lastP = p;
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/LineClip.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/LineClip.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/LineClip.java	(revision 10181)
@@ -39,5 +39,6 @@
         }
         return cohenSutherland(p1.x, p1.y, p2.x, p2.y, clipBounds.x, clipBounds.y,
-                clipBounds.x + clipBounds.width, clipBounds.y + clipBounds.height);
+                (long) clipBounds.x + clipBounds.width,
+                (long) clipBounds.y + clipBounds.height);
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 10181)
@@ -144,5 +144,5 @@
             int dxNext = next.x - current.x;
             int dyNext = next.y - current.y;
-            double lenNext = Math.sqrt(dxNext*dxNext + dyNext*dyNext);
+            double lenNext = Math.sqrt((double) dxNext*dxNext + (double) dyNext*dyNext);
 
             if (lenNext == 0) {
@@ -814,6 +814,6 @@
                 final double segmentLength = thisP.distance(lastP);
 
-                final double dx = thisP.x - lastP.x;
-                final double dy = thisP.y - lastP.y;
+                final double dx = (double) thisP.x - lastP.x;
+                final double dy = (double) thisP.y - lastP.y;
 
                 // pos is the position from the beginning of the current segment
@@ -1263,6 +1263,6 @@
 
             if (lastPoint != null) {
-                dx = p.x - lastPoint.x;
-                dy = p.y - lastPoint.y;
+                dx = (long) p.x - lastPoint.x;
+                dy = (long) p.y - lastPoint.y;
                 double segmentLength = Math.sqrt(dx*dx + dy*dy);
                 if (segmentLength > 2*(rec.getWidth()+4)) {
@@ -1756,6 +1756,6 @@
         // Can be optimized if it turns out to be slow.
         for (int i = 1; i < poly.npoints; ++i) {
-            dx = poly.xpoints[i] - poly.xpoints[i-1];
-            dy = poly.ypoints[i] - poly.ypoints[i-1];
+            dx = (long) poly.xpoints[i] - poly.xpoints[i-1];
+            dy = (long) poly.ypoints[i] - poly.ypoints[i-1];
             segLen = Math.sqrt(dx*dx + dy*dy);
             if (totalLen > curLen + segLen) {
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java	(revision 10181)
@@ -432,6 +432,6 @@
                 final double sy = l * (p1.y - p2.y);
 
-                path.lineTo(p2.x + (int) Math.round(cosPHI * sx - sinPHI * sy), p2.y + (int) Math.round(sinPHI * sx + cosPHI * sy));
-                path.moveTo(p2.x + (int) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (int) Math.round(-sinPHI * sx + cosPHI * sy));
+                path.lineTo(p2.x + (float) Math.round(cosPHI * sx - sinPHI * sy), p2.y + (float) Math.round(sinPHI * sx + cosPHI * sy));
+                path.moveTo(p2.x + (float) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (float) Math.round(-sinPHI * sx + cosPHI * sy));
                 path.lineTo(p2.x, p2.y);
             }
Index: /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 10181)
@@ -249,5 +249,5 @@
                 if (zone == null || zone < 1 || zone > 60)
                     throw new ProjectionConfigurationException(tr("Expected integer value in range 1-60 for ''+zone=...'' parameter."));
-                this.lon0 = 6 * zone - 183;
+                this.lon0 = 6d * zone - 183d;
                 this.k0 = 0.9996;
                 this.x0 = 500000;
Index: /trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java	(revision 10181)
@@ -141,5 +141,5 @@
     protected void drawSegment(Point p1, Point p2, Color color) {
 
-        double t = Math.atan2(p2.x - p1.x, p2.y - p1.y);
+        double t = Math.atan2((double) p2.x - p1.x, (double) p2.y - p1.y);
         double cosT = 5 * Math.cos(t);
         double sinT = 5 * Math.sin(t);
Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 10181)
@@ -635,5 +635,5 @@
                         zoomTo(oldCenter.interpolate(finalNewCenter, (i+1) / frames));
                         try {
-                            Thread.sleep(1000 / fps);
+                            Thread.sleep(1000L / fps);
                         } catch (InterruptedException ex) {
                             Main.warn("InterruptedException in "+NavigatableComponent.class.getSimpleName()+" during smooth scrolling");
Index: /trunk/src/org/openstreetmap/josm/gui/layer/Layer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/Layer.java	(revision 10181)
@@ -169,5 +169,5 @@
     public void hookUpMapView() {
         // calculate total memory needed for all layers
-        long memoryBytesRequired = 50 * 1024 * 1024; // assumed minimum JOSM memory footprint
+        long memoryBytesRequired = 50L * 1024L * 1024L; // assumed minimum JOSM memory footprint
         if (Main.map != null && Main.map.mapView != null) {
             for (Layer layer: Main.map.mapView.getAllLayers()) {
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 10181)
@@ -925,5 +925,5 @@
                     lblTimezone.setText(tr("Timezone: {0}", timezone.formatTimezone()));
                     lblMinutes.setText(tr("Minutes: {0}", sldMinutes.getValue()));
-                    lblSeconds.setText(tr("Seconds: {0}", Offset.milliseconds(100 * sldSeconds.getValue()).formatOffset()));
+                    lblSeconds.setText(tr("Seconds: {0}", Offset.milliseconds(100L * sldSeconds.getValue()).formatOffset()));
 
                     delta = Offset.milliseconds(100 * sldSeconds.getValue()
Index: /trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 10181)
@@ -419,5 +419,5 @@
                             || screen.y < oldA.y - delta || screen.y > oldA.y + delta)) {
                         g.setColor(trkPnt.customColoring);
-                        double t = Math.atan2(screen.y - old.y, screen.x - old.x) + Math.PI;
+                        double t = Math.atan2((double) screen.y - old.y, (double) screen.x - old.x) + Math.PI;
                         g.drawLine(screen.x, screen.y, (int) (screen.x + 10 * Math.cos(t - PHI)),
                                 (int) (screen.y + 10 * Math.sin(t - PHI)));
Index: /trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java	(revision 10181)
@@ -68,5 +68,5 @@
         setDescription(description);
         if (fontPlus != 0) {
-            setFont(getFont().deriveFont(0, getFont().getSize()+fontPlus));
+            setFont(getFont().deriveFont(0, (float) getFont().getSize()+fontPlus));
         }
         refresh();
Index: /trunk/src/org/openstreetmap/josm/io/CachedFile.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 10181)
@@ -76,5 +76,5 @@
 
     public static final long DEFAULT_MAXTIME = -1L;
-    public static final long DAYS = 24*60*60; // factor to get caching time in days
+    public static final long DAYS = 24L*60L*60L; // factor to get caching time in days
 
     private final Map<String, String> httpHeaders = new ConcurrentHashMap<>();
Index: /trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 10181)
@@ -96,5 +96,5 @@
             Main.info(tr("{0} not available (offline mode)", tr("Message notifier")));
         } else if (!isRunning() && interval > 0 && isUserEnoughIdentified()) {
-            task = EXECUTOR.scheduleAtFixedRate(WORKER, 0, interval * 60, TimeUnit.SECONDS);
+            task = EXECUTOR.scheduleAtFixedRate(WORKER, 0, interval * 60L, TimeUnit.SECONDS);
             Main.info("Message notifier active (checks every "+interval+" minute"+(interval > 1 ? "s" : "")+')');
         }
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 10180)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 10181)
@@ -68,5 +68,5 @@
         }
         double uploadsPerMs = (double) progress / elapsed;
-        double uploadsLeft = listSize - progress;
+        double uploadsLeft = (double) listSize - progress;
         long msLeft = (long) (uploadsLeft / uploadsPerMs);
         long minutesLeft = msLeft / MSECS_PER_MINUTE;
