Что происходит с BufferedReader, который не закрывается в callable.call?

У меня три вопроса.

Чтобы объяснить, я просматривал чей-то код и заметил,BufferedReaderиногда они не закрыты. Обычно Eclipse выдает предупреждение, что это потенциальная утечка памяти (и я ее исправляю). Однако внутри вызываемого внутреннего класса нет предупреждения.

class outerClass {
    ...
    public void someMethod() {
        Future<Integer> future = outputThreadPool.submit(new innerClass(this.myProcess.getInputStream(), threadName));
        ...
    }

    class innerClass implements Callable<Integer> {
        private final InputStream stream;
        private final String prepend;

        innerClass(InputStream stream, String prepend) {
            this.stream = stream;
            this.prepend = prepend;
        }

        @Override
        public Integer call() {
            BufferedReader stdOut = new BufferedReader(new InputStreamReader(stream));
            String output = null;
            try {
                while ((output = stdOut.readLine()) != null) {
                    log.info("[" + prepend + "] " + output);
                }

            } catch (IOException ignore) {
            // I have no idea why we're ignoring this... :-|        
            }
            return 0;   
        }
    }
}

Люди, написавшие код, - опытные Java-разработчики, поэтому я сначала подумал, что он намеренный ... но, возможно, они спешили, когда написали его и просто упустили из виду.

My questions are:

Why does Eclipse not highlight this (which may be answered by the answer to the following questions)?

What is the worst that could happen if it's closed within the call() method? (I can't think of a good reason... and I've been searching for a while... but maybe it was intentional not to close the BufferedReader)

What is the worst that could happen if the BufferedReader is not closed within the inner class?

Ответы на вопрос(4)

Ваш ответ на вопрос