diff options
author | Siva Velusamy <vsiva@google.com> | 2012-06-22 14:57:49 -0700 |
---|---|---|
committer | Siva Velusamy <vsiva@google.com> | 2012-06-22 15:00:21 -0700 |
commit | 5f2b9cd07a6f3c409971218ee34d3f7b36bd4725 (patch) | |
tree | b08dd45a40b01edaedc064343a4f8ae4da0ea6bb /anttasks/src/com | |
parent | e78828cf7b338041d480e41c17edf77aba25eadb (diff) | |
download | sdk-5f2b9cd07a6f3c409971218ee34d3f7b36bd4725.zip sdk-5f2b9cd07a6f3c409971218ee34d3f7b36bd4725.tar.gz sdk-5f2b9cd07a6f3c409971218ee34d3f7b36bd4725.tar.bz2 |
Fix minor errors when used with Eclipse4.
Change-Id: Ia31c45715530f58ac293f61185b5a45f71fab4f5
Diffstat (limited to 'anttasks/src/com')
-rw-r--r-- | anttasks/src/com/android/ant/DependencyGraph.java | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/anttasks/src/com/android/ant/DependencyGraph.java b/anttasks/src/com/android/ant/DependencyGraph.java index ef059b9..4a02aa8 100644 --- a/anttasks/src/com/android/ant/DependencyGraph.java +++ b/anttasks/src/com/android/ant/DependencyGraph.java @@ -431,25 +431,28 @@ public class DependencyGraph { * @return null if the file could not be read */ private static String readFile(String filepath) { + FileInputStream fStream = null; + BufferedReader reader = null; try { - FileInputStream fStream = new FileInputStream(filepath); - if (fStream != null) { - BufferedReader reader = new BufferedReader(new InputStreamReader(fStream)); - + fStream = new FileInputStream(filepath); + 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); + } + return total.toString(); + } catch (IOException e) { + // we'll just return null + } finally { + if (reader != null) { 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(); + } catch (IOException e) { } } - } catch (IOException e) { - // we'll just return null } return null; } |