[java] Fix deprecated usage of ArgumentCount/ParameterCount in rules

This commit is contained in:
Andreas Dangel
2020-02-16 14:28:01 +01:00
parent da7596a027
commit 4ce85c4656
3 changed files with 9 additions and 6 deletions

View File

@ -1195,7 +1195,7 @@ should be annotated with @Test and @Ignore.
[not(Annotation)]
[MethodDeclaration[(@Public = true() or @PackagePrivate = true()) and @Static = false() and
ResultType[@Void = true()] and
MethodDeclarator/FormalParameters[@ParameterCount = 0]
MethodDeclarator/FormalParameters[@Size = 0]
]
]
]]></value>
@ -2854,7 +2854,7 @@ formatting is used.
<![CDATA[
//AllocationExpression
[ClassOrInterfaceType[@Image='SimpleDateFormat']]
[Arguments[@ArgumentCount=1]]
[Arguments[@Size=1]]
]]>
</value>
</property>
@ -3366,7 +3366,7 @@ To make sure the full stacktrace is printed out, use the logging statement with
concat(ancestor::ClassOrInterfaceDeclaration/ClassOrInterfaceBody/ClassOrInterfaceBodyDeclaration/FieldDeclaration
[Type//ClassOrInterfaceType[@Image='Log']]
/VariableDeclarator/VariableDeclaratorId/@Image, '.'))]]
[PrimarySuffix/Arguments[@ArgumentCount='1']]
[PrimarySuffix/Arguments[@Size='1']]
[PrimarySuffix/Arguments//Name/@Image = ancestor::CatchStatement/FormalParameter/VariableDeclaratorId/@Image]
]]>
</value>
@ -3482,13 +3482,13 @@ class Test {
[
PrimaryPrefix
[Name[ends-with(@Image, 'toLowerCase') or ends-with(@Image, 'toUpperCase')]]
[following-sibling::PrimarySuffix[position() = 1]/Arguments[@ArgumentCount=0]]
[following-sibling::PrimarySuffix[position() = 1]/Arguments[@Size=0]]
or
PrimarySuffix
[ends-with(@Image, 'toLowerCase') or ends-with(@Image, 'toUpperCase')]
[following-sibling::PrimarySuffix[position() = 1]/Arguments[@ArgumentCount=0]]
[following-sibling::PrimarySuffix[position() = 1]/Arguments[@Size=0]]
]
[not(PrimaryPrefix/Name[ends-with(@Image, 'toHexString')])]
]]>

View File

@ -379,7 +379,7 @@ one is chosen. The thread chosen is arbitrary; thus its usually safer to call n
<value>
<![CDATA[
//StatementExpression/PrimaryExpression
[PrimarySuffix/Arguments[@ArgumentCount = '0']]
[PrimarySuffix/Arguments[@Size = '0']]
[
PrimaryPrefix[
./Name[@Image='notify' or ends-with(@Image,'.notify')]