diff --git a/F-Droid/src/javax/jmdns/impl/FDroidServiceInfo.java b/F-Droid/src/javax/jmdns/impl/FDroidServiceInfo.java index 4a5a9985f..2851cb2d1 100644 --- a/F-Droid/src/javax/jmdns/impl/FDroidServiceInfo.java +++ b/F-Droid/src/javax/jmdns/impl/FDroidServiceInfo.java @@ -62,7 +62,7 @@ public class FDroidServiceInfo extends ServiceInfoImpl implements Parcelable { ); int addressCount = in.readInt(); - for (int i = 0; i < addressCount; i ++) { + for (int i = 0; i < addressCount; i++) { try { addAddress((Inet4Address) Inet4Address.getByAddress(readBytes(in))); } catch (UnknownHostException e) { @@ -71,7 +71,7 @@ public class FDroidServiceInfo extends ServiceInfoImpl implements Parcelable { } addressCount = in.readInt(); - for (int i = 0; i < addressCount; i ++) { + for (int i = 0; i < addressCount; i++) { try { addAddress((Inet6Address) Inet6Address.getByAddress(readBytes(in))); } catch (UnknownHostException e) { @@ -97,13 +97,13 @@ public class FDroidServiceInfo extends ServiceInfoImpl implements Parcelable { dest.writeInt(getTextBytes().length); dest.writeByteArray(getTextBytes()); dest.writeInt(getInet4Addresses().length); - for (int i = 0; i < getInet4Addresses().length; i ++) { + for (int i = 0; i < getInet4Addresses().length; i++) { Inet4Address address = getInet4Addresses()[i]; dest.writeInt(address.getAddress().length); dest.writeByteArray(address.getAddress()); } dest.writeInt(getInet6Addresses().length); - for (int i = 0; i < getInet6Addresses().length; i ++) { + for (int i = 0; i < getInet6Addresses().length; i++) { Inet6Address address = getInet6Addresses()[i]; dest.writeInt(address.getAddress().length); dest.writeByteArray(address.getAddress()); diff --git a/F-Droid/src/org/fdroid/fdroid/AppDetails.java b/F-Droid/src/org/fdroid/fdroid/AppDetails.java index 8775f3bc8..6d6f1df1c 100644 --- a/F-Droid/src/org/fdroid/fdroid/AppDetails.java +++ b/F-Droid/src/org/fdroid/fdroid/AppDetails.java @@ -877,7 +877,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A @Nullable private String getRepoAddress(Apk apk) { - final String[] projection = { RepoProvider.DataColumns.ADDRESS }; + final String[] projection = {RepoProvider.DataColumns.ADDRESS}; Repo repo = RepoProvider.Helper.findById(this, apk.repo, projection); if (repo == null || repo.address == null) { return null; diff --git a/F-Droid/src/org/fdroid/fdroid/UpdateService.java b/F-Droid/src/org/fdroid/fdroid/UpdateService.java index 174c88088..35a9014a6 100644 --- a/F-Droid/src/org/fdroid/fdroid/UpdateService.java +++ b/F-Droid/src/org/fdroid/fdroid/UpdateService.java @@ -582,7 +582,7 @@ public class UpdateService extends IntentService implements ProgressListener { private List getKnownAppIdsFromProvider(List apps) { final Uri uri = AppProvider.getContentUri(apps); - final String[] fields = { AppProvider.DataColumns.APP_ID }; + final String[] fields = {AppProvider.DataColumns.APP_ID}; Cursor cursor = getContentResolver().query(uri, fields, null, null, null); int knownIdCount = cursor != null ? cursor.getCount() : 0; diff --git a/F-Droid/src/org/fdroid/fdroid/data/ApkProvider.java b/F-Droid/src/org/fdroid/fdroid/data/ApkProvider.java index f63a4d2f1..33ed81c8c 100644 --- a/F-Droid/src/org/fdroid/fdroid/data/ApkProvider.java +++ b/F-Droid/src/org/fdroid/fdroid/data/ApkProvider.java @@ -339,7 +339,7 @@ public class ApkProvider extends FDroidProvider { private QuerySelection queryApp(String appId) { final String selection = DataColumns.APK_ID + " = ? "; - final String[] args = { appId }; + final String[] args = {appId}; return new QuerySelection(selection, args); } @@ -356,7 +356,7 @@ public class ApkProvider extends FDroidProvider { private QuerySelection queryRepo(long repoId) { final String selection = DataColumns.REPO_ID + " = ? "; - final String[] args = { Long.toString(repoId) }; + final String[] args = {Long.toString(repoId)}; return new QuerySelection(selection, args); } diff --git a/F-Droid/src/org/fdroid/fdroid/data/AppProvider.java b/F-Droid/src/org/fdroid/fdroid/data/AppProvider.java index d170214b1..02f2b3544 100644 --- a/F-Droid/src/org/fdroid/fdroid/data/AppProvider.java +++ b/F-Droid/src/org/fdroid/fdroid/data/AppProvider.java @@ -31,7 +31,7 @@ public class AppProvider extends FDroidProvider { private Helper() {} public static int count(Context context, Uri uri) { - final String[] projection = { AppProvider.DataColumns._COUNT }; + final String[] projection = {AppProvider.DataColumns._COUNT}; Cursor cursor = context.getContentResolver().query(uri, projection, null, null, null); int count = 0; if (cursor != null) { @@ -91,7 +91,7 @@ public class AppProvider extends FDroidProvider { public static List categories(Context context) { final ContentResolver resolver = context.getContentResolver(); final Uri uri = getContentUri(); - final String[] projection = { DataColumns.CATEGORIES }; + final String[] projection = {DataColumns.CATEGORIES}; final Cursor cursor = resolver.query(uri, projection, null, null, null); final Set categorySet = new HashSet<>(); if (cursor != null) { @@ -561,7 +561,7 @@ public class AppProvider extends FDroidProvider { private AppQuerySelection queryRepo(long repoId) { final String selection = " fdroid_apk.repo = ? "; - final String[] args = { String.valueOf(repoId) }; + final String[] args = {String.valueOf(repoId)}; return new AppQuerySelection(selection, args); } @@ -616,7 +616,7 @@ public class AppProvider extends FDroidProvider { private AppQuerySelection querySingle(String id) { final String selection = "fdroid_app.id = ?"; - final String[] args = { id }; + final String[] args = {id}; return new AppQuerySelection(selection, args); } @@ -636,13 +636,13 @@ public class AppProvider extends FDroidProvider { private AppQuerySelection queryNewlyAdded() { final String selection = "fdroid_app.added > ?"; - final String[] args = { Utils.formatDate(Preferences.get().calcMaxHistory(), "") }; + final String[] args = {Utils.formatDate(Preferences.get().calcMaxHistory(), "")}; return new AppQuerySelection(selection, args); } private AppQuerySelection queryRecentlyUpdated() { final String selection = "fdroid_app.added != fdroid_app.lastUpdated AND fdroid_app.lastUpdated > ?"; - final String[] args = { Utils.formatDate(Preferences.get().calcMaxHistory(), "") }; + final String[] args = {Utils.formatDate(Preferences.get().calcMaxHistory(), "")}; return new AppQuerySelection(selection, args); } diff --git a/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java b/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java index 473f70f09..2cccc074a 100644 --- a/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java +++ b/F-Droid/src/org/fdroid/fdroid/data/DBHelper.java @@ -112,7 +112,7 @@ public class DBHelper extends SQLiteOpenHelper { private void populateRepoNames(SQLiteDatabase db, int oldVersion) { if (oldVersion < 37) { Utils.debugLog(TAG, "Populating repo names from the url"); - final String[] columns = { "address", "_id" }; + final String[] columns = {"address", "_id"}; Cursor cursor = db.query(TABLE_REPO, columns, "name IS NULL OR name = ''", null, null, null, null); if (cursor != null) { @@ -124,7 +124,7 @@ public class DBHelper extends SQLiteOpenHelper { ContentValues values = new ContentValues(1); String name = Repo.addressToName(address); values.put("name", name); - final String[] args = { Long.toString(id) }; + final String[] args = {Long.toString(id)}; Utils.debugLog(TAG, "Setting repo name to '" + name + "' for repo " + address); db.update(TABLE_REPO, values, "_id = ?", args); cursor.moveToNext(); @@ -293,7 +293,7 @@ public class DBHelper extends SQLiteOpenHelper { if (oldVersion < 20) { List oldrepos = new ArrayList<>(); Cursor cursor = db.query(TABLE_REPO, - new String[] { "address", "inuse", "pubkey" }, + new String[] {"address", "inuse", "pubkey"}, null, null, null, null, null); if (cursor != null) { if (cursor.getCount() > 0) { @@ -368,7 +368,7 @@ public class DBHelper extends SQLiteOpenHelper { db.execSQL("alter table " + TABLE_REPO + " add column fingerprint text"); List oldrepos = new ArrayList<>(); Cursor cursor = db.query(TABLE_REPO, - new String[] { "address", "pubkey" }, + new String[] {"address", "pubkey"}, null, null, null, null, null); if (cursor != null) { if (cursor.getCount() > 0) { @@ -386,7 +386,7 @@ public class DBHelper extends SQLiteOpenHelper { for (final Repo repo : oldrepos) { ContentValues values = new ContentValues(); values.put("fingerprint", Utils.calcFingerprint(repo.pubkey)); - db.update(TABLE_REPO, values, "address = ?", new String[] { repo.address }); + db.update(TABLE_REPO, values, "address = ?", new String[] {repo.address}); } } } diff --git a/F-Droid/src/org/fdroid/fdroid/data/InstalledAppProvider.java b/F-Droid/src/org/fdroid/fdroid/data/InstalledAppProvider.java index 82197200a..47b19eb41 100644 --- a/F-Droid/src/org/fdroid/fdroid/data/InstalledAppProvider.java +++ b/F-Droid/src/org/fdroid/fdroid/data/InstalledAppProvider.java @@ -126,12 +126,12 @@ public class InstalledAppProvider extends FDroidProvider { } private QuerySelection queryApp(String appId) { - return new QuerySelection("appId = ?", new String[]{ appId }); + return new QuerySelection("appId = ?", new String[]{appId}); } private QuerySelection querySearch(String query) { return new QuerySelection("applicationLabel LIKE ?", - new String[]{ "%" + query + "%" }); + new String[]{"%" + query + "%"}); } @Override diff --git a/F-Droid/src/org/fdroid/fdroid/data/RepoProvider.java b/F-Droid/src/org/fdroid/fdroid/data/RepoProvider.java index 5e280e374..46f411a6c 100644 --- a/F-Droid/src/org/fdroid/fdroid/data/RepoProvider.java +++ b/F-Droid/src/org/fdroid/fdroid/data/RepoProvider.java @@ -73,7 +73,7 @@ public class RepoProvider extends FDroidProvider { String[] projection) { ContentResolver resolver = context.getContentResolver(); Uri uri = RepoProvider.getContentUri(); - final String[] args = { fieldValue }; + final String[] args = {fieldValue}; Cursor cursor = resolver.query( uri, projection, fieldName + " = ?", args, null); return cursorToList(cursor); @@ -159,7 +159,7 @@ public class RepoProvider extends FDroidProvider { } final Uri uri = getContentUri(repo.getId()); - final String[] args = { Long.toString(repo.getId()) }; + final String[] args = {Long.toString(repo.getId())}; resolver.update(uri, values, DataColumns._ID + " = ?", args); repo.setValues(values); } @@ -195,7 +195,7 @@ public class RepoProvider extends FDroidProvider { public static int countAppsForRepo(Context context, long repoId) { ContentResolver resolver = context.getContentResolver(); - final String[] projection = { ApkProvider.DataColumns._COUNT_DISTINCT_ID }; + final String[] projection = {ApkProvider.DataColumns._COUNT_DISTINCT_ID}; Uri apkUri = ApkProvider.getRepoUri(repoId); Cursor cursor = resolver.query(apkUri, projection, null, null, null); int count = 0; diff --git a/F-Droid/src/org/fdroid/fdroid/net/HttpDownloader.java b/F-Droid/src/org/fdroid/fdroid/net/HttpDownloader.java index 6e62ee4f9..a49c765ec 100644 --- a/F-Droid/src/org/fdroid/fdroid/net/HttpDownloader.java +++ b/F-Droid/src/org/fdroid/fdroid/net/HttpDownloader.java @@ -101,7 +101,7 @@ public class HttpDownloader extends Downloader { if (connection != null) return; Preferences prefs = Preferences.get(); - if (prefs.isProxyEnabled() && ! isSwapUrl()) { + if (prefs.isProxyEnabled() && !isSwapUrl()) { SocketAddress sa = new InetSocketAddress(prefs.getProxyHost(), prefs.getProxyPort()); Proxy proxy = new Proxy(Proxy.Type.HTTP, sa); NetCipher.setProxy(proxy); diff --git a/F-Droid/src/org/fdroid/fdroid/privileged/views/AppDiff.java b/F-Droid/src/org/fdroid/fdroid/privileged/views/AppDiff.java index 95b94cc28..61d68ee9d 100644 --- a/F-Droid/src/org/fdroid/fdroid/privileged/views/AppDiff.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/views/AppDiff.java @@ -55,7 +55,7 @@ public class AppDiff { String pkgName = mPkgInfo.packageName; // Check if there is already a package on the device with this name // but it has been renamed to something else. - final String[] oldName = mPm.canonicalToCurrentPackageNames(new String[] { pkgName }); + final String[] oldName = mPm.canonicalToCurrentPackageNames(new String[] {pkgName}); if (oldName != null && oldName.length > 0 && oldName[0] != null) { pkgName = oldName[0]; mPkgInfo.packageName = pkgName; diff --git a/F-Droid/src/org/fdroid/fdroid/views/swap/SwapWorkflowActivity.java b/F-Droid/src/org/fdroid/fdroid/views/swap/SwapWorkflowActivity.java index afaa22d8f..596b87d31 100644 --- a/F-Droid/src/org/fdroid/fdroid/views/swap/SwapWorkflowActivity.java +++ b/F-Droid/src/org/fdroid/fdroid/views/swap/SwapWorkflowActivity.java @@ -639,7 +639,7 @@ public class SwapWorkflowActivity extends AppCompatActivity { class PrepareInitialSwapRepo extends PrepareSwapRepo { public PrepareInitialSwapRepo() { - super(new HashSet<>(Arrays.asList(new String[] { "org.fdroid.fdroid" }))); + super(new HashSet<>(Arrays.asList(new String[] {"org.fdroid.fdroid"}))); } } diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index a6873cdb0..8b30ff759 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -37,8 +37,8 @@ - - + +