You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<rulename="OnlyOneConstructorShouldDoInitialization"message="Avoid field initialization in several constructors."language="java"class="net.sourceforge.pmd.lang.rule.XPathRule">
117
118
<description>
118
-
Avoid doing field initialization in several constructors.
119
-
Only one main constructor should do real work.
120
-
Other constructors should delegate initialization to it.
121
-
</description>
119
+
Avoid doing field initialization in several constructors.
120
+
Only one main constructor should do real work.
121
+
Other constructors should delegate initialization to it.
<rulename="ConstructorOnlyInitializesOrCallOtherConstructors"message="Only field initialization or call to other constructors in a constructor."language="java"class="net.sourceforge.pmd.lang.rule.XPathRule">
133
134
<description>
134
-
Avoid putting anything other than field assignments into constructors.
135
-
The only exception should be calling other constructors
136
-
or calling super class constructor.
137
-
</description>
135
+
Avoid putting anything other than field assignments into constructors.
136
+
The only exception should be calling other constructors
<rulename="StaticAccessToStaticFields"message="Static fields should be accessed in a static way [CLASS_NAME.FIELD_NAME]."language="java"class="net.sourceforge.pmd.lang.rule.XPathRule">
<rulename="ProhibitPublicStaticMethods"message="Public static methods are prohibited."language="java"class="net.sourceforge.pmd.lang.rule.XPathRule">
161
162
<description>
162
-
Public static methods are prohibited.
163
-
</description>
163
+
Public static methods are prohibited.
164
+
</description>
164
165
<priority>3</priority>
165
166
<properties>
166
167
<propertyname="xpath">
167
168
<value><![CDATA[
168
-
//ClassOrInterfaceBodyDeclaration[
169
-
MethodDeclaration[@Static='true' and @Public='true'
170
-
and not (
171
-
MethodDeclarator[
172
-
count(FormalParameters/FormalParameter)=1
173
-
and @Image='main'
174
-
and FormalParameters/FormalParameter[1]/Type/ReferenceType/ClassOrInterfaceType[@Image='String']
175
-
and FormalParameters/FormalParameter[@Varargs='true']
176
-
] and not(ResultType/Type)
177
-
)
178
-
] and (
179
-
Annotation/MarkerAnnotation/Name[@Image!='BeforeClass' and @Image!='AfterClass'
180
-
and @Image!='Parameterized.Parameters']
181
-
or not (Annotation)
182
-
)
183
-
]
184
-
]]></value>
169
+
//ClassOrInterfaceBodyDeclaration[
170
+
MethodDeclaration[@Static='true' and @Public='true'
171
+
and not (
172
+
MethodDeclarator[
173
+
count(FormalParameters/FormalParameter)=1
174
+
and @Image='main'
175
+
and FormalParameters/FormalParameter[1]/Type/ReferenceType/ClassOrInterfaceType[@Image='String']
176
+
and FormalParameters/FormalParameter[@Varargs='true']
177
+
] and not(ResultType/Type)
178
+
)
179
+
] and (
180
+
Annotation/MarkerAnnotation/Name[@Image!='BeforeClass' and @Image!='AfterClass'
181
+
and @Image!='Parameterized.Parameters']
182
+
or not (Annotation)
183
+
)
184
+
]
185
+
]]></value>
185
186
</property>
186
187
</properties>
187
188
</rule>
188
189
<rulename="ProhibitFilesCreateFileInTests"message="Files.createFile should not be used in tests, replace them with @Rule TemporaryFolder"language="java"class="net.sourceforge.pmd.lang.rule.XPathRule">
<rulename="ReturnEmptyCollectionRatherThanNull"language="java"class="net.sourceforge.pmd.lang.rule.XPathRule"message="Returned null collection was found (NullCollection).">
202
203
<description>
203
-
Any method that returns an collection (i.e. an array or a List), it is better to return
204
-
an empty one rather than a null reference.
205
-
</description>
204
+
Any method that returns an collection (i.e. an array or a List), it is better to return
0 commit comments