Code Room
Code reviewMediumcr-g103
Subject Swallowed exceptionsLevel Mid–Senior~20 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Java resource handler.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewjava
public String readFirstLine(String path) {    BufferedReader r = null;    try {        r = new BufferedReader(new FileReader(path));        return r.readLine();    } catch (IOException e) {        log.warn("read failed");        return null;    } finally {        try {            if (r != null) r.close();        } catch (IOException e) {            return "";        }    }}
Run or narrate your approach, then ask the coach.