On 18/08/2009, joe...@apache.org <joe...@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-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org