mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
FindBugs appeased
This commit is contained in:
parent
3f343a3399
commit
6c12644cf7
5 changed files with 14 additions and 18 deletions
|
@ -39,8 +39,6 @@ import com.owncloud.android.ui.activity.Preferences;
|
||||||
|
|
||||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||||
|
|
||||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main Application of the project
|
* Main Application of the project
|
||||||
|
|
|
@ -1113,10 +1113,8 @@ public class FileDataStorageManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
OCShare share = null;
|
OCShare share = null;
|
||||||
if (cursor != null) {
|
if (cursor != null && cursor.moveToFirst()) {
|
||||||
if (cursor.moveToFirst()) {
|
|
||||||
share = createShareInstance(cursor);
|
share = createShareInstance(cursor);
|
||||||
}
|
|
||||||
cursor.close();
|
cursor.close();
|
||||||
}
|
}
|
||||||
return share;
|
return share;
|
||||||
|
@ -1606,14 +1604,11 @@ public class FileDataStorageManager {
|
||||||
}
|
}
|
||||||
ArrayList<OCShare> shares = new ArrayList<OCShare>();
|
ArrayList<OCShare> shares = new ArrayList<OCShare>();
|
||||||
OCShare share = null;
|
OCShare share = null;
|
||||||
if (cursor != null) {
|
if (cursor != null && cursor.moveToFirst()) {
|
||||||
if (cursor.moveToFirst()) {
|
|
||||||
do {
|
do {
|
||||||
share = createShareInstance(cursor);
|
share = createShareInstance(cursor);
|
||||||
shares.add(share);
|
shares.add(share);
|
||||||
} while (cursor.moveToNext());
|
} while (cursor.moveToNext());
|
||||||
}
|
|
||||||
|
|
||||||
cursor.close();
|
cursor.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ import com.owncloud.android.utils.FileStorageUtils;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
|
@ -52,8 +52,10 @@ import com.owncloud.android.ui.dialog.ShareLinkToDialog;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
|
|
|
@ -291,7 +291,7 @@ public class FileStorageUtils {
|
||||||
List<File> files = new ArrayList<File>(Arrays.asList(filesArray));
|
List<File> files = new ArrayList<File>(Arrays.asList(filesArray));
|
||||||
|
|
||||||
Collections.sort(files, new Comparator<File>() {
|
Collections.sort(files, new Comparator<File>() {
|
||||||
@SuppressFBWarnings(value = "Bx")
|
@SuppressFBWarnings(value = "Bx", justification = "Would require stepping up API level")
|
||||||
public int compare(File o1, File o2) {
|
public int compare(File o1, File o2) {
|
||||||
Long obj1 = o1.lastModified();
|
Long obj1 = o1.lastModified();
|
||||||
return multiplier * obj1.compareTo(o2.lastModified());
|
return multiplier * obj1.compareTo(o2.lastModified());
|
||||||
|
@ -309,7 +309,7 @@ public class FileStorageUtils {
|
||||||
final int multiplier = mSortAscending ? 1 : -1;
|
final int multiplier = mSortAscending ? 1 : -1;
|
||||||
|
|
||||||
Collections.sort(files, new Comparator<OCFile>() {
|
Collections.sort(files, new Comparator<OCFile>() {
|
||||||
@SuppressFBWarnings(value = "Bx")
|
@SuppressFBWarnings(value = "Bx", justification = "Would require stepping up API level")
|
||||||
public int compare(OCFile o1, OCFile o2) {
|
public int compare(OCFile o1, OCFile o2) {
|
||||||
if (o1.isFolder() && o2.isFolder()) {
|
if (o1.isFolder() && o2.isFolder()) {
|
||||||
Long obj1 = o1.getFileLength();
|
Long obj1 = o1.getFileLength();
|
||||||
|
@ -338,7 +338,7 @@ public class FileStorageUtils {
|
||||||
List<File> files = new ArrayList<File>(Arrays.asList(filesArray));
|
List<File> files = new ArrayList<File>(Arrays.asList(filesArray));
|
||||||
|
|
||||||
Collections.sort(files, new Comparator<File>() {
|
Collections.sort(files, new Comparator<File>() {
|
||||||
@SuppressFBWarnings(value = "Bx")
|
@SuppressFBWarnings(value = "Bx", justification = "Would require stepping up API level")
|
||||||
public int compare(File o1, File o2) {
|
public int compare(File o1, File o2) {
|
||||||
if (o1.isDirectory() && o2.isDirectory()) {
|
if (o1.isDirectory() && o2.isDirectory()) {
|
||||||
Long obj1 = getFolderSize(o1);
|
Long obj1 = getFolderSize(o1);
|
||||||
|
@ -362,7 +362,7 @@ public class FileStorageUtils {
|
||||||
* Sorts list by Name
|
* Sorts list by Name
|
||||||
* @param files files to sort
|
* @param files files to sort
|
||||||
*/
|
*/
|
||||||
@SuppressFBWarnings(value = "Bx")
|
@SuppressFBWarnings(value = "Bx", justification = "Would require stepping up API level")
|
||||||
public static Vector<OCFile> sortOCFilesByName(Vector<OCFile> files){
|
public static Vector<OCFile> sortOCFilesByName(Vector<OCFile> files){
|
||||||
final int multiplier = mSortAscending ? 1 : -1;
|
final int multiplier = mSortAscending ? 1 : -1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue