[Android] MediaWrapperList: Simplify initialization

Geoffrey Métais git at videolan.org
Wed Jan 31 10:31:55 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan 31 10:31:03 2018 +0100| [f701ad105c583a2c7c86f76c9057c71707312ebb] | committer: Geoffrey Métais

MediaWrapperList: Simplify initialization

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

 vlc-android/src/org/videolan/vlc/media/MediaWrapperList.java | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/media/MediaWrapperList.java b/vlc-android/src/org/videolan/vlc/media/MediaWrapperList.java
index 185ad90ec..ec7239d0b 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaWrapperList.java
+++ b/vlc-android/src/org/videolan/vlc/media/MediaWrapperList.java
@@ -41,15 +41,10 @@ public class MediaWrapperList {
     private static final int EVENT_MOVED = 2;
 
     /* TODO: add locking */
-    private List<MediaWrapper> mInternalList;
-    private List<EventListener> mEventListenerList;
+    private final List<MediaWrapper> mInternalList = new ArrayList<>();
+    private final List<EventListener> mEventListenerList = new ArrayList<>();
     private int mVideoCount = 0;
 
-    public MediaWrapperList() {
-        mEventListenerList = new ArrayList<>();
-        mInternalList = new ArrayList<>();
-    }
-
     public synchronized void add(MediaWrapper media) {
         mInternalList.add(media);
         signalEventListeners(EVENT_ADDED, mInternalList.size()-1, -1, media.getLocation());



More information about the Android mailing list