Re: [Codenarc-user] implementing Cloneable
Brought to you by:
chrismair
From: Roshan D. <ros...@gm...> - 2011-07-04 13:06:48
|
whatever is on codenarc web console. On Mon, Jul 4, 2011 at 6:35 PM, Hamlet DArcy <ham...@ca...> wrote: > What version is this? > > ----- Original Message ----- > > No, it doesn't fix the error. > > > > > > In fact adds one more error to the mix "UnnecessaryPublicModifier The > > public keyword is unnecessary for methods source: public Object > > clone() {" > > > > > > > > > > On Mon, Jul 4, 2011 at 6:30 PM, Hamlet DArcy < ham...@ca... > > > wrote: > > > > > > 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 > > > > > > > > > > > -- > > Roshan > > Blog: http://roshandawrani.wordpress.com/ > > Twitter: @roshandawrani > > Skype: roshandawrani > > > > > |