[Android] Avoid ugly cast from ArrayList to (String[])

Jean-Baptiste Kempf git at videolan.org
Sun Apr 13 17:01:39 CEST 2014


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Apr 13 17:01:16 2014 +0200| [906930318a54091bd68edf9f431984acfdd8febe] | committer: Jean-Baptiste Kempf

Avoid ugly cast from ArrayList to (String[])

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=906930318a54091bd68edf9f431984acfdd8febe
---

 vlc-android/src/org/videolan/vlc/MediaDatabase.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaDatabase.java b/vlc-android/src/org/videolan/vlc/MediaDatabase.java
index 6bd228a..7244258 100644
--- a/vlc-android/src/org/videolan/vlc/MediaDatabase.java
+++ b/vlc-android/src/org/videolan/vlc/MediaDatabase.java
@@ -237,7 +237,7 @@ public class MediaDatabase {
             } while (cursor.moveToNext());
         }
         cursor.close();
-        return (String[]) playlists.toArray();
+        return playlists.toArray(new String[playlists.size()]);
     }
 
     /**



More information about the Android mailing list