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/11/03 19:56:02 UTC
logging-log4j2 git commit: Fix compiler warning by using
try-with-resources.
Repository: logging-log4j2
Updated Branches:
refs/heads/master 71c863dd5 -> 47e899dbb
Fix compiler warning by using 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/47e899db
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/47e899db
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/47e899db
Branch: refs/heads/master
Commit: 47e899dbbe905d453610316b506df70c26a44792
Parents: 71c863d
Author: ggregory <gg...@apache.org>
Authored: Tue Nov 3 10:55:53 2015 -0800
Committer: ggregory <gg...@apache.org>
Committed: Tue Nov 3 10:55:53 2015 -0800
----------------------------------------------------------------------
.../logging/log4j/core/net/ssl/SslConfigurationTest.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/47e899db/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/SslConfigurationTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/SslConfigurationTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/SslConfigurationTest.java
index 5283535..6e5773c 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/SslConfigurationTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/net/ssl/SslConfigurationTest.java
@@ -40,9 +40,10 @@ public class SslConfigurationTest {
public void emptyConfigurationHasDefaultTrustStore() throws IOException {
final SslConfiguration sc = SslConfiguration.createSSLConfiguration(null, null, null);
final SSLSocketFactory factory = sc.getSslSocketFactory();
- final SSLSocket clientSocket = (SSLSocket) factory.createSocket(TLS_TEST_HOST, TLS_TEST_PORT);
- clientSocket.close();
- Assert.assertNotNull(clientSocket);
+ try (final SSLSocket clientSocket = (SSLSocket) factory.createSocket(TLS_TEST_HOST, TLS_TEST_PORT)) {
+ Assert.assertNotNull(clientSocket);
+ clientSocket.close();
+ }
}
@Test