Skip to content

Commit

Permalink
Merge pull request #4138 from Bambooin/code-style
Browse files Browse the repository at this point in the history
Replace wildcard import with single import
  • Loading branch information
VishalNehra authored Apr 21, 2024
2 parents c6661af + e6b9698 commit 29604c2
Show file tree
Hide file tree
Showing 56 changed files with 126 additions and 61 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
root = true

[*.{kt,kts}]
ktlint_standard_no-wildcard-imports = disabled
ktlint_standard_property-naming = disabled
ktlint_standard_value-argument-comment = disabled
ktlint_standard_kdoc-wrapping = disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import com.amaze.filemanager.R
import com.amaze.filemanager.ui.activities.PreferencesActivity
import com.amaze.filemanager.ui.fragments.preferencefragments.BackupPrefsFragment
import com.google.gson.*
import com.google.gson.GsonBuilder
import com.google.gson.reflect.TypeToken
import org.junit.Assert
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import com.amaze.filemanager.ui.activities.MainActivity
import com.amaze.filemanager.ui.fragments.MainFragment
import com.amaze.filemanager.utils.DataUtils
import java.io.File
import java.util.ArrayList
import kotlin.concurrent.thread

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,23 @@

package com.amaze.filemanager.adapters;

import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.*;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtension7zip;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionApk;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionApks;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionBzip2;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionBzip2TarLong;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionBzip2TarShort;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionGz;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionGzipTarLong;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionGzipTarShort;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionJar;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionLzma;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionRar;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionTar;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionTarLzma;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionTarXz;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionXz;
import static com.amaze.filemanager.filesystem.compressed.CompressedHelper.fileExtensionZip;
import static com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_COLORIZE_ICONS;
import static com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_SHOW_FILE_SIZE;
import static com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_SHOW_GOBACK_BUTTON;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package com.amaze.filemanager.adapters.data

import com.amaze.filemanager.utils.safeLet
import java.util.Comparator

class AppDataSorter(var sort: Int, isAscending: Boolean) :
Comparator<AppDataParcelable?> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory
import java.io.IOException
import java.io.LineNumberReader
import java.io.StringReader
import java.util.ArrayList

