diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-30 10:47:32 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-30 14:43:45 +0200 |
commit | 226285b7ccc0c6880ae1005c9f0d9f47aa41fc29 (patch) | |
tree | e5dc790fdcb6969640300d5a5721925216fb4ac7 /qadevOOo | |
parent | 6d5fc817b5e84cf0669725cf0ef3a94f93158f50 (diff) |
java: calling ready() on a BufferedReader is a dodgy way..
..to detect end-of-file
Change-Id: I3b1d5eca3a7424d72b5e3ab741f7407ad7e65193
Diffstat (limited to 'qadevOOo')
-rw-r--r-- | qadevOOo/runner/helper/APIDescGetter.java | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/qadevOOo/runner/helper/APIDescGetter.java b/qadevOOo/runner/helper/APIDescGetter.java index 71c8981c84e4..2df8ceae37ec 100644 --- a/qadevOOo/runner/helper/APIDescGetter.java +++ b/qadevOOo/runner/helper/APIDescGetter.java @@ -589,26 +589,21 @@ public class APIDescGetter extends DescGetter { InputStream in = con.getInputStream(); java.io.BufferedReader buf = new java.io.BufferedReader(new InputStreamReader(in)); - boolean found = false; - - while (buf.ready() && !found) + while (true) { String entry = buf.readLine(); - - if (entry != null) + if (entry == null) + break; + if (entry.endsWith(sEndsWithCSVName)) { - if (entry.endsWith(sEndsWithCSVName)) - { - System.out.println("FOUND ####"); - InputStream input = - this.getClass().getResourceAsStream("/objdsc/" + - module + - "/" + - entry); - csvFile = - new BufferedReader(new InputStreamReader(input)); - found = true; - } + System.out.println("FOUND ####"); + InputStream input = + this.getClass().getResourceAsStream("/objdsc/" + + module + + "/" + + entry); + csvFile = new BufferedReader(new InputStreamReader(input)); + break; } } |