[java] Fix rule tests after merge

This commit is contained in:
Andreas Dangel committed 2022-11-25 19:43:17 +01:00
1 parent fc05c9fef1
commit f7608332df
1 file changed
+9 -10
@@ -2335,24 +2335,23 @@ See the property `annotations`.
<property name="xpath">
<value>
<![CDATA[
//TypeDeclaration
[Annotation[pmd-java:typeIs('lombok.experimental.UtilityClass')]]
[ClassOrInterfaceDeclaration/ClassOrInterfaceBody
//ClassOrInterfaceDeclaration
[pmd-java:hasAnnotation('lombok.experimental.UtilityClass')]
[ClassOrInterfaceBody
[
(: no methods :)
not(ClassOrInterfaceBodyDeclaration/MethodDeclaration)
not(MethodDeclaration)
or
(: only private methods :)
count(ClassOrInterfaceBodyDeclaration/MethodDeclaration) = count(ClassOrInterfaceBodyDeclaration/MethodDeclaration[@Private=true()])
count(MethodDeclaration) = count(MethodDeclaration[@Private=true()])
]
]
|
//TypeDeclaration
//ClassOrInterfaceDeclaration[@Nested= false() and @Local= false()]
(: no lombok constructor annotations :)
[not(Annotation[pmd-java:typeIs('lombok.NoArgsConstructor') or
pmd-java:typeIs('lombok.RequiredArgsConstructor') or
pmd-java:typeIs('lombok.AllArgsConstructor')])]
/ClassOrInterfaceDeclaration[@Nested= false() and @Local= false()]
[not(pmd-java:hasAnnotation('lombok.NoArgsConstructor') or
pmd-java:hasAnnotation('lombok.RequiredArgsConstructor') or
pmd-java:hasAnnotation('lombok.AllArgsConstructor'))]
[
(: at least one constructor :) ./ClassOrInterfaceBody/ConstructorDeclaration
and