Severity | 2 |
---|---|
Enabled | no |
Waivable | |
Configuration |
Allowed exceptions in the thorws clauses: allowed-throw: org.hammurapi.inspectors.testcases.HammurapiTestCasesException |
Violation |
public void setFirstByte(final String fName) throws IOException { FileInputStream fin = null; fin = new FileInputStream(fName); firstByte = fin.read(); fin.close(); } |
Fix |
public void setFirstByte(final String fName)throws HammurapiTestCasesException { FileInputStream fin = null; try { fin = new FileInputStream(fName); firstByte = fin.read(); fin.close(); } catch (IOException e) { logger.error(FILE_ERROR_TXT, e); throw new HammurapiTestCasesException(e); } } |