FindBugs is reporting me that I'm comparing nonnegative value with -1 for the following code.
/* I get inputstreamreader from a org.apache.commons.net.telnet.TelnetClient object */
InputStreamReader reader = telnet.getInputStream();
char msg = 0;
StringBuilder temp = new StringBuilder();
while((msg = (char)reader.read()) != -1){
temp.append(msg);
}
System.out.println("Read Message = "+temp.toString());
But when I read through the InputStreamReader.read()
documentation it says "Returns: The number of characters read, or -1 if the end of the stream has been reached"
What is it I'm doing wrong here.. ?
Thanks in advance