Use try-with-resources

This commit is contained in:
TacoTheDank authored and Cameron Gutman committed 2022-10-31 00:33:09 -05:00
1 parent 51594e00b8
commit a96e508ffb
11 files changed
+97 -134

No files matched your search

@@ -627,10 +627,9 @@ public class NvHTTP {
return getAppListByReader(new StringReader(getAppListRaw()));
}
else {
ResponseBody resp = openHttpConnection(baseUrlHttps, "applist", true);
LinkedList<NvApp> appList = getAppListByReader(new InputStreamReader(resp.byteStream()));
resp.close();
return appList;
try (final ResponseBody resp = openHttpConnection(baseUrlHttps, "applist", true)) {
return getAppListByReader(new InputStreamReader(resp.byteStream()));
}
}
}