我明明已经清除了 allLines 列表 为什么还是不通过
package zh.codegym.task.task17.task1721;
import java.io.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/*
事务性
*/
public class Solution {
public static BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
public static List<String> allLines = new ArrayList<>();
public static List<String> linesForRemoval = new ArrayList<>();
public static String firstFilename;
public static String secondFilename;
public static void main(String[] args) {
try {
firstFilename=reader.readLine();
secondFilename=reader.readLine();
File fileFirst=new File(firstFilename);
File fileSecond=new File(secondFilename);
BufferedReader reader1=null;
String str=null;
reader1=new BufferedReader(new FileReader(fileFirst));
while ((str=reader1.readLine())!=null){
allLines.add(str);
}
reader1=new BufferedReader(new FileReader(fileSecond));
while ((str=reader1.readLine())!=null){
linesForRemoval.add(str);
}
}catch (IOException ignored ){
}
try {
Solution solution=new Solution();
solution.joinData();
} catch (CorruptedDataException e) {
e.printStackTrace();
}
}
public void joinData() throws CorruptedDataException {
boolean bool=true;
Iterator<String> iterator=allLines.iterator();
while (iterator.hasNext()){
String s=iterator.next();
for (String str : linesForRemoval) {
if (s.equals(str)) {
iterator.remove();
bool=false;
}
}
}
if (bool){
allLines.clear();
throw new CorruptedDataException();
}
}
}