Remove superfluous casts
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user