Помогите найти ошибку, пожалуйста, у меня программа работает, но валидатором не принимается
package com.javarush.task.task18.task1823;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/*
Нити и байты
ДОЛГОЕ ВРЕМЯ ВЫПОЛНЕНИЯ В ВАЛИДАТОРЕ
*/
public class Solution {
public static Map<String, Integer> resultMap = new HashMap<String, Integer>();
public static void main(String[] args) throws IOException, InterruptedException {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Thread> threads = new ArrayList<>();
String s="";
while (true){
s = bufferedReader.readLine();
if (s.equals("exit")) break;
threads.add(new ReadThread(s));
}
bufferedReader.close();
for (Thread thread : threads) thread.start();
}
public static class ReadThread extends Thread {
private String fileName;
private Integer bait;
private HashMap<Integer, Integer> map = new HashMap<>();
public ReadThread(String fileName) {
super();
this.fileName = fileName;//implement constructor body
}
public void run(){
// считываем из файла в карту
while (!isInterrupted()) {
try {
FileInputStream inputStream = new FileInputStream(fileName);
while (inputStream.available() > 0) {
int x = inputStream.read();
if (map.containsKey(x)) map.put(x, map.get(x) + 1);
else map.put(x, 1);
}
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
//находим максимальный байт
int maxValue = 0;
for (Integer i : map.values()) {
if (i > maxValue) maxValue = i;
}
for (Integer i : map.keySet()) {
if (map.get(i) == maxValue) bait = i;
}
synchronized (Solution.class) {
resultMap.put(fileName, bait);
}
interrupt();
}
}
}
}