package loc;

import loc.filter.Filter;
import loc.filter.FilterFactory;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;

public class ConfigFileReader {
	public static Filter[] readFilters(Path filePath) throws IOException {
		List<Filter> filterList = new ArrayList<>();
		BufferedReader bufferedReader = new BufferedReader(new FileReader(filePath.toFile()));
		String line;
		while ((line = bufferedReader.readLine()) != null) {
			line = line.trim();
			if (line.isEmpty()) continue;
			filterList.add(FilterFactory.create(line));
		}
		return filterList.toArray(new Filter[filterList.size()]);
	}
}

@@ -208,16 +208,42 @@
 ayList;%0A
+import java.util.HashSet;%0A
 import j
@@ -364,19 +364,22 @@
 ion %7B%0A%09%09
-Lis
+HashSe
 t%3CFilter
@@ -390,27 +390,22 @@
 lter
-List
+s
  = new 
-ArrayLis
+HashSe
 t%3C%3E(
@@ -631,20 +631,17 @@
 %09%09filter
-List
+s
 .add(Fil
@@ -685,20 +685,17 @@
 n filter
-List
+s
 .toArray
@@ -712,20 +712,17 @@
 r%5Bfilter
-List
+s
 .size()%5D

Fix bug with duplicated filters in config Change ArrayList container to HashSet container