Вообще ничего ему не нравиться
не понимаю, почему не прохожу по требованиям
package com.javarush.task.task17.task1721;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
/*
Транзакционность
*/
public class Solution {
public static List<String> allLines = new ArrayList<String>();
public static List<String> forRemoveLines = new ArrayList<String>();
static String line = "";
public void main(String[] args) {
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
FileInputStream f1 = new FileInputStream(reader.readLine());
FileInputStream f2 = new FileInputStream(reader.readLine());
line = reader.readLine();
reader.close();
while (line != null) {
allLines.add(line);
forRemoveLines.add(line);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try {
joinData();
} catch (CorruptedDataException e) {
e.printStackTrace();
}
}
public void joinData() throws CorruptedDataException {
for (String s : allLines)
for (String ss : forRemoveLines) {
if (s.equals(ss)) {
allLines.remove(s);
} else allLines.clear();
throw new CorruptedDataException();
}
}
}