Подскажите, почему программа не заходит в метод run?
package com.javarush.task.task18.task1823;
import java.io.*;
import java.util.*;
/*
Нити и байты
*/
public class Solution {
public static Map<String, Integer> resultMap = new HashMap<String, Integer>();
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
do{
String fName = br.readLine();
if(fName.equals("exit"))
break;
ReadThread th = new ReadThread(fName);
th.start();
//th.stop();
}while(true);
}
public static class ReadThread extends Thread {
HashMap<Integer, Integer> map;
private String fileName;
BufferedReader br;
public ReadThread(String fileName) throws FileNotFoundException {
this.fileName = fileName;
//implement constructor body
}
// implement file reading here - реализуйте чтение из файла тут
@Override
public void run(){
try {
br = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
map = findMaxByteInFile(br);
resultMap.put(fileName, Collections.max(map.values()));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
br.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public HashMap<Integer,Integer> findMaxByteInFile(BufferedReader br) throws IOException {
HashMap<Integer, Integer> map = new HashMap<>();
int c;
while(br.ready()){
c = br.read();
if(map.containsKey(c)){
map.put(c, map.get(c)+1);
} else {
map.put(c, 1);
}
}
return map;
}
}
}