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);
|
System.out.println("Connecting to " + url);
|
||||||
URLConnection connection = url.openConnection();
|
URLConnection connection = url.openConnection();
|
||||||
connection.connect();
|
connection.connect();
|
||||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(
|
try (InputStreamReader streamReader = new InputStreamReader(connection.getInputStream());
|
||||||
connection.getInputStream()))) {
|
BufferedReader bufferedReader = new BufferedReader(streamReader)) {
|
||||||
for(String line; (line = in.readLine()) != null; ) {
|
for(String line; (line = bufferedReader.readLine()) != null; ) {
|
||||||
if (line.startsWith(MARKER)) {
|
if (line.startsWith(MARKER)) {
|
||||||
System.out.println(TAG.matcher(line).replaceAll(""));
|
System.out.println(TAG.matcher(line).replaceAll(""));
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,8 +124,9 @@ public class JarFinder {
|
||||||
jarDir));
|
jarDir));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try (JarOutputStream zos = new JarOutputStream(new FileOutputStream(jarFile))) {
|
try (FileOutputStream fos = new FileOutputStream(jarFile);
|
||||||
jarDir(dir, "", zos);
|
JarOutputStream jos = new JarOutputStream(fos)) {
|
||||||
|
jarDir(dir, "", jos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue