normalize whitespace in AppProvider using Android Studio Ctrl-Alt-L

This commit is contained in:
Hans-Christoph Steiner 2021-02-07 00:40:51 +01:00
parent 5c7be1e852
commit bdbb95110b

View File

@ -945,7 +945,7 @@ public class AppProvider extends FDroidProvider {
final String app = getTableName(); final String app = getTableName();
String query = "DELETE FROM " + catJoin + " WHERE " + CatJoinTable.Cols.APP_METADATA_ID + " IN " + String query = "DELETE FROM " + catJoin + " WHERE " + CatJoinTable.Cols.APP_METADATA_ID + " IN " +
"(SELECT " + Cols.ROW_ID + " FROM " + app + " WHERE " + app + "." + Cols.REPO_ID + " = ?)"; "(SELECT " + Cols.ROW_ID + " FROM " + app + " WHERE " + app + "." + Cols.REPO_ID + " = ?)";
db().execSQL(query, new String[] {String.valueOf(repoId)}); db().execSQL(query, new String[]{String.valueOf(repoId)});
AppQuerySelection selection = new AppQuerySelection(where, whereArgs).add(queryRepo(repoId)); AppQuerySelection selection = new AppQuerySelection(where, whereArgs).add(queryRepo(repoId));
int result = db().delete(getTableName(), selection.getSelection(), selection.getArgs()); int result = db().delete(getTableName(), selection.getSelection(), selection.getArgs());
@ -995,7 +995,7 @@ public class AppProvider extends FDroidProvider {
} }
protected void ensureCategories(String[] categories, long appMetadataId) { protected void ensureCategories(String[] categories, long appMetadataId) {
db().delete(getCatJoinTableName(), CatJoinTable.Cols.APP_METADATA_ID + " = ?", new String[] {Long.toString(appMetadataId)}); db().delete(getCatJoinTableName(), CatJoinTable.Cols.APP_METADATA_ID + " = ?", new String[]{Long.toString(appMetadataId)});
if (categories != null) { if (categories != null) {
Set<String> categoriesSet = new HashSet<>(); Set<String> categoriesSet = new HashSet<>();
for (String categoryName : categories) { for (String categoryName : categories) {
@ -1043,16 +1043,16 @@ public class AppProvider extends FDroidProvider {
/** /**
* If the repo hasn't changed, then there are many things which we shouldn't waste time updating * If the repo hasn't changed, then there are many things which we shouldn't waste time updating
* (compared to {@link AppProvider#updateAllAppDetails()}: * (compared to {@link AppProvider#updateAllAppDetails()}:
* <ul>
* <li>The "preferred metadata", as that is calculated based on repo with highest priority, and
* only takes into account the package name, not specific versions, when figuring this out.</li>
* *
* + The "preferred metadata", as that is calculated based on repo with highest priority, and * <li>Compatible flags. These were calculated earlier, whether or not an app was suggested or not.</li>
* only takes into account the package name, not specific versions, when figuring this out.
* *
* + Compatible flags. These were calculated earlier, whether or not an app was suggested or not. * <li>Icon URLs. While technically these do change when the suggested version changes, it is not
*
* + Icon URLs. While technically these do change when the suggested version changes, it is not
* important enough to spend a significant amount of time to calculate. In the future maybe, * important enough to spend a significant amount of time to calculate. In the future maybe,
* but that effort should instead go into implementing an intent service. * but that effort should instead go into implementing an intent service.</li>
* * </ul>
* In the future, this problem of taking a long time should be fixed by implementing an * In the future, this problem of taking a long time should be fixed by implementing an
* {@link android.app.IntentService} as described in https://gitlab.com/fdroid/fdroidclient/issues/520. * {@link android.app.IntentService} as described in https://gitlab.com/fdroid/fdroidclient/issues/520.
*/ */
@ -1170,7 +1170,7 @@ public class AppProvider extends FDroidProvider {
/** /**
* We set each app's suggested version to the latest available that is * We set each app's suggested version to the latest available that is
* compatible, or the latest available if none are compatible. * compatible, or the latest available if none are compatible.
* * <p>
* If the suggested version is null, it means that we could not figure it * If the suggested version is null, it means that we could not figure it
* out from the upstream vercode. In such a case, fall back to the simpler * out from the upstream vercode. In such a case, fall back to the simpler
* algorithm as if upstreamVercode was 0. * algorithm as if upstreamVercode was 0.