You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2023/06/30 11:37:00 UTC
[jira] [Updated] (NET-722) Javadoc for FtpClient.setControlKeepAliveReplyTimeout(Duration) says timeout is in milliseconds
[ https://issues.apache.org/jira/browse/NET-722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gary D. Gregory updated NET-722:
--------------------------------
Summary: Javadoc for FtpClient.setControlKeepAliveReplyTimeout(Duration) says timeout is in milliseconds (was: JavaDoc for FtpClient.setControlKeepAliveReplyTimeout(Duration) says timeout is in milliseconds)
> Javadoc for FtpClient.setControlKeepAliveReplyTimeout(Duration) says timeout is in milliseconds
> -----------------------------------------------------------------------------------------------
>
> Key: NET-722
> URL: https://issues.apache.org/jira/browse/NET-722
> Project: Commons Net
> Issue Type: Improvement
> Components: FTP
> Affects Versions: 3.9.0
> Reporter: David Costanzo
> Priority: Trivial
>
> The JavaDoc comment for [FtpClient.setControlKeepAliveReplyTimeout(Duration)|https://github.com/apache/commons-net/blob/master/src/main/java/org/apache/commons/net/ftp/FTPClient.java#L2918] is technically incorrect:
>
> {noformat}
> /**
> * Sets how long to wait for control keep-alive message replies.
> *
> * @param timeout number of milliseconds to wait (defaults to 1000)
> * @since 3.0
> * @see #setControlKeepAliveTimeout(Duration)
> */
> public void setControlKeepAliveReplyTimeout(final Duration timeout) {
> controlKeepAliveReplyTimeout = DurationUtils.zeroIfNull(timeout);
> }
> {noformat}
> The timeout is no longer "number of milliseconds" because it's a Duration and so has the unit embedded within. The JavaDoc also doesn't document the behavior when {{null}} is given.
> Perhaps this something like
> {noformat}
> @param timeout amount of time to wait. This defaults to 1000 milliseconds if not explicitly set. A value of {@code null} disables the timeout.{noformat}
> I'm sure you can do better than I can.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)