JNSimba commented on code in PR #129:
URL:
https://github.com/apache/doris-flink-connector/pull/129#discussion_r1149143677
##########
flink-doris-connector/src/main/java/org/apache/doris/flink/rest/RestService.java:
##########
@@ -192,16 +191,13 @@ private static String parseResponse(HttpURLConnection
connection, Logger logger)
connection.getURL(), connection.getResponseCode());
throw new IOException("Failed to get response from Doris");
}
- String result = "";
- BufferedReader in = new BufferedReader(new
InputStreamReader(connection.getInputStream(), "utf-8"));
- String line;
- while ((line = in.readLine()) != null) {
- result += line;
- }
- if (in != null) {
- in.close();
+ StringBuffer result = new StringBuffer();
+ try (Scanner scanner = new Scanner(connection.getInputStream(),
"utf-8")) {
+ while (scanner.hasNext()) {
+ result.append(scanner.next());
+ }
+ return result.toString();
}
- return result;
Review Comment:
This seems to have been modified in
[PR-124](https://github.com/apache/doris-flink-connector/pull/124/files) here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]