You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/06/14 00:16:12 UTC
logging-log4j2 git commit: Avoid try-with-resources warning.
Repository: logging-log4j2
Updated Branches:
refs/heads/master d73864b73 -> 73f36e501
Avoid try-with-resources warning.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/73f36e50
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/73f36e50
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/73f36e50
Branch: refs/heads/master
Commit: 73f36e5017cd3adf31d09038714809ce57c674c7
Parents: d73864b
Author: Gary Gregory <ga...@gmail.com>
Authored: Sat Jun 13 15:16:10 2015 -0700
Committer: Gary Gregory <ga...@gmail.com>
Committed: Sat Jun 13 15:16:10 2015 -0700
----------------------------------------------------------------------
.../org/apache/logging/log4j/core/layout/SerializedLayout.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/73f36e50/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SerializedLayout.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SerializedLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SerializedLayout.java
index eb7203d..f60c1b2 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SerializedLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/SerializedLayout.java
@@ -40,8 +40,7 @@ public final class SerializedLayout extends AbstractLayout<LogEvent> {
static {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
- final ObjectOutputStream oos = new ObjectOutputStream(baos);
- oos.close();
+ new ObjectOutputStream(baos).close();
serializedHeader = baos.toByteArray();
} catch (final Exception ex) {
LOGGER.error("Unable to generate Object stream header", ex);