You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/06/19 18:48:38 UTC
(commons-net) branch pr-395 created (now f1e913f0)
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a change to branch pr-395
in repository https://gitbox.apache.org/repos/asf/commons-net.git
at f1e913f0 Fix GH PR suggestion compilation.
This branch includes the following new commits:
new f1e913f0 Fix GH PR suggestion compilation.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(commons-net) 01/01: Fix GH PR suggestion compilation.
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
garydgregory pushed a commit to branch pr-395
in repository https://gitbox.apache.org/repos/asf/commons-net.git
commit f1e913f012d4c66724df2f1c577d777cc6be7f78
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Jun 19 18:48:26 2026 +0000
Fix GH PR suggestion compilation.
Use ternary expression.
---
.../java/org/apache/commons/net/ftp/FTPSClient.java | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/apache/commons/net/ftp/FTPSClient.java b/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
index e8e8bb31..e96fb566 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
@@ -1120,21 +1120,14 @@ public class FTPSClient extends FTPClient {
}
}
- @Override
- protected String resolveExtendedPassiveModeHost() {
- if (_socket_ instanceof SSLSocket) {
- return ((SSLSocket) _socket_).getSession().getPeerHost();
- } else {
- return super.resolveExtendedPassiveModeHost();
- }
- }
/**
- * Resolves the host for extended passive mode using the TLS session peer host,
- * enabling TLS session reuse between the control and data connections.
+ * Resolves the host for extended passive mode using the TLS session peer host, enabling TLS session reuse between the control and data connections.
*
+ * @return the passive host from the SSL session, or the default if not an SSL connection.
* @since 3.14.0
- * @return the passive host from the SSL session, or the default if not an SSL connection
*/
@Override
protected String resolveExtendedPassiveModeHost() {
-
+ return _socket_ instanceof SSLSocket ? ((SSLSocket) _socket_).getSession().getPeerHost() : super.resolveExtendedPassiveModeHost();
+ }
+}
\ No newline at end of file