run Android Studio's Ctrl-Alt-O Organize Imports on all .java files

This commit is contained in:
Hans-Christoph Steiner
2021-04-13 10:23:22 +02:00
parent 9d5af90c61
commit cf94cfb543
202 changed files with 856 additions and 563 deletions

View File

@@ -2,6 +2,7 @@ package org.fdroid.fdroid;
import android.app.Application;
import android.content.ContentValues;
import org.fdroid.fdroid.data.Apk;
import org.fdroid.fdroid.data.ApkProvider;
import org.fdroid.fdroid.data.App;

View File

@@ -5,7 +5,9 @@ import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import junit.framework.AssertionFailedError;
import org.fdroid.fdroid.data.ApkProvider;
import org.fdroid.fdroid.data.App;
import org.fdroid.fdroid.data.AppProvider;

View File

@@ -20,10 +20,8 @@ package org.fdroid.fdroid;
import android.content.Context;
import android.content.SharedPreferences;
import androidx.preference.PreferenceManager;
import androidx.test.core.app.ApplicationProvider;
import android.util.Log;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,6 +30,9 @@ import org.robolectric.shadows.ShadowLog;
import java.util.Map;
import androidx.preference.PreferenceManager;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;

View File

@@ -7,7 +7,7 @@ import android.content.Context;
import android.content.ContextWrapper;
import android.content.pm.ProviderInfo;
import android.net.Uri;
import androidx.test.core.app.ApplicationProvider;
import org.apache.commons.io.IOUtils;
import org.fdroid.fdroid.data.Apk;
import org.fdroid.fdroid.data.ApkProvider;
@@ -30,6 +30,8 @@ import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.security.NoSuchAlgorithmException;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

View File

@@ -4,7 +4,7 @@ package org.fdroid.fdroid;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.Signature;
import androidx.test.core.app.ApplicationProvider;
import org.fdroid.fdroid.views.AppDetailsRecyclerViewAdapter;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -15,6 +15,8 @@ import java.util.Date;
import java.util.Random;
import java.util.TimeZone;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;

View File

@@ -4,6 +4,7 @@ import android.app.Application;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import org.fdroid.fdroid.Assert;
import org.fdroid.fdroid.TestUtils;
import org.fdroid.fdroid.Utils;

View File

@@ -3,7 +3,7 @@ package org.fdroid.fdroid.data;
import android.content.ContextWrapper;
import android.os.Environment;
import android.webkit.MimeTypeMap;
import androidx.test.core.app.ApplicationProvider;
import org.apache.commons.io.FileUtils;
import org.fdroid.fdroid.installer.ApkCache;
import org.junit.Before;
@@ -17,6 +17,8 @@ import org.robolectric.shadows.ShadowMimeTypeMap;
import java.io.File;
import java.io.IOException;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

View File

@@ -1,6 +1,7 @@
package org.fdroid.fdroid.data;
import android.app.Application;
import org.fdroid.fdroid.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -6,6 +6,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.TestUtils;
import org.fdroid.fdroid.data.Schema.AppMetadataTable.Cols;

View File

@@ -5,6 +5,7 @@ import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.data.Schema.AppMetadataTable.Cols;
import org.fdroid.fdroid.mock.MockRepo;

View File

@@ -4,8 +4,6 @@ import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import androidx.test.core.app.ApplicationProvider;
import org.apache.commons.io.IOUtils;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.TestUtils;
@@ -23,6 +21,8 @@ import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

View File

