Skip to content

Commit

Permalink
[Cleanup] Fix Android Studio java warnings in anki/servicelayer #13282
Browse files Browse the repository at this point in the history
  • Loading branch information
henriqueccmac authored and david-allison committed Apr 3, 2024
1 parent 6fc2694 commit cf29254
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ import java.io.File
*
* See: [migrateFiles]
*
* Preconditions (verified inside [migrateEssentialFiles] and [migrateFiles] - exceptions thrown if not met):
* Preconditions (verified inside [MigrateEssentialFiles] and [migrateFiles] - exceptions thrown if not met):
* * Collection is not corrupt and can be opened
* * Collection basic check passes [UserActionRequiredException.CheckDatabaseException]
* * Collection can be closed and locked
* * User has space to move files [UserActionRequiredException.OutOfSpaceException] (the size of essential files + [SAFETY_MARGIN_BYTES]
* * User has space to move files [UserActionRequiredException.OutOfSpaceException] (the size of essential files + [ScopedStorageService.SAFETY_MARGIN_BYTES]
* * A migration is not currently taking place
*/
open class MigrateEssentialFiles
Expand Down Expand Up @@ -139,7 +139,7 @@ internal constructor(
/**
* Copies [file] to [destinationDirectory], retaining the same filename
*/
fun copyTopLevelFile(file: File, destinationDirectory: Directory) {
private fun copyTopLevelFile(file: File, destinationDirectory: Directory) {
val destinationPath = File(destinationDirectory.directory, file.name).path
Timber.i("Migrating essential file: '${file.name}'")
Timber.d("Copying '$file' to '$destinationPath'")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ open class MigrateUserData protected constructor(val source: Directory, val dest
var terminatedWith: Exception? = null
private set

val retriedDirectories = hashSetOf<File>()
private val retriedDirectories = hashSetOf<File>()

val loggedExceptions = mutableListOf<Exception>()
private var consecutiveExceptionsWithoutProgress = 0
Expand Down Expand Up @@ -589,7 +589,7 @@ open class MigrateUserData protected constructor(val source: Directory, val dest
/** Returns a sequence of the Files or Directories in [source] which are to be migrated */
private fun getUserDataFiles() = getDirectoryContent().filter { isUserData(it) }

fun isEssentialFileName(name: String): Boolean {
private fun isEssentialFileName(name: String): Boolean {
return MigrateEssentialFiles.PRIORITY_FILES.flatMap { it.potentialFileNames }.contains(name)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ data class MoveDirectory(val source: Directory, val destination: File) : Operati
* Create an empty directory at destination.
* Return whether it was successful.
*/
internal fun createDirectory(context: MigrationContext): Boolean {
private fun createDirectory(context: MigrationContext): Boolean {
Timber.d("creating directory '$destination'")
createDirectory(destination)

Expand Down

0 comments on commit cf29254

Please sign in to comment.