diff --git a/airsonic-main/src/main/java/org/airsonic/player/controller/AvatarUploadController.java b/airsonic-main/src/main/java/org/airsonic/player/controller/AvatarUploadController.java index 7d9eb69f..0370888b 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/controller/AvatarUploadController.java +++ b/airsonic-main/src/main/java/org/airsonic/player/controller/AvatarUploadController.java @@ -118,7 +118,7 @@ public class AvatarUploadController { // Scale down image if necessary. if (width > MAX_AVATAR_SIZE || height > MAX_AVATAR_SIZE) { - double scaleFactor = (double) MAX_AVATAR_SIZE / (double) Math.max(width, height); + double scaleFactor = MAX_AVATAR_SIZE / (double) Math.max(width, height); height = (int) (height * scaleFactor); width = (int) (width * scaleFactor); image = CoverArtController.scale(image, width, height); diff --git a/airsonic-main/src/main/java/org/airsonic/player/controller/StatusChartController.java b/airsonic-main/src/main/java/org/airsonic/player/controller/StatusChartController.java index 938d6b43..986cf509 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/controller/StatusChartController.java +++ b/airsonic-main/src/main/java/org/airsonic/player/controller/StatusChartController.java @@ -134,7 +134,7 @@ public class StatusChartController extends AbstractChartController { XYItemRenderer renderer = plot.getRendererForDataset(dataset); renderer.setSeriesPaint(0, Color.blue.darker()); - renderer.setSeriesStroke(0, new BasicStroke(2f)); + renderer.setSeriesStroke(0, new BasicStroke(2.0f)); // Set theme-specific colors. Color bgColor = getBackground(request); diff --git a/airsonic-main/src/main/java/org/airsonic/player/service/jukebox/PlayerTest.java b/airsonic-main/src/main/java/org/airsonic/player/service/jukebox/PlayerTest.java index 0fffa1e9..11c6b30d 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/service/jukebox/PlayerTest.java +++ b/airsonic-main/src/main/java/org/airsonic/player/service/jukebox/PlayerTest.java @@ -48,7 +48,7 @@ public class PlayerTest implements AudioPlayer.Listener { }); gainSlider.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { - float gain = (float) gainSlider.getValue() / 1000.0F; + float gain = gainSlider.getValue() / 1000.0F; player.setGain(gain); } }); diff --git a/airsonic-main/src/main/java/org/airsonic/player/util/StringUtil.java b/airsonic-main/src/main/java/org/airsonic/player/util/StringUtil.java index 17d30bd2..29cd12e6 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/util/StringUtil.java +++ b/airsonic-main/src/main/java/org/airsonic/player/util/StringUtil.java @@ -200,25 +200,25 @@ public final class StringUtil { // More than 1 TB? if (byteCount >= 1024L * 1024 * 1024 * 1024) { NumberFormat teraByteFormat = new DecimalFormat("0.00 TB", new DecimalFormatSymbols(locale)); - return teraByteFormat.format( ((double) byteCount ) / ((double) 1024 * 1024 * 1024 * 1024)); + return teraByteFormat.format( byteCount / ((double) 1024 * 1024 * 1024 * 1024)); } // More than 1 GB? if (byteCount >= 1024L * 1024 * 1024) { NumberFormat gigaByteFormat = new DecimalFormat("0.00 GB", new DecimalFormatSymbols(locale)); - return gigaByteFormat.format((double) byteCount / ((double) 1024 * 1024 * 1024)); + return gigaByteFormat.format(byteCount / ((double) 1024 * 1024 * 1024)); } // More than 1 MB? if (byteCount >= 1024L * 1024) { NumberFormat megaByteFormat = new DecimalFormat("0.0 MB", new DecimalFormatSymbols(locale)); - return megaByteFormat.format((double) byteCount / ((double) 1024 * 1024)); + return megaByteFormat.format(byteCount / ((double) 1024 * 1024)); } // More than 1 KB? if (byteCount >= 1024L) { NumberFormat kiloByteFormat = new DecimalFormat("0 KB", new DecimalFormatSymbols(locale)); - return kiloByteFormat.format((double) byteCount / ((double) 1024)); + return kiloByteFormat.format((double) byteCount / 1024); } return byteCount + " B"; diff --git a/airsonic-main/src/test/java/org/airsonic/player/io/RangeOutputStreamTestCase.java b/airsonic-main/src/test/java/org/airsonic/player/io/RangeOutputStreamTestCase.java index 10e2f0eb..8668dc73 100644 --- a/airsonic-main/src/test/java/org/airsonic/player/io/RangeOutputStreamTestCase.java +++ b/airsonic-main/src/test/java/org/airsonic/player/io/RangeOutputStreamTestCase.java @@ -65,7 +65,7 @@ public class RangeOutputStreamTestCase extends TestCase { private void doTestWrap(int first, Integer last, int sourceSize, int bufferSize) throws Exception { byte[] source = createSource(sourceSize); ByteArrayOutputStream out = new ByteArrayOutputStream(); - OutputStream rangeOut = RangeOutputStream.wrap(out, new HttpRange((long) first, last == null ? null : last.longValue())); + OutputStream rangeOut = RangeOutputStream.wrap(out, new HttpRange(first, last == null ? null : last.longValue())); copy(source, rangeOut, bufferSize); verify(out.toByteArray(), first, last, sourceSize); }