All pastes #2108398 Raw Edit

Miscellany

public java v1 · immutable
#2108398 ·published 2012-01-31 23:21 UTC
rendered paste body
response = reader.readLine();while(response != null) {	response += reader.readLine();}/*Let's walk through what this is doing.First, it's getting a line from reader, and storing it in the variable: response.Then, as long as response (the variable, not the line) is NOT NULL, it is looping.	It is repeatedly adding reader.readLine() to response. Even if reader.readLine() is null, it'll still try to add it.	The variable 'response' will NEVER BE NULL unless the FIRST LINE is null. It'll loop forever./*// Do this instead:response = "";String line = reader.readLine();while (line != null) {	response += line;	line = reader.readLine();}