Re: [Codenarc-user] implementing Cloneable
Brought to you by:
chrismair
From: Hamlet D. <ham...@ca...> - 2011-07-04 13:00:11
|
Interesting... if you add the public modifier, does it fix the error? All of our test cases have the public modifier in it, so this is a case we didn't test. We check for a clone method like this: ClassNode classNode = ... boolean hasMethod = classNode.getDeclaredMethod('clone', [] as Parameter[]) ----- Original Message ----- > > > Hi, > > > Can someone help me see what is wrong in the following code: > ------------------------------------------------------------------------------- > class Dummy implements Cloneable { > Object clone ( ) { > super . clone ( ) > } > } > ------------------------------------------------------------------------------- > > CodeNarc output shows and I can't figure out how to make it happy: > > ------------------------------------------------------------------------------- > line: 1 CloneableWithoutClone The class Dummy implements Cloneable > but does not define a proper clone() method source: class Dummy > implements Cloneable { > > ------------------------------------------------------------------------------- > > -- > Roshan > Blog: http://roshandawrani.wordpress.com/ > Twitter: @roshandawrani > Skype: roshandawrani > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously > valuable. > Why? It contains a definitive record of application performance, > security > threats, fraudulent activity, and more. Splunk takes this data and > makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Codenarc-user mailing list > Cod...@li... > https://lists.sourceforge.net/lists/listinfo/codenarc-user > |