Skip to content

Commit 848f1e2

Browse files
committed
Fix deprecation waring in custom rule
1 parent a9adefb commit 848f1e2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

config/pmd-check.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,23 @@
7272
<value><![CDATA[
7373
//ClassOrInterfaceBodyDeclaration[Annotation[pmd-java:typeIs('javafx.fxml.FXML')]]
7474
/FieldDeclaration/VariableDeclarator/VariableDeclaratorId
75-
[not(ends-with(@Image, ../../Type/@TypeImage))]
75+
[not(ends-with(@Name, ../../Type/@TypeImage))]
7676
7777
(: The following are the exceptions to the rule :)
78-
[not(ends-with(@Image, 'Controller') and ends-with(../../Type/@TypeImage, 'Controller'))]
79-
[not(../../Type/@TypeImage = 'TextField' and ends-with(@Image, 'Field'))]
80-
[not(../../Type/@TypeImage = 'ToggleButton' and ends-with(@Image, 'Toggle'))]
81-
[not(../../Type/@TypeImage = 'TextArea' or ends-with(../../Type/@TypeImage, 'CodeArea') and ends-with(@Image, 'Area'))]
82-
[not(../../Type/@TypeImage = 'TableColumn' and ends-with(@Image, 'Column'))]
83-
[not(../../Type/@TypeImage = 'MenuItem' and ends-with(@Image, 'Button'))]
84-
[not(ends-with(../../Type/@TypeImage, 'Choicebox') and ends-with(@Image, 'Choicebox'))]
85-
[not(ends-with(../../Type/@TypeImage, 'TitledPane') and ends-with(@Image, 'Pane'))]
78+
[not(ends-with(@Name, 'Controller') and ends-with(../../Type/@TypeImage, 'Controller'))]
79+
[not(../../Type/@TypeImage = 'TextField' and ends-with(@Name, 'Field'))]
80+
[not(../../Type/@TypeImage = 'ToggleButton' and ends-with(@Name, 'Toggle'))]
81+
[not(../../Type/@TypeImage = 'TextArea' or ends-with(../../Type/@TypeImage, 'CodeArea') and ends-with(@Name, 'Area'))]
82+
[not(../../Type/@TypeImage = 'TableColumn' and ends-with(@Name, 'Column'))]
83+
[not(../../Type/@TypeImage = 'MenuItem' and ends-with(@Name, 'Button'))]
84+
[not(ends-with(../../Type/@TypeImage, 'Choicebox') and ends-with(@Name, 'Choicebox'))]
85+
[not(ends-with(../../Type/@TypeImage, 'TitledPane') and ends-with(@Name, 'Pane'))]
8686
(: This last clause allows variables to be named the same as their type, modulo Camel case :)
8787
(: Ideally we would only allow this for our custom types, but there's currently no easy :)
8888
(: way to get the type name of a node to check the package. :)
8989
(: We should create a function for that, eg typeNameOf :)
90-
[not(string-length(../../Type/@TypeImage) = string-length(@Image)
91-
and substring(../../Type/@TypeImage, 2) = substring(@Image, 2))]
90+
[not(string-length(../../Type/@TypeImage) = string-length(@Name)
91+
and substring(../../Type/@TypeImage, 2) = substring(@Name, 2))]
9292
]]></value>
9393
</property>
9494
</properties>

0 commit comments

Comments
 (0)