If a class defines a "void close()" then that class should implement java.io.Closeable.
+ If a class defines a void close()
method then that class should implement java.io.Closeable
.
+This rule has a single enhancedMode
property which defaults to false
. When set to true
, this rule will run in enhanced mode and will not produce a violation when a class implements close
and extends a class that itself implements Closeable
.
]]>
design
@@ -2407,7 +2409,7 @@
Here are a couple references that discuss the problems with using instanceof
and the preference for using instead:
* Beware of instanceof operator
* How does one use polymorphism instead of instanceof? (And why?)
-By default, the rule does not analyze test files. This rule sets the default value of the property to ignore file names ending in 'Test.groovy', 'Tests.groovy' or 'TestCase.groovy'.
+By default, the rule does not analyze test files. This rule sets the default value of the property to ignore file names ending in 'Spec.groovy', 'Test.groovy', 'Tests.groovy' or 'TestCase.groovy'.
Example of violations:
class MyClass {
@@ -2500,7 +2502,7 @@ for (int i = 0; i < 100; ++i) {
This rule checks for duplicate number literals within the current class.
Code containing duplicate literals can usually be improved by declaring the as a constant field.
-By default, the rule does not analyze test files. This rule sets the default value of the property to ignore file names ending in 'Test.groovy', 'Tests.groovy' or 'TestCase.groovy'.
+By default, the rule does not analyze test files. This rule sets the default value of the property to ignore file names ending in 'Spec.groovy', 'Test.groovy', 'Tests.groovy' or 'TestCase.groovy'.
]]>
bug
@@ -2518,7 +2520,7 @@ for (int i = 0; i < 100; ++i) {
This rule checks for duplicate String literals within the current class.
Code containing duplicate literals can usually be improved by declaring the as a constant field.
-By default, the rule does not analyze test files. This rule sets the default value of the property to ignore file names ending in 'Test.groovy', 'Tests.groovy' or 'TestCase.groovy'.
+By default, the rule does not analyze test files. This rule sets the default value of the property to ignore file names ending in 'Spec.groovy', 'Test.groovy', 'Tests.groovy' or 'TestCase.groovy'.
]]>
bug
@@ -2536,7 +2538,7 @@ for (int i = 0; i < 100; ++i) {
This rule checks for duplicate