Fix AbstractClassWithoutAnyMethods FN with inner classes
This commit is contained in:
1 parent
25ef59d5a7
commit
552931d965
2 files changed
+34
-1
No files matched your search
@@ -28,7 +28,7 @@ protected constructor in order to prevent instantiation than make the class misl
|
||||
<![CDATA[
|
||||
//ClassOrInterfaceDeclaration
|
||||
[@Abstract = 'true']
|
||||
[count(.//MethodDeclaration) + count(.//ConstructorDeclaration) = 0]
|
||||
[count(./ClassOrInterfaceBody/*/MethodDeclaration) + count(./ClassOrInterfaceBody/*/ConstructorDeclaration) = 0]
|
||||
[not(../Annotation/MarkerAnnotation/Name[pmd-java:typeIs('com.google.auto.value.AutoValue')])]
|
||||
]]>
|
||||
</value>
|
||||
|
||||
+33
@@ -76,4 +76,37 @@ import com.google.auto.value.AutoValue;
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
|
||||
<test-code>
|
||||
<description>FN with nested class</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<expected-linenumbers>1</expected-linenumbers>
|
||||
<code><![CDATA[
|
||||
abstract class Foo {
|
||||
|
||||
class Inner {
|
||||
void ohio() {}
|
||||
}
|
||||
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>FN with nested class</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<expected-linenumbers>3</expected-linenumbers>
|
||||
<code><![CDATA[
|
||||
class Foo {
|
||||
|
||||
abstract class Pos {}
|
||||
|
||||
class Sibling {
|
||||
void ohio() {}
|
||||
}
|
||||
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
Reference in new issue
Block a user