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,14 +589,11 @@ public class APIDescGetter extends DescGetter ...@@ -589,14 +589,11 @@ 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 ####"); System.out.println("FOUND ####");
...@@ -605,10 +602,8 @@ public class APIDescGetter extends DescGetter ...@@ -605,10 +602,8 @@ public class APIDescGetter extends DescGetter
module + module +
"/" + "/" +
entry); entry);
csvFile = csvFile = new BufferedReader(new InputStreamReader(input));
new BufferedReader(new InputStreamReader(input)); break;
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