On 6/21/06, Garrett Rooney <[EMAIL PROTECTED]> wrote:

Is there a reason that Abdera's Base interface defines clone as
returning something other than Object?


This is not good. Unless something changed in the JLS and I missed it, it is
not legal to have two methods on a class or interface whose signatures
differ only in the return type.

--
Martin Cooper


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

Reply via email to