Skip to content

Commit f269f11

Browse files
committed
Fixing annotation for optional OCFile parameter
Changing to OCFile? is required, as the parameter is indeed nullable. This didn't turn up prior to the rebase nor was it flagged in the pre-existing code, even though it is already an issue there. What probably happened is a combination of updated detection tools and the tools purposefully only flagging changed lines. Additionally, the nullness annotation was added to the underlying Java calls, to make sure the Kotlin type definition holds true. Signed-off-by: Philipp Hasper <[email protected]>
1 parent 2b88c8f commit f269f11

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ open class FolderPickerActivity :
357357
}
358358
}
359359

360-
private fun refreshListOfFilesFragment(directory: OCFile) {
360+
private fun refreshListOfFilesFragment(directory: OCFile?) {
361361
listOfFilesFragment?.listDirectory(directory, false)
362362
}
363363

app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,11 +1474,11 @@ public void refreshDirectory() {
14741474
}
14751475
}
14761476

1477-
public void listDirectory(OCFile directory, boolean onlyOnDevice) {
1477+
public void listDirectory(@Nullable OCFile directory, boolean onlyOnDevice) {
14781478
listDirectory(directory, null, onlyOnDevice);
14791479
}
14801480

1481-
private OCFile getDirectoryForListDirectory(OCFile directory, FileDataStorageManager storageManager) {
1481+
private OCFile getDirectoryForListDirectory(@Nullable OCFile directory, FileDataStorageManager storageManager) {
14821482
if (directory == null) {
14831483
if (mFile != null) {
14841484
directory = mFile;
@@ -1502,7 +1502,7 @@ private OCFile getDirectoryForListDirectory(OCFile directory, FileDataStorageMan
15021502
*
15031503
* @param directory File to be listed
15041504
*/
1505-
public void listDirectory(OCFile directory, OCFile file, boolean onlyOnDevice) {
1505+
public void listDirectory(@Nullable OCFile directory, OCFile file, boolean onlyOnDevice) {
15061506
if (!searchFragment) {
15071507
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
15081508
if (storageManager == null) {

0 commit comments

Comments
 (0)