summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2021-04-22 23:30:46 +0200
committerByteHamster <info@bytehamster.com>2021-04-22 23:30:46 +0200
commit9782bc7d4bc454b3587b602974432cf08d0386ca (patch)
treed974dc2b0d5c7e102ea14c6b6cd2b519b72b76e9 /model
parentba66ae76337133d92963fbf9c8ead27ee81ef148 (diff)
downloadantennapod-9782bc7d4bc454b3587b602974432cf08d0386ca.zip
Lint fixes
Diffstat (limited to 'model')
-rw-r--r--model/src/main/java/de/danoeh/antennapod/model/feed/FeedFilter.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedFilter.java b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedFilter.java
index 4d1d76f1f..31d263b24 100644
--- a/model/src/main/java/de/danoeh/antennapod/model/feed/FeedFilter.java
+++ b/model/src/main/java/de/danoeh/antennapod/model/feed/FeedFilter.java
@@ -3,13 +3,11 @@ package de.danoeh.antennapod.model.feed;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class FeedFilter implements Serializable {
-
- private static final String TAG = "FeedFilter";
-
private final String includeFilter;
private final String excludeFilter;
@@ -36,8 +34,9 @@ public class FeedFilter implements Serializable {
// from http://stackoverflow.com/questions/7804335/split-string-on-spaces-in-java-except-if-between-quotes-i-e-treat-hello-wor
List<String> list = new ArrayList<>();
Matcher m = Pattern.compile("([^\"]\\S*|\".+?\")\\s*").matcher(filter);
- while (m.find())
+ while (m.find()) {
list.add(m.group(1).replace("\"", ""));
+ }
return list;
}
@@ -56,18 +55,18 @@ public class FeedFilter implements Serializable {
}
// check using lowercase so the users don't have to worry about case.
- String title = item.getTitle().toLowerCase();
+ String title = item.getTitle().toLowerCase(Locale.getDefault());
// if it's explicitly excluded, it shouldn't be autodownloaded
// even if it has include terms
for (String term : excludeTerms) {
- if (title.contains(term.trim().toLowerCase())) {
+ if (title.contains(term.trim().toLowerCase(Locale.getDefault()))) {
return false;
}
}
for (String term : includeTerms) {
- if (title.contains(term.trim().toLowerCase())) {
+ if (title.contains(term.trim().toLowerCase(Locale.getDefault()))) {
return true;
}
}
@@ -86,7 +85,9 @@ public class FeedFilter implements Serializable {
return includeFilter;
}
- public String getExcludeFilter() { return excludeFilter; }
+ public String getExcludeFilter() {
+ return excludeFilter;
+ }
/**
* @return true if only include is set