Update close for try witch resources

This commit is contained in:
xjoao 2020-05-22 13:58:45 -04:00
parent 84f4760349
commit f3042b6b45

View File

@ -133,10 +133,9 @@ public class YoutubeManager {
InputStream is = conn.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
YoutubePlaylist playlist = null;
YoutubePlaylist playlist;
try (BufferedReader br = new BufferedReader(isr)) {
playlist = null;
String inputLine;
while ((inputLine = br.readLine()) != null) {
if (inputLine.contains("window[\"ytInitialData\"]")) {
@ -161,8 +160,7 @@ public class YoutubeManager {
break;
}
}
br.close();
}
this.playlistCache.put(playlistId, playlist);