Automated code cleanup using AndroidStudio.

This commit is contained in:
Dennis Guse
2020-04-02 08:21:04 +02:00
parent 16c654141f
commit 2ef74eb908
25 changed files with 43 additions and 57 deletions
@@ -81,7 +81,7 @@ public class AnnouncementUtils {
} else {
//TODO This seems weird; why not use Math.round(d) or Math.ceil()?
int count = (int) d;
return count < 3 ? 3 : count;
return Math.max(count, 3);
}
}
}
@@ -27,7 +27,6 @@ import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -231,9 +230,8 @@ public class FileUtils {
*
* @param src source file.
* @param dst destination file.
* @throws IOException
*/
public static void copy(FileDescriptor src, File dst) throws IOException {
*/
public static void copy(FileDescriptor src, File dst) {
try (FileChannel in = new FileInputStream(src).getChannel();
FileChannel out = new FileOutputStream(dst).getChannel()) {
in.transferTo(0, in.size(), out);