class SearchTextTask(
private val textToSearch: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import java.io.FileInputStream
import java.io.IOException
import java.io.InputStream
import java.lang.ref.WeakReference
import java.util.*

abstract class AbstractCommonsArchiveHelperCallable(
context: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import com.amaze.filemanager.adapters.data.CompressedObjectParcelable
import org.apache.commons.compress.archivers.ArchiveException
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.util.*
import java.util.Collections
import java.util.concurrent.Callable

abstract class CompressedHelperCallable internal constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package com.amaze.filemanager.asynchronous.asynctasks.compress

import com.amaze.filemanager.adapters.data.CompressedObjectParcelable
import java.util.ArrayList

/**
* For gzip, bz2, lzma and xz compressed files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import net.lingala.zip4j.model.FileHeader
import org.apache.commons.compress.archivers.ArchiveException
import java.io.File
import java.lang.ref.WeakReference
import kotlin.collections.ArrayList

class ZipHelperCallable(
c: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.afollestad.materialdialogs.DialogAction
import com.afollestad.materialdialogs.MaterialDialog
import com.amaze.filemanager.R
import com.amaze.filemanager.asynchronous.asynctasks.fromTask
import com.amaze.filemanager.asynchronous.asynctasks.movecopy.PreparePasteTask.CopyNode
import com.amaze.filemanager.asynchronous.management.ServiceWatcherUtil
import com.amaze.filemanager.asynchronous.services.CopyService
import com.amaze.filemanager.databinding.CopyDialogBinding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package com.amaze.filemanager.asynchronous.asynctasks.searchfilesystem

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.amaze.filemanager.asynchronous.asynctasks.searchfilesystem.FileSearch.SearchFilter
import com.amaze.filemanager.filesystem.HybridFileParcelable
import java.util.Locale
import java.util.regex.Pattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import net.schmizz.sshj.transport.verification.HostKeyVerifier
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.security.PublicKey
import java.util.*
import java.util.Collections
import java.util.concurrent.Callable
import java.util.concurrent.CountDownLatch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.io.IOException
import java.lang.ref.WeakReference
import java.util.*
import java.util.Locale

class ReadTextFileTask(
activity: TextEditorActivity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@
* this class can only handle progress with one object at a time. Hence, class also provides
* convenience methods to serialize the service startup.
*/
import static com.amaze.filemanager.asynchronous.management.ServiceWatcherUtil.ServiceStatusCallbacks.*;
import static com.amaze.filemanager.asynchronous.management.ServiceWatcherUtil.ServiceStatusCallbacks.STATE_HALTED;
import static com.amaze.filemanager.asynchronous.management.ServiceWatcherUtil.ServiceStatusCallbacks.STATE_RESUMED;
import static com.amaze.filemanager.asynchronous.management.ServiceWatcherUtil.ServiceStatusCallbacks.STATE_UNSET;

import java.lang.ref.WeakReference;
import java.util.concurrent.*;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.TimeUnit;

import com.amaze.filemanager.R;
import com.amaze.filemanager.asynchronous.AbstractRepeatingRunnable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ package com.amaze.filemanager.asynchronous.services

import android.app.PendingIntent
import android.app.PendingIntent.FLAG_UPDATE_CURRENT
import android.content.*
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.SharedPreferences
import android.net.Uri
import android.os.Build.VERSION.SDK_INT
import android.os.Build.VERSION_CODES.O
Expand Down Expand Up @@ -52,11 +56,15 @@ import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.io.*
import java.io.BufferedInputStream
import java.io.BufferedOutputStream
import java.io.File
import java.io.FileInputStream
import java.io.IOException
import java.io.OutputStream
import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.attribute.BasicFileAttributes
import java.util.*
import java.util.zip.ZipEntry
import java.util.zip.ZipException
import java.util.zip.ZipOutputStream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import org.slf4j.LoggerFactory
import java.io.IOException
import java.security.GeneralSecurityException
import java.security.KeyStore
import java.util.*
import java.util.LinkedList
import javax.net.ssl.KeyManagerFactory
import javax.net.ssl.TrustManagerFactory
import kotlin.concurrent.thread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory
import java.io.File
import java.io.IOException
import java.security.GeneralSecurityException
import java.util.*
import java.util.LinkedList

/**
* Created by Vishal on 29-05-2017. Class handles database with tables having list of various
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.io.File
import java.io.IOException
import java.util.*

object ExternalSdCardOperation {
private val log: Logger = LoggerFactory.getLogger(UtilsHandler::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ import android.util.Log
import com.amaze.filemanager.fileoperations.exceptions.ShellNotRunningException
import com.amaze.filemanager.filesystem.MakeDirectoryOperation.mkdir
import com.amaze.filemanager.filesystem.root.RenameFileCommand.renameFile
import java.io.*
import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
import java.io.IOException
import java.io.OutputStream
import java.nio.channels.FileChannel

object RenameOperation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ import com.amaze.filemanager.filesystem.compressed.extractcontents.Extractor
import com.amaze.filemanager.filesystem.files.GenericCopyUtil
import org.apache.commons.compress.archivers.ArchiveEntry
import org.apache.commons.compress.archivers.ArchiveInputStream
import java.io.*
import java.util.*
import java.io.BufferedOutputStream
import java.io.File
import java.io.FileInputStream
import java.io.IOException
import java.io.InputStream

abstract class AbstractCommonsArchiveExtractor(
context: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import java.io.BufferedInputStream
import java.io.BufferedOutputStream
import java.io.File
import java.io.IOException
import java.util.*

class ZipExtractor(
context: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ import com.amaze.filemanager.filesystem.files.sort.SortBy
import com.amaze.filemanager.filesystem.files.sort.SortType
import java.lang.Long
import java.util.Locale
import kotlin.Boolean
import kotlin.Comparator
import kotlin.Int
import kotlin.String

/**
* [Comparator] implementation to sort [LayoutElementParcelable]s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ package com.amaze.filemanager.filesystem.ftp
import net.schmizz.sshj.xfer.FilePermission
import org.apache.commons.net.ftp.FTPClient
import org.apache.commons.net.ftp.FTPFile
import org.apache.commons.net.ftp.FTPFile.*
import org.apache.commons.net.ftp.FTPFile.EXECUTE_PERMISSION
import org.apache.commons.net.ftp.FTPFile.GROUP_ACCESS
import org.apache.commons.net.ftp.FTPFile.READ_PERMISSION
import org.apache.commons.net.ftp.FTPFile.USER_ACCESS
import org.apache.commons.net.ftp.FTPFile.WORLD_ACCESS
import org.apache.commons.net.ftp.FTPFile.WRITE_PERMISSION
import org.apache.commons.net.ftp.FTPReply
import java.io.IOException

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import org.json.JSONObject
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.security.KeyPair
import java.util.*
import java.util.concurrent.Callable
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CountDownLatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import org.apache.ftpserver.ftplet.FtpFile
import org.apache.ftpserver.ftplet.User
import java.io.File
import java.net.URI
import java.util.*
import java.util.StringTokenizer

class RootFileSystemView(
private val user: User,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import jcifs.CIFSException
import jcifs.config.PropertyConfiguration
import jcifs.context.BaseContext
import jcifs.context.SingletonContext
import java.util.*
import java.util.Properties
import java.util.concurrent.ConcurrentHashMap

object CifsContexts {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package com.amaze.filemanager.ui.activities.texteditor
import androidx.lifecycle.ViewModel
import com.amaze.filemanager.filesystem.EditableFileAbstraction
import java.io.File
import java.util.*
import java.util.Timer

class TextEditorActivityViewModel : ViewModel() {
var original: String? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import com.amaze.filemanager.ui.fragments.MainFragment
import com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants
import com.amaze.filemanager.utils.DataUtils
import com.amaze.filemanager.utils.safeLet
import kotlin.collections.ArrayList

class RecyclerAdapterDragListener(
private val adapter: RecyclerAdapter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import com.amaze.filemanager.R
import com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_GRID_COLUMNS
import com.amaze.filemanager.ui.fragments.preferencefragments.PreferencesConstants.PREFERENCE_GRID_COLUMNS_DEFAULT
import com.amaze.filemanager.ui.theme.AppThemePreference
import java.util.*
import java.util.Objects

class AppearancePrefsFragment : BasePrefsFragment() {
override val title = R.string.appearance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.io.*
import java.io.BufferedReader
import java.io.File
import java.io.FileWriter
import java.io.IOException
import java.io.InputStreamReader

class BackupPrefsFragment : BasePrefsFragment() {
private val TAG: String = TagsHelper.getTag(BasePrefsFragment::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package com.amaze.filemanager.ui.views.drawer

import android.view.MenuItem
import androidx.lifecycle.ViewModel
import java.util.*

class DrawerViewModel : ViewModel() {
private val menuMetadataMap = HashMap<HasherOfMenuItem, MenuMetadata>()
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/amaze/filemanager/utils/AESCrypt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ package com.amaze.filemanager.utils

import android.util.Log
import com.amaze.filemanager.asynchronous.management.ServiceWatcherUtil
import com.amaze.filemanager.utils.AESCrypt.DecryptFailureException
import com.amaze.filemanager.utils.AESCrypt.IncorrectEncryptedDataException
import java.io.IOException
import java.io.InputStream
import java.io.OutputStream
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/com/amaze/filemanager/utils/BookSorter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

package com.amaze.filemanager.utils

import java.util.*

/** Created by Arpit on 20-11-2015. */
class BookSorter : Comparator<Array<String>> {
override fun compare(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package com.amaze.filemanager.utils

import java.util.*
import java.util.Arrays

class OneCharacterCharSequence(private val value: Char, override val length: Int) : CharSequence {
override fun get(index: Int): Char =
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/amaze/filemanager/utils/UUIDv5.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package com.amaze.filemanager.utils

import java.security.MessageDigest
import java.security.NoSuchAlgorithmException
import java.util.*
import java.util.UUID

/**
* UUIDv5 implementation, referenced from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package com.amaze.filemanager.utils
import net.schmizz.sshj.common.ByteArrayUtils
import org.json.JSONObject
import java.security.MessageDigest
import java.util.*
import java.util.WeakHashMap

object X509CertificateUtil {
const val SUBJECT = "subject"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import java.security.Key
import java.security.KeyPairGenerator
import java.security.KeyStore
import java.security.SecureRandom
import java.util.*
import java.util.Calendar
import javax.crypto.Cipher
import javax.crypto.CipherInputStream
import javax.crypto.CipherOutputStream
Expand Down
Loading

0 comments on commit 29604c2

Please sign in to comment.