Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2012-04-06 04:38:01 -0400
committerAlexander Kurtakov2012-04-06 04:38:01 -0400
commit71315427bfed1041e4259dee52222d4cfaa81c31 (patch)
treef3ab21196bdbe1b3347fdf9c0a878b0f76adbd38 /libhover
parent202fc8a3c87eac076ee0a7f5ef1cab2fb89ae09c (diff)
downloadorg.eclipse.linuxtools-71315427bfed1041e4259dee52222d4cfaa81c31.tar.gz
org.eclipse.linuxtools-71315427bfed1041e4259dee52222d4cfaa81c31.tar.xz
org.eclipse.linuxtools-71315427bfed1041e4259dee52222d4cfaa81c31.zip
Make sure to close resources.
Diffstat (limited to 'libhover')
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java
index 08f657c864..7a8e965f92 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.texinfoparsers/src/org/eclipse/linuxtools/cdt/libhover/texinfoparsers/ParseGlibcTexinfo.java
@@ -718,9 +718,10 @@ public class ParseGlibcTexinfo {
Matcher mm = p.matcher(line);
if (mm.find()) {
String il;
+ BufferedReader is = null;
try {
String fileName = (srcdir.endsWith("/") ? srcdir : srcdir + "/") + mm.replaceAll("examples/$1");
- BufferedReader is = new BufferedReader(new FileReader(fileName));
+ is = new BufferedReader(new FileReader(fileName));
while (null != (il = is.readLine())) {
// C Help does not ignore "<" or ">" inside a <pre> or <samp> tag
// so we have to prepare for two levels of indirection. The
@@ -738,6 +739,13 @@ public class ParseGlibcTexinfo {
}
} catch (IOException e) {
System.out.println("IOException reading example file");
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ }
+ }
}
}
return Synopsis;

Back to the top