spotbugs: remove primitive boxing

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2021-10-04 13:57:31 +02:00 committed by Álvaro Brey (Rebase PR Action)
parent c2a6e587e8
commit d42b86c0eb

View file

@ -47,11 +47,9 @@ public class FileSortOrderBySize extends FileSortOrder {
Collections.sort(files, (o1, o2) -> {
if (o1.isFolder() && o2.isFolder()) {
Long obj1 = o1.getFileLength();
return multiplier * obj1.compareTo(o2.getFileLength());
return multiplier * Long.compare(o1.getFileLength(), o2.getFileLength());
} else if (o1.isFolder()) {
return -1;
} else if (o2.isFolder()) {
return 1;
} else {
@ -73,8 +71,7 @@ public class FileSortOrderBySize extends FileSortOrder {
Collections.sort(files, (o1, o2) -> {
if (o1.isFolder() && o2.isFolder()) {
Long obj1 = o1.getFileLength();
return multiplier * obj1.compareTo(o2.getFileLength());
return multiplier * Long.compare(o1.getFileLength(), o2.getFileLength());
} else if (o1.isFolder()) {
return -1;
@ -99,8 +96,8 @@ public class FileSortOrderBySize extends FileSortOrder {
Collections.sort(files, (o1, o2) -> {
if (o1.isDirectory() && o2.isDirectory()) {
Long obj1 = FileStorageUtils.getFolderSize(o1);
return multiplier * obj1.compareTo(FileStorageUtils.getFolderSize(o2));
return multiplier * Long.compare(FileStorageUtils.getFolderSize(o1),
FileStorageUtils.getFolderSize(o2));
} else if (o1.isDirectory()) {
return -1;
} else if (o2.isDirectory()) {
@ -112,5 +109,4 @@ public class FileSortOrderBySize extends FileSortOrder {
return files;
}
}