Moved resource declaration into try-statement.
This commit is contained in:
parent
d53814e154
commit
c285cc72d2
|
@ -82,16 +82,11 @@ public class RangePosition extends AbstractSourcePosition {
|
||||||
|
|
||||||
private int getCol(int line, int offset) {
|
private int getCol(int line, int offset) {
|
||||||
int col = -1;
|
int col = -1;
|
||||||
Reader reader = null;
|
try (Reader reader = getReader()){
|
||||||
try {
|
|
||||||
reader = getReader();
|
|
||||||
col = getCol(IOUtils.toString(reader), line, offset);
|
col = getCol(IOUtils.toString(reader), line, offset);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
|
||||||
IOUtils.closeQuietly(reader);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue