Procházet zdrojové kódy

codacy: Avoid using implementation types like 'ArrayList'; use the interface instead

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger před 5 roky
rodič
revize
d445be1b5f

+ 3 - 3
src/main/java/com/owncloud/android/datamodel/OCFile.java

@@ -39,7 +39,7 @@ import com.owncloud.android.lib.resources.shares.ShareeUser;
 import com.owncloud.android.utils.MimeType;
 
 import java.io.File;
-import java.util.ArrayList;
+import java.util.List;
 
 import androidx.annotation.NonNull;
 import androidx.core.content.FileProvider;
@@ -57,7 +57,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
 
     private static final String TAG = OCFile.class.getSimpleName();
 
-    @Getter  @Setter private long fileId; // android internal ID of the file
+    @Getter @Setter private long fileId; // android internal ID of the file
     @Getter @Setter private long parentId;
     @Getter @Setter private long fileLength;
     @Getter @Setter private long creationTimestamp; // UNIX timestamp of the time the file was created
@@ -90,7 +90,7 @@ public class OCFile implements Parcelable, Comparable<OCFile>, ServerFileInterfa
     @Getter @Setter private String ownerId;
     @Getter @Setter private String ownerDisplayName;
     @Getter @Setter String note;
-    @Getter @Setter private ArrayList<ShareeUser> sharees;
+    @Getter @Setter private List<ShareeUser> sharees;
 
     /**
      * URI to the local path of the file contents, if stored in the device; cached after first call

+ 1 - 1
src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java

@@ -363,7 +363,7 @@ public class OCFileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
                     itemViewHolder.sharedAvatars.removeAllViews();
 
                     String fileOwner = file.getOwnerId();
-                    ArrayList<ShareeUser> sharees = file.getSharees();
+                    List<ShareeUser> sharees = file.getSharees();
 
                     // use fileOwner if not oneself, then add at first
                     ShareeUser fileOwnerSharee = new ShareeUser(fileOwner, file.getOwnerDisplayName(), ShareType.USER);