You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "David Costanzo (Jira)" <ji...@apache.org> on 2023/06/29 19:39:00 UTC

[jira] [Created] (NET-722) JavaDoc for FtpClient.setControlKeepAliveReplyTimeout(Duration) says timeout is in milliseconds

David Costanzo created NET-722:
----------------------------------

             Summary: 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


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)