codacy: Avoid declaring a variable if it is unreferenced before a possible exit point.

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2019-01-16 11:03:18 +01:00
parent bf76349998
commit 794705a8a4
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -139,8 +139,6 @@ public class DocumentsStorageProvider extends DocumentsProvider {
final long folderId = Long.parseLong(parentDocumentId); final long folderId = Long.parseLong(parentDocumentId);
updateCurrentStorageManagerIfNeeded(folderId); updateCurrentStorageManagerIfNeeded(folderId);
final FileCursor resultCursor = new FileCursor(projection);
final OCFile browsedDir = currentStorageManager.getFileById(folderId); final OCFile browsedDir = currentStorageManager.getFileById(folderId);
Account account = currentStorageManager.getAccount(); 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)) { for (OCFile file : currentStorageManager.getFolderContent(browsedDir, false)) {
resultCursor.addFile(file); resultCursor.addFile(file);
} }