Browse Source

Moved resource declaration into try-statement.

master
Achim D. Brucker 4 years ago
parent
commit
c285cc72d2
  1. 7
      com.ibm.wala.cast/source/java/com/ibm/wala/cast/tree/impl/RangePosition.java

7
com.ibm.wala.cast/source/java/com/ibm/wala/cast/tree/impl/RangePosition.java

@ -82,16 +82,11 @@ public class RangePosition extends AbstractSourcePosition {
private int getCol(int line, int offset) {
int col = -1;
Reader reader = null;
try {
reader = getReader();
try (Reader reader = getReader()){
col = getCol(IOUtils.toString(reader), line, offset);
} catch (IOException e) {
e.printStackTrace();
} finally {
IOUtils.closeQuietly(reader);
}
return col;
}

Loading…
Cancel
Save