Add comments

This commit is contained in:
misaochan 2016-10-25 17:43:34 +13:00
parent b15faa9a35
commit e2c8f30a95

View file

@ -223,10 +223,12 @@ public class CategorizationFragment extends Fragment {
//Needs to be an ArrayList and not a List unless we want to modify a big portion of preexisting code //Needs to be an ArrayList and not a List unless we want to modify a big portion of preexisting code
ArrayList<String> mergedItemsList = new ArrayList<String>(mergedItems); ArrayList<String> mergedItemsList = new ArrayList<String>(mergedItems);
//Copy to Iterator to prevent ConcurrentModificationException
for(Iterator<String> item = mergedItemsList.iterator(); item.hasNext();) { for(Iterator<String> item = mergedItemsList.iterator(); item.hasNext();) {
String s = item.next(); String s = item.next();
//Check if s contains a 4-digit word anywhere within the string (.* is wildcard)
if(s.matches(".*\\d{4}.*")) { if(s.matches(".*\\d{4}.*")) {
Log.d(TAG, "Filtering out year " + s); Log.d(TAG, "Filtering out year " + s);
item.remove(); item.remove();