From 794705a8a44f03aecc83765a33f59c0a55d0f5f3 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 16 Jan 2019 11:03:18 +0100 Subject: [PATCH] codacy: Avoid declaring a variable if it is unreferenced before a possible exit point. Signed-off-by: Andy Scherzinger --- .../owncloud/android/providers/DocumentsStorageProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java b/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java index aa08b14a46..9d1c15beb6 100644 --- a/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java +++ b/src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java @@ -139,8 +139,6 @@ public class DocumentsStorageProvider extends DocumentsProvider { final long folderId = Long.parseLong(parentDocumentId); updateCurrentStorageManagerIfNeeded(folderId); - final FileCursor resultCursor = new FileCursor(projection); - final OCFile browsedDir = currentStorageManager.getFileById(folderId); Account account = currentStorageManager.getAccount(); @@ -155,6 +153,8 @@ public class DocumentsStorageProvider extends DocumentsProvider { } } + final FileCursor resultCursor = new FileCursor(projection); + for (OCFile file : currentStorageManager.getFolderContent(browsedDir, false)) { resultCursor.addFile(file); }