Re: [Codenarc-user] implementing Cloneable
Brought to you by:
chrismair
From: Roshan D. <ros...@gm...> - 2011-07-04 13:59:32
|
Great. Thanks. Waiting for this fixed CodeNarc to be available soon through its Grails plugin. On Mon, Jul 4, 2011 at 7:27 PM, Hamlet DArcy <ham...@ca...> wrote: > Yes, I checked the behavior. It does not give a warning for your code other > than "UnnecessaryOverridingMethod". That is the one and only warning > produced. It does not look at the return type of clone(). > > > ----- Original Message ----- > > > > 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 > > Skype: roshandawrani > > > > > |