abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James M Snell <jasn...@gmail.com>
Subject Re: Base.clone() vs Object.clone()
Date Wed, 21 Jun 2006 17:06:23 GMT


Garrett Rooney wrote:
> Is there a reason that Abdera's Base interface defines clone as
> returning something other than Object?
> 

Just a general preference for type-safety.  It can be changed if lesser
IDE's ;-P are having a problem ;-P

- James

> public interface Base extends Cloneable {
> 
>  /**
>   * Serializes the model component out to the specified stream
>   */
>  void writeTo(OutputStream out) throws IOException;
> 
>  /**
>   * Serializes the model component out to the specified writer
>   */
>  void writeTo(Writer writer) throws IOException;
> 
>  <T extends Base>T clone();
> 
>  Factory getFactory();
> 
> }
> 
> This seems to be contrary to the way I've always seen clone defined,
> and it certainly throws IDEA for a loop, resulting in complaints about
> errors in every single class in the model package due to that clash
> between Base.clone and Object.clone.
> 
> -garrett
> 

Mime
View raw message