aboutsummaryrefslogtreecommitdiffstats
path: root/anttasks/src
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-03-08 06:58:31 -0800
committerandroid code review <noreply-gerritcodereview@google.com>2012-03-08 06:58:33 -0800
commit99f284970246c835142450d3366b69e526157f95 (patch)
tree396cc4a5236661180f6a799f9d340cc7f35c8a24 /anttasks/src
parentaf6d1e01e84f2f30b8dc8a82cf343a3636e7e2b9 (diff)
parent763b15fd4fd4cf92b6aef2e29de98008894413a5 (diff)
downloadsdk-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.java16
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