Kaydet (Commit) 226285b7 authored tarafından Noel Grandin's avatar Noel Grandin

java: calling ready() on a BufferedReader is a dodgy way..

..to detect end-of-file

Change-Id: I3b1d5eca3a7424d72b5e3ab741f7407ad7e65193
üst 6d5fc817
...@@ -589,26 +589,21 @@ public class APIDescGetter extends DescGetter ...@@ -589,26 +589,21 @@ public class APIDescGetter extends DescGetter
{ {
InputStream in = con.getInputStream(); InputStream in = con.getInputStream();
java.io.BufferedReader buf = new java.io.BufferedReader(new InputStreamReader(in)); java.io.BufferedReader buf = new java.io.BufferedReader(new InputStreamReader(in));
boolean found = false; while (true)
while (buf.ready() && !found)
{ {
String entry = buf.readLine(); 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 =
System.out.println("FOUND ####"); this.getClass().getResourceAsStream("/objdsc/" +
InputStream input = module +
this.getClass().getResourceAsStream("/objdsc/" + "/" +
module + entry);
"/" + csvFile = new BufferedReader(new InputStreamReader(input));
entry); break;
csvFile =
new BufferedReader(new InputStreamReader(input));
found = true;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment