kotlin中不提倡将=当作表达式
错误代码
StringBuilder body = new StringBuilder();
String nextLine;
while ((nextLine = bufferReader.readLine()) != null) {
body.append(nextLine);
body.append('\n');
}
修改后的正确代码
将判断和赋值语句分开
StringBuilder body = new StringBuilder();
String nextLine;
while ((nextLine = bufferReader.readLine()) != null) {
body.append(nextLine);
body.append('\n');
}