HBASE-16035 Nested AutoCloseables might not all get closed (Sean Mackrory)
This commit is contained in:
parent
4ca4cd856e
commit
3de0c63105
|
@ -72,9 +72,9 @@ public class LogLevel {
|
|||
System.out.println("Connecting to " + url);
|
||||
URLConnection connection = url.openConnection();
|
||||
connection.connect();
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(
|
||||
connection.getInputStream()))) {
|
||||
for(String line; (line = in.readLine()) != null; ) {
|
||||
try (InputStreamReader streamReader = new InputStreamReader(connection.getInputStream());
|
||||
BufferedReader bufferedReader = new BufferedReader(streamReader)) {
|
||||
for(String line; (line = bufferedReader.readLine()) != null; ) {
|
||||
if (line.startsWith(MARKER)) {
|
||||
System.out.println(TAG.matcher(line).replaceAll(""));
|
||||
}
|
||||
|
|
|
@ -124,8 +124,9 @@ public class JarFinder {
|
|||
jarDir));
|
||||
}
|
||||
}
|
||||
try (JarOutputStream zos = new JarOutputStream(new FileOutputStream(jarFile))) {
|
||||
jarDir(dir, "", zos);
|
||||
try (FileOutputStream fos = new FileOutputStream(jarFile);
|
||||
JarOutputStream jos = new JarOutputStream(fos)) {
|
||||
jarDir(dir, "", jos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue