fix lint "DefaultLocale: Implied default locale in case conversion"

This commit is contained in:
Hans-Christoph Steiner 2017-10-04 23:17:06 +02:00
parent 58a10a9ab6
commit 24512f6465

View File

@ -13,6 +13,7 @@ import org.fdroid.fdroid.data.Schema.CategoryTable.Cols;
import org.fdroid.fdroid.data.Schema.PackageTable; import org.fdroid.fdroid.data.Schema.PackageTable;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
public class CategoryProvider extends FDroidProvider { public class CategoryProvider extends FDroidProvider {
@ -40,7 +41,7 @@ public class CategoryProvider extends FDroidProvider {
public static long ensureExists(Context context, String category) { public static long ensureExists(Context context, String category) {
// Check our in-memory cache to potentially prevent a trip to the database (and hence disk). // Check our in-memory cache to potentially prevent a trip to the database (and hence disk).
String lowerCaseCategory = category.toLowerCase(); String lowerCaseCategory = category.toLowerCase(Locale.ENGLISH);
if (KNOWN_CATEGORIES.containsKey(lowerCaseCategory)) { if (KNOWN_CATEGORIES.containsKey(lowerCaseCategory)) {
return KNOWN_CATEGORIES.get(lowerCaseCategory); return KNOWN_CATEGORIES.get(lowerCaseCategory);
} }