|
72 | 72 | <value><![CDATA[ |
73 | 73 | //ClassOrInterfaceBodyDeclaration[Annotation[pmd-java:typeIs('javafx.fxml.FXML')]] |
74 | 74 | /FieldDeclaration/VariableDeclarator/VariableDeclaratorId |
75 | | - [not(ends-with(@Image, ../../Type/@TypeImage))] |
| 75 | + [not(ends-with(@Name, ../../Type/@TypeImage))] |
76 | 76 |
|
77 | 77 | (: 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'))] |
86 | 86 | (: This last clause allows variables to be named the same as their type, modulo Camel case :) |
87 | 87 | (: Ideally we would only allow this for our custom types, but there's currently no easy :) |
88 | 88 | (: way to get the type name of a node to check the package. :) |
89 | 89 | (: 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))] |
92 | 92 | ]]></value> |
93 | 93 | </property> |
94 | 94 | </properties> |
|
0 commit comments