[Codenarc-developer] UnnecessaryOverridingGetterRule
Brought to you by:
chrismair
From: Chris M. <chr...@ea...> - 2011-11-10 18:49:25
|
Hamlet, The documentation for UnnecessaryOverridingGetterRule says: If a parent class defines a public method that follows the Java getter notation, and a subclass overrides that method to return a constant, then it is cleaner to provide a Groovy property for the value rather than a Groovy method. But the implementation doesn't seem to check for a parent class. And I think the rule would apply whether or not the current class extended another or not, and whether or not the getter method was overriding a superclass method or not. If that is true, then are you ok with me renaming the rule (perhaps GetterMethodCouldBeProperty), and perhaps moving into "Groovyism" ruleset (not sure about that, yet)? Chris |