mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 20:42:21 +00:00
use try with resources instead of try finally
This commit is contained in:
1 parent
ccdb6350f7
commit
4cad1a455f
4 files changed
+9
-30
No files matched your search
@@ -208,13 +208,10 @@ public class FilePathTest {
|
||||
for (int i = 0; i < 10000; i++) {
|
||||
// TODO is there a simpler way to force the TarOutputStream to be flushed and the reader to start?
|
||||
// Have not found a way to make the failure guaranteed.
|
||||
OutputStream os = from.child("content" + i).write();
|
||||
try {
|
||||
try (OutputStream os = from.child("content" + i).write()) {
|
||||
for (int j = 0; j < 1024; j++) {
|
||||
os.write('.');
|
||||
}
|
||||
} finally {
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
FilePath toF = to.child("content0");
|
||||
|
||||
Reference in new issue
Block a user