@@ -7,7 +7,7 @@ import android.content.Context;
import android.content.ContextWrapper;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.test.core.app.ApplicationProvider;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.TestUtils;
import org.fdroid.fdroid.Utils;
@@ -19,6 +19,8 @@ import org.robolectric.RobolectricTestRunner;
import org.robolectric.android.controller.ContentProviderController;
import org.robolectric.annotation.Config;
import androidx.test.core.app.ApplicationProvider;
@Config(application = Application.class)
@RunWith(RobolectricTestRunner.class)
public class DatabaseMigration {

View File

@@ -3,12 +3,14 @@ package org.fdroid.fdroid.data;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.ContextWrapper;
import androidx.test.core.app.ApplicationProvider;
import org.fdroid.fdroid.TestUtils;
import org.junit.After;
import org.junit.Before;
import org.robolectric.android.controller.ContentProviderController;
import androidx.test.core.app.ApplicationProvider;
public abstract class FDroidProviderTest { // NOPMD This abstract class does not have any abstract methods
protected ContentResolver contentResolver;

View File

@@ -5,8 +5,6 @@ import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import androidx.test.core.app.ApplicationProvider;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.TestUtils;
import org.fdroid.fdroid.data.Schema.InstalledAppTable.Cols;
@@ -18,6 +16,8 @@ import org.robolectric.annotation.Config;
import java.util.Map;
import androidx.test.core.app.ApplicationProvider;
import static org.fdroid.fdroid.Assert.assertIsInstalledVersionInDb;
import static org.fdroid.fdroid.Assert.assertResultCount;
import static org.junit.Assert.assertEquals;

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.Signature;
import androidx.annotation.Nullable;
public class InstalledAppTestUtils {

View File

@@ -1,8 +1,9 @@
package org.fdroid.fdroid.data;
import android.os.Build;
import androidx.core.os.LocaleListCompat;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.io.FileUtils;
import org.fdroid.fdroid.TestUtils;
import org.junit.Assume;
@@ -19,6 +20,8 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import androidx.core.os.LocaleListCompat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

View File

@@ -2,6 +2,7 @@ package org.fdroid.fdroid.data;
import android.app.Application;
import android.content.Context;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.TestUtils;
import org.junit.Before;

View File

@@ -2,8 +2,6 @@ package org.fdroid.fdroid.data;
import android.content.ContentResolver;
import androidx.test.core.app.ApplicationProvider;
import org.fdroid.fdroid.TestUtils;
import org.fdroid.fdroid.data.Schema.InstalledAppTable;
import org.fdroid.fdroid.mock.MockApk;
@@ -16,6 +14,8 @@ import org.robolectric.RobolectricTestRunner;
import java.util.ArrayList;
import java.util.List;
import androidx.test.core.app.ApplicationProvider;
import static org.fdroid.fdroid.Assert.assertInvalidUri;
import static org.fdroid.fdroid.Assert.assertValidUri;

View File

@@ -25,7 +25,6 @@ import android.app.Application;
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.Nullable;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.Utils;
@@ -40,6 +39,8 @@ import java.util.Date;
import java.util.List;
import java.util.TimeZone;
import androidx.annotation.Nullable;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

View File

@@ -25,8 +25,6 @@ package org.fdroid.fdroid.data;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.NonNull;
import org.apache.commons.io.FileUtils;
import org.fdroid.fdroid.mock.MockRepo;
import org.fdroid.fdroid.mock.RepoDetails;
@@ -52,6 +50,8 @@ import java.util.TimeZone;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import androidx.annotation.NonNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;

View File

@@ -1,6 +1,7 @@
package org.fdroid.fdroid.data;
import android.app.Application;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.TestUtils;
import org.fdroid.fdroid.data.Schema.AppMetadataTable.Cols;

View File

@@ -2,7 +2,7 @@ package org.fdroid.fdroid.installer;
import android.content.ContextWrapper;
import android.util.Log;
import androidx.test.core.app.ApplicationProvider;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -11,6 +11,8 @@ import org.robolectric.shadows.ShadowLog;
import java.io.File;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

View File

@@ -1,7 +1,7 @@
package org.fdroid.fdroid.installer;
import android.content.ContextWrapper;
import androidx.test.core.app.ApplicationProvider;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.data.Apk;
import org.junit.Before;
@@ -10,6 +10,8 @@ import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.shadows.ShadowLog;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

View File

@@ -1,7 +1,7 @@
package org.fdroid.fdroid.installer;
import android.content.ContextWrapper;
import androidx.test.core.app.ApplicationProvider;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.data.Apk;
import org.junit.Before;
@@ -9,6 +9,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
@RunWith(RobolectricTestRunner.class)

View File

@@ -3,8 +3,6 @@ package org.fdroid.fdroid.updater;
import android.content.ContentValues;
import android.util.Log;
import androidx.annotation.NonNull;
import org.fdroid.fdroid.IndexUpdater.UpdateException;
import org.fdroid.fdroid.data.Repo;
import org.fdroid.fdroid.data.RepoProvider;
@@ -15,6 +13,8 @@ import org.robolectric.RobolectricTestRunner;
import java.util.List;
import androidx.annotation.NonNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

View File

@@ -1,8 +1,8 @@
package org.fdroid.fdroid.updater;
import androidx.annotation.NonNull;
import android.text.TextUtils;
import android.util.Log;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -11,6 +11,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import org.apache.commons.io.IOUtils;
import org.fdroid.fdroid.IndexUpdater;
import org.fdroid.fdroid.IndexV1Updater;
@@ -48,6 +49,8 @@ import java.util.TreeSet;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import androidx.annotation.NonNull;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertArrayEquals;

View File

@@ -2,7 +2,6 @@ package org.fdroid.fdroid.updater;
import android.content.ContentValues;
import android.content.Context;
import androidx.annotation.NonNull;
import android.text.TextUtils;
import org.fdroid.fdroid.IndexUpdater;
@@ -27,6 +26,8 @@ import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import androidx.annotation.NonNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

View File

@@ -1,8 +1,8 @@
package org.fdroid.fdroid.updater;
import android.content.ContentValues;
import androidx.annotation.StringDef;
import android.util.Log;
import org.fdroid.fdroid.IndexUpdater;
import org.fdroid.fdroid.TestUtils;
import org.fdroid.fdroid.data.Apk;
@@ -29,6 +29,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import androidx.annotation.StringDef;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

View File

@@ -6,10 +6,6 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.recyclerview.widget.RecyclerView;
import androidx.test.core.app.ApplicationProvider;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
@@ -30,6 +26,10 @@ import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.recyclerview.widget.RecyclerView;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
@Config(application = Application.class)

View File

@@ -1,7 +1,7 @@
package org.fdroid.fdroid.work;
import android.content.Context;
import androidx.test.core.app.ApplicationProvider;
import org.fdroid.fdroid.BuildConfig;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.nearby.LocalRepoManager;
@@ -16,6 +16,8 @@ import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

View File

@@ -3,7 +3,7 @@ package org.fdroid.fdroid.work;
import android.app.Application;
import android.content.ContextWrapper;
import android.text.format.DateUtils;
import androidx.test.core.app.ApplicationProvider;
import org.apache.commons.io.FileUtils;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.TestUtils;
@@ -20,6 +20,8 @@ import java.io.IOException;
import java.text.ParseException;
import java.util.Collection;
import androidx.test.core.app.ApplicationProvider;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;