This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit d59a8538d24186a4701af551d57fcbbe7aa694aa Author: Gilvan Filho <[email protected]> AuthorDate: Mon Dec 5 20:49:21 2022 -0300 (chores) camel-ftp: replace inner class with lambda --- .../camel/component/file/remote/SftpOperations.java | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java index ea4f6e54087..3fde4ffcddb 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java @@ -1171,18 +1171,16 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> { final Socket[] sockp = new Socket[1]; final Exception[] ee = new Exception[1]; String message = ""; - Thread tmp = new Thread(new Runnable() { - public void run() { - sockp[0] = null; - try { - sockp[0] = new Socket(InetAddress.getByName(host), port, InetAddress.getByName(bindAddress), 0); - } catch (Exception e) { - ee[0] = e; - if (sockp[0] != null && sockp[0].isConnected()) { - IOHelper.close(sockp[0]); - } - sockp[0] = null; + Thread tmp = new Thread(() -> { + sockp[0] = null; + try { + sockp[0] = new Socket(InetAddress.getByName(host), port, InetAddress.getByName(bindAddress), 0); + } catch (Exception e) { + ee[0] = e; + if (sockp[0] != null && sockp[0].isConnected()) { + IOHelper.close(sockp[0]); } + sockp[0] = null; } }); tmp.setName("Opening Socket " + host);
