From 94dae8259f075e4099cd92c258386dc39bfc30c1 Mon Sep 17 00:00:00 2001 From: Bambooin Date: Sun, 18 Feb 2024 21:51:34 +0800 Subject: [PATCH] chore: apply spotless on java files --- .../write/WriteTextFileCallable.java | 4 +- .../filesystem/files/EncryptDecryptUtils.java | 1 + .../ui/activities/MainActivity.java | 1 + .../ui/fragments/ProcessViewerFragment.java | 1 + .../filemanager/utils/ProgressHandler.java | 2 + .../filesystem/usb/ReflectionHelpers.java | 63 +++++++++++++------ .../compressed/sevenz/CoderBase.java | 1 + .../shadows/jcifs/smb/ShadowSmbFile.java | 1 - 8 files changed, 54 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/amaze/filemanager/asynchronous/asynctasks/texteditor/write/WriteTextFileCallable.java b/app/src/main/java/com/amaze/filemanager/asynchronous/asynctasks/texteditor/write/WriteTextFileCallable.java index e4be052993..fbee9e4336 100644 --- a/app/src/main/java/com/amaze/filemanager/asynchronous/asynctasks/texteditor/write/WriteTextFileCallable.java +++ b/app/src/main/java/com/amaze/filemanager/asynchronous/asynctasks/texteditor/write/WriteTextFileCallable.java @@ -72,7 +72,9 @@ public WriteTextFileCallable( @WorkerThread @Override public Unit call() - throws IOException, StreamNotFoundException, ShellNotRunningException, + throws IOException, + StreamNotFoundException, + ShellNotRunningException, IllegalArgumentException { OutputStream outputStream; File destFile = null; diff --git a/app/src/main/java/com/amaze/filemanager/filesystem/files/EncryptDecryptUtils.java b/app/src/main/java/com/amaze/filemanager/filesystem/files/EncryptDecryptUtils.java index 8744369041..9338fbc264 100644 --- a/app/src/main/java/com/amaze/filemanager/filesystem/files/EncryptDecryptUtils.java +++ b/app/src/main/java/com/amaze/filemanager/filesystem/files/EncryptDecryptUtils.java @@ -65,6 +65,7 @@ public class EncryptDecryptUtils { public static final String DECRYPT_BROADCAST = "decrypt_broadcast"; private static final Logger LOG = LoggerFactory.getLogger(EncryptDecryptUtils.class); + /** * Queries database to map path and password. Starts the encryption process after database query * diff --git a/app/src/main/java/com/amaze/filemanager/ui/activities/MainActivity.java b/app/src/main/java/com/amaze/filemanager/ui/activities/MainActivity.java index ff894315c9..ec91fafd95 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/activities/MainActivity.java +++ b/app/src/main/java/com/amaze/filemanager/ui/activities/MainActivity.java @@ -277,6 +277,7 @@ public class MainActivity extends PermissionsActivity private UtilsHandler utilsHandler; private CloudHandler cloudHandler; private CloudLoaderAsyncTask cloudLoaderAsyncTask; + /** * This is for a hack. * diff --git a/app/src/main/java/com/amaze/filemanager/ui/fragments/ProcessViewerFragment.java b/app/src/main/java/com/amaze/filemanager/ui/fragments/ProcessViewerFragment.java index c9f4a181c2..3827580130 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/fragments/ProcessViewerFragment.java +++ b/app/src/main/java/com/amaze/filemanager/ui/fragments/ProcessViewerFragment.java @@ -85,6 +85,7 @@ public class ProcessViewerFragment extends Fragment { private int accentColor; private final LineData lineData = new LineData(); private ProcessparentBinding binding = null; + /** Time in seconds just for showing to the user. No guarantees. */ private long looseTimeInSeconds = 0L; diff --git a/app/src/main/java/com/amaze/filemanager/utils/ProgressHandler.java b/app/src/main/java/com/amaze/filemanager/utils/ProgressHandler.java index 58267ba44c..407739fdb4 100644 --- a/app/src/main/java/com/amaze/filemanager/utils/ProgressHandler.java +++ b/app/src/main/java/com/amaze/filemanager/utils/ProgressHandler.java @@ -41,11 +41,13 @@ public class ProgressHandler { * (see Java Language Specification 17.7) */ private volatile long writtenSize = 0L; + /** total number of source files to be processed */ private volatile int sourceFiles = 0; /** number of source files processed so far */ private volatile int sourceFilesProcessed = 0; + /** file name currently being processed */ private volatile String fileName; diff --git a/app/src/test/java/com/amaze/filemanager/filesystem/usb/ReflectionHelpers.java b/app/src/test/java/com/amaze/filemanager/filesystem/usb/ReflectionHelpers.java index faa833c091..5b92dd8333 100644 --- a/app/src/test/java/com/amaze/filemanager/filesystem/usb/ReflectionHelpers.java +++ b/app/src/test/java/com/amaze/filemanager/filesystem/usb/ReflectionHelpers.java @@ -79,8 +79,11 @@ static void addUsbOtgDevice(Activity activity) { @RequiresApi(Build.VERSION_CODES.LOLLIPOP) static void configureUsbDevice(UsbDevice device) - throws NoSuchMethodException, ClassNotFoundException, InvocationTargetException, - InstantiationException, IllegalAccessException { + throws NoSuchMethodException, + ClassNotFoundException, + InvocationTargetException, + InstantiationException, + IllegalAccessException { UsbConfiguration usbConfiguration = callUsbConfigurationConstructor(0, "", 0, 0); configureUsbConfiguration(usbConfiguration); @@ -91,8 +94,11 @@ static void configureUsbDevice(UsbDevice device) @RequiresApi(Build.VERSION_CODES.LOLLIPOP) static void configureUsbConfiguration(UsbConfiguration usbConfiguration) - throws NoSuchMethodException, ClassNotFoundException, InvocationTargetException, - InstantiationException, IllegalAccessException { + throws NoSuchMethodException, + ClassNotFoundException, + InvocationTargetException, + InstantiationException, + IllegalAccessException { UsbInterface usbInterface = callUsbInterfaceConstructor(01, 0, "", USB_CLASS_MASS_STORAGE, 0, 0); @@ -103,8 +109,11 @@ static void configureUsbConfiguration(UsbConfiguration usbConfiguration) @RequiresApi(Build.VERSION_CODES.KITKAT) static Parcelable[] configureUsbDevice() - throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, - InstantiationException, IllegalAccessException { + throws ClassNotFoundException, + NoSuchMethodException, + InvocationTargetException, + InstantiationException, + IllegalAccessException { UsbInterface usbInterface = (UsbInterface) callUsbInterfaceConstructor(01, USB_CLASS_MASS_STORAGE, 0, 0, null); @@ -123,8 +132,11 @@ static UsbDevice callUsbDeviceConstructor( @Nullable String productName, @NonNull String version, @Nullable String serialNumber) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, - InvocationTargetException, InstantiationException { + throws ClassNotFoundException, + NoSuchMethodException, + IllegalAccessException, + InvocationTargetException, + InstantiationException { Class clazz = (Class) Class.forName("android.hardware.usb.UsbDevice"); Constructor constructor = @@ -164,8 +176,11 @@ static UsbDevice callUsbDeviceConstructor( @Nullable String manufacturerName, @Nullable String productName, @Nullable String serialNumber) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, - InvocationTargetException, InstantiationException { + throws ClassNotFoundException, + NoSuchMethodException, + IllegalAccessException, + InvocationTargetException, + InstantiationException { Class clazz = (Class) Class.forName("android.hardware.usb.UsbDevice"); Constructor constructor = @@ -201,8 +216,11 @@ static UsbDevice callUsbDeviceConstructor( int subClass, int protocol, @NonNull Parcelable[] interfaces) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, - InvocationTargetException, InstantiationException { + throws ClassNotFoundException, + NoSuchMethodException, + IllegalAccessException, + InvocationTargetException, + InstantiationException { Class clazz = (Class) Class.forName("android.hardware.usb.UsbDevice"); Constructor constructor = @@ -222,8 +240,11 @@ static UsbDevice callUsbDeviceConstructor( @RequiresApi(Build.VERSION_CODES.LOLLIPOP) static UsbConfiguration callUsbConfigurationConstructor( int id, @Nullable String name, int attributes, int maxPower) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, - InvocationTargetException, InstantiationException { + throws ClassNotFoundException, + NoSuchMethodException, + IllegalAccessException, + InvocationTargetException, + InstantiationException { Class clazz = (Class) Class.forName("android.hardware.usb.UsbConfiguration"); @@ -236,8 +257,11 @@ static UsbConfiguration callUsbConfigurationConstructor( @RequiresApi(Build.VERSION_CODES.LOLLIPOP) static UsbInterface callUsbInterfaceConstructor( int id, int alternateSetting, @Nullable String name, int usbClass, int subClass, int protocol) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, - InvocationTargetException, InstantiationException { + throws ClassNotFoundException, + NoSuchMethodException, + IllegalAccessException, + InvocationTargetException, + InstantiationException { Class clazz = (Class) Class.forName("android.hardware.usb.UsbInterface"); @@ -250,8 +274,11 @@ static UsbInterface callUsbInterfaceConstructor( @RequiresApi(Build.VERSION_CODES.KITKAT) static UsbInterface callUsbInterfaceConstructor( int id, int usbClass, int subClass, int protocol, @Nullable Parcelable[] endpoints) - throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, - InvocationTargetException, InstantiationException { + throws ClassNotFoundException, + NoSuchMethodException, + IllegalAccessException, + InvocationTargetException, + InstantiationException { Class clazz = (Class) Class.forName("android.hardware.usb.UsbInterface"); diff --git a/commons_compress_7z/src/main/java/com/amaze/filemanager/filesystem/compressed/sevenz/CoderBase.java b/commons_compress_7z/src/main/java/com/amaze/filemanager/filesystem/compressed/sevenz/CoderBase.java index f43b19565f..51449f310d 100644 --- a/commons_compress_7z/src/main/java/com/amaze/filemanager/filesystem/compressed/sevenz/CoderBase.java +++ b/commons_compress_7z/src/main/java/com/amaze/filemanager/filesystem/compressed/sevenz/CoderBase.java @@ -29,6 +29,7 @@ /** Base Codec class. */ abstract class CoderBase { private final Class[] acceptableOptions; + /** * @param acceptableOptions types that can be used as options for this codec. */ diff --git a/testShared/src/test/java/com/amaze/filemanager/shadows/jcifs/smb/ShadowSmbFile.java b/testShared/src/test/java/com/amaze/filemanager/shadows/jcifs/smb/ShadowSmbFile.java index 9a2f6a7c7c..308bdc311a 100644 --- a/testShared/src/test/java/com/amaze/filemanager/shadows/jcifs/smb/ShadowSmbFile.java +++ b/testShared/src/test/java/com/amaze/filemanager/shadows/jcifs/smb/ShadowSmbFile.java @@ -21,7 +21,6 @@ package com.amaze.filemanager.shadows.jcifs.smb; import java.io.File; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL;