Re: [Codenarc-user] implementing Cloneable
Brought to you by:
chrismair
From: Roshan D. <ros...@gm...> - 2011-07-04 13:53:50
|
On Mon, Jul 4, 2011 at 7:18 PM, Hamlet DArcy <ham...@ca...> wrote: > CodeNarc 0.14 does not give a warning for your code. It does however give > this warning: > > line: 2 UnnecessaryOverridingMethod The method clone contains no logic and > can be safely deleted source: Dummy clone() {super.clone()} > No, no. This error is obvious and irrelevant to my question, that's why I was trying to keep it out of the discussion :-) I am getting "CloneableWithoutClone" and my code defines a covariant clone() like below: class Dummy implements Cloneable { Dummy clone() { super.clone() // some more stuff } } Can anyone please check the behavior in case of co-variant clone()? -- Roshan Blog: http://roshandawrani.wordpress.com/ Twitter: @roshandawrani <http://twitter.com/roshandawrani> Skype: roshandawrani |