camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gzurow...@apache.org
Subject [2/2] camel git commit: Replace try-with-resources to avoid CS warnings
Date Sun, 27 Mar 2016 16:20:23 GMT
Replace try-with-resources to avoid CS warnings

Use traditional try..finally instead of Java 7's try-with-resources to
avoid warnings caused by older Checkstyle version and configuration.

Signed-off-by: Gregor Zurowski <gregor@zurowski.org>

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c54b3628
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c54b3628
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c54b3628

Branch: refs/heads/camel-2.15.x
Commit: c54b3628b66217c5785a9298d708fa214fd9e471
Parents: 0a4c7e3
Author: Gregor Zurowski <gregor@zurowski.org>
Authored: Sun Mar 27 18:18:34 2016 +0200
Committer: Gregor Zurowski <gregor@zurowski.org>
Committed: Sun Mar 27 18:18:34 2016 +0200

----------------------------------------------------------------------
 .../camel/component/netty4/NettyProducerHangTest.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c54b3628/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
----------------------------------------------------------------------
diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
index 2b4e74d..5af845c 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyProducerHangTest.java
@@ -72,8 +72,13 @@ public class NettyProducerHangTest extends CamelTestSupport {
         Socket soc = serverSocket.accept();
 
         log.info("Open socket and accept data");
-        try (InputStream is = soc.getInputStream();
-                OutputStream os = soc.getOutputStream()) {
+
+        InputStream is = null;
+        OutputStream os = null;
+
+        try {
+            is = soc.getInputStream();
+            os = soc.getOutputStream();
             // read first message
             is.read(buf);
 
@@ -85,6 +90,8 @@ public class NettyProducerHangTest extends CamelTestSupport {
 
             // do not reply, just close socket (emulate network problem)
         } finally {
+            os.close();
+            is.close();
             soc.close();
             serverSocket.close();
         }


Mime
View raw message