diff options
author | Tor Norbye <tnorbye@google.com> | 2012-03-08 06:58:31 -0800 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-03-08 06:58:33 -0800 |
commit | 99f284970246c835142450d3366b69e526157f95 (patch) | |
tree | 396cc4a5236661180f6a799f9d340cc7f35c8a24 /anttasks/src | |
parent | af6d1e01e84f2f30b8dc8a82cf343a3636e7e2b9 (diff) | |
parent | 763b15fd4fd4cf92b6aef2e29de98008894413a5 (diff) | |
download | sdk-99f284970246c835142450d3366b69e526157f95.zip sdk-99f284970246c835142450d3366b69e526157f95.tar.gz sdk-99f284970246c835142450d3366b69e526157f95.tar.bz2 |
Merge "Close the dependency file after reading it."
Diffstat (limited to 'anttasks/src')
-rw-r--r-- | anttasks/src/com/android/ant/DependencyGraph.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/anttasks/src/com/android/ant/DependencyGraph.java b/anttasks/src/com/android/ant/DependencyGraph.java index 8671359..ef059b9 100644 --- a/anttasks/src/com/android/ant/DependencyGraph.java +++ b/anttasks/src/com/android/ant/DependencyGraph.java @@ -436,13 +436,17 @@ public class DependencyGraph { if (fStream != null) { BufferedReader reader = new BufferedReader(new InputStreamReader(fStream)); - String line; - StringBuilder total = new StringBuilder(reader.readLine()); - while ((line = reader.readLine()) != null) { - total.append('\n'); - total.append(line); + try { + String line; + StringBuilder total = new StringBuilder(reader.readLine()); + while ((line = reader.readLine()) != null) { + total.append('\n'); + total.append(line); + } + return total.toString(); + } finally { + reader.close(); } - return total.toString(); } } catch (IOException e) { // we'll just return null |