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
{
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;
}
}
......
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