[Android] Base diffutil adapter: set some variables final

Geoffrey Métais git at videolan.org
Thu Sep 21 16:40:16 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Sep 21 16:39:34 2017 +0200| [a7b2daeafed4dde89fc9bf7de143c7fd3290fa00] | committer: Geoffrey Métais

Base diffutil adapter: set some variables final

> https://code.videolan.org/videolan/vlc-android/commit/a7b2daeafed4dde89fc9bf7de143c7fd3290fa00
---

 vlc-android/src/org/videolan/vlc/gui/BaseQueuedAdapter.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/BaseQueuedAdapter.java b/vlc-android/src/org/videolan/vlc/gui/BaseQueuedAdapter.java
index 6585035d6..93e767a2b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/BaseQueuedAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/BaseQueuedAdapter.java
@@ -35,7 +35,7 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.RejectedExecutionException;
 
 public abstract class BaseQueuedAdapter <T extends MediaLibraryItem, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> {
-    protected final ExecutorService mUpdateExecutor = Executors.newSingleThreadExecutor();
+    private final ExecutorService mUpdateExecutor = Executors.newSingleThreadExecutor();
 
     protected volatile ArrayList<T> mDataset = new ArrayList<>();
     private final ArrayDeque<ArrayList<T>> mPendingUpdates = new ArrayDeque<>();
@@ -100,7 +100,7 @@ public abstract class BaseQueuedAdapter <T extends MediaLibraryItem, VH extends
         if (mPendingUpdates.isEmpty())
             onUpdateFinished();
         else {
-            ArrayList<T> lastList = mPendingUpdates.peekLast();
+            final ArrayList<T> lastList = mPendingUpdates.peekLast();
             if (!mPendingUpdates.isEmpty()) {
                 mPendingUpdates.clear();
                 mPendingUpdates.add(lastList);



More information about the Android mailing list