commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r805384 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
Date Tue, 18 Aug 2009 12:48:11 GMT
On 18/08/2009, joehni@apache.org <joehni@apache.org> wrote:
> Author: joehni
>  Date: Tue Aug 18 12:22:35 2009
>  New Revision: 805384
>
>  URL: http://svn.apache.org/viewvc?rev=805384&view=rev
>  Log:
>  Make FileSystemOptions cloneable (VFS-278).
>
>  Modified:
>     commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
>
>  Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
>  URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java?rev=805384&r1=805383&r2=805384&view=diff
>  ==============================================================================
>  --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
(original)
>  +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/FileSystemOptions.java
Tue Aug 18 12:22:35 2009
>  @@ -29,7 +29,7 @@
>   * @see org.apache.commons.vfs.provider.sftp.SftpFileSystemConfigBuilder
>   * @see org.apache.commons.vfs.provider.ftp.FtpFileSystemConfigBuilder
>   */
>  -public class FileSystemOptions
>  +public class FileSystemOptions implements Cloneable
>   {
>      /** The options */
>      private Map options = new TreeMap();
>  @@ -161,5 +161,14 @@
>          // TODO: compare Entry by Entry
>          return 0;
>      }
>  +
>  +    /**
>  +     * {@inheritDoc}
>  +     */
>  +    public Object clone() {
>  +        FileSystemOptions clone = new FileSystemOptions();
>  +        clone.options = new TreeMap(options);
>  +        return clone;
>  +    }

This clone() does not call super.clone() so won't work properly for sub-classes.

>   }
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message