You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by ma...@apache.org on 2016/07/13 20:09:10 UTC
[06/50] [abbrv] logging-log4j2 git commit: try-with-resources.
try-with-resources.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/b7d4f724
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/b7d4f724
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/b7d4f724
Branch: refs/heads/feature/LOG4J2-1430
Commit: b7d4f72490600517c16f43f6c1c10b6f2a796374
Parents: 20a316e
Author: Gary Gregory <gg...@apache.org>
Authored: Tue Jun 28 13:35:06 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Tue Jun 28 13:35:06 2016 -0700
----------------------------------------------------------------------
.../log4j/core/appender/rolling/RollingAppenderCronTest.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/b7d4f724/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java
index 3a7a5f6..e47f389 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java
@@ -81,9 +81,9 @@ public class RollingAppenderCronTest {
fail("No compressed files found");
}
final Path src = FileSystems.getDefault().getPath("target/test-classes/log4j-rolling-cron2.xml");
- final OutputStream os = new FileOutputStream("target/test-classes/log4j-rolling-cron.xml");
- Files.copy(src, os);
- os.close();
+ try (final OutputStream os = new FileOutputStream("target/test-classes/log4j-rolling-cron.xml")) {
+ Files.copy(src, os);
+ }
Thread.sleep(5000);
// force a reconfiguration
for (int i = 0; i < MAX_TRIES; ++i) {