diff options
author | Tor Norbye <tnorbye@google.com> | 2012-03-08 08:13:17 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-03-08 08:13:17 -0800 |
commit | 430883c5677c4b61d541c357fe073e6e04da4d0e (patch) | |
tree | 59c978ec60b81e761df4226b662ce99a47f0cc71 /anttasks/src | |
parent | e55ac714586c45abd3edd631ca13606c77194af2 (diff) | |
parent | 99f284970246c835142450d3366b69e526157f95 (diff) | |
download | sdk-430883c5677c4b61d541c357fe073e6e04da4d0e.zip sdk-430883c5677c4b61d541c357fe073e6e04da4d0e.tar.gz sdk-430883c5677c4b61d541c357fe073e6e04da4d0e.tar.bz2 |
am 99f28497: Merge "Close the dependency file after reading it."
* commit '99f284970246c835142450d3366b69e526157f95':
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 |