GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pmd/pmd-java/src/main/resources/category/java/documentation.xml at main · pmd/pmd

Expand file tree

/

documentation.xml

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
216 lines (200 loc) · 7.31 KB
/

documentation.xml

Copy path

File metadata and controls

216 lines (200 loc) · 7.31 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="Documentation"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>
Rules that are related to code documentation.
</description>
<rule name="CommentContent"
language="java"
since="5.0"
message="Invalid words or phrases found"
class="net.sourceforge.pmd.lang.java.rule.documentation.CommentContentRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_documentation.html#commentcontent">
<description>
A rule for the politically correct... we don't want to offend anyone.
</description>
<priority>3</priority>
<example>
<![CDATA[
//OMG, this is horrible, Bob is an idiot !!!
]]>
</example>
</rule>
<rule name="CommentRequired"
language="java"
since="5.1"
message="Comment is required"
class="net.sourceforge.pmd.lang.java.rule.documentation.CommentRequiredRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_documentation.html#commentrequired">
<description>
Denotes whether javadoc (formal) comments are required (or unwanted) for specific language elements.
</description>
<priority>3</priority>
<example>
<![CDATA[
/**
*
*
* @author Jon Doe
*/
]]>
</example>
</rule>
<rule name="CommentSize"
language="java"
since="5.0"
message="Comment is too large"
class="net.sourceforge.pmd.lang.java.rule.documentation.CommentSizeRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_documentation.html#commentsize">
<description>
Determines whether the dimensions of non-header comments found are within the specified limits.
</description>
<priority>3</priority>
<example>
<![CDATA[
public class Foo {
/*
* 1
* 2
* 3
* 4
* 5
* 6
* 7
*/
}
]]>
</example>
</rule>
<rule name="DanglingJavadoc"
language="java"
since="7.17.0"
message="Javadoc comment does not belong to any class, method or field"
class="net.sourceforge.pmd.lang.java.rule.documentation.DanglingJavadocRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_documentation.html#danglingjavadoc">
<description>
Javadoc comments that do not belong to a class, method or field are ignored by the JavaDoc tool
and don't end up in the generated API documentation. Such comments are either misplaced
(e.g. between annotations and method declaration) or should be block comments.
In order to fix this violation, the comment should be moved to the correct place,
converted into a block comment or removed completely.
</description>
<priority>3</priority>
<example>
<![CDATA[
public class Foo {
/**
* Public methods // wrong
*/
/**
* A setter // OK
*/
public void setFoo() {
}
}
]]>
</example>
</rule>
<rule name="MarkdownJavadocBeforeJava23"
language="java"
maximumLanguageVersion="22"
since="7.31.0"
message="Triple-slash comment changes meaning in Java 23"
class="net.sourceforge.pmd.lang.java.rule.documentation.MarkdownJavadocBeforeJava23Rule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_documentation.html#markdownjavadocbeforejava23">
<description>
Reports comments starting with `///` in projects targeting Java versions before Java 23.
These are ordinary comments in earlier versions, but become Markdown documentation comments
with [JEP 467](https://openjdk.org/jeps/467). When migrating to Java 23, they may unexpectedly
appear in generated API documentation or cause Javadoc errors.
Use this migration helper before changing the project's Java version. Convert documentation
that should already be published to `/** ... */`, and change implementation comments to `//`.
Comments starting with more than three slashes are also affected.
The rule reports the first line of each consecutive block, including comments that are not
attached to a declaration. It does not run for Java 23 or later.
</description>
<priority>3</priority>
<example>
<![CDATA[
// With Java 22 or earlier:
/// This becomes documentation in Java 23 -- reported
class Example {
/** Documentation that works in earlier Java versions -- OK */
void documented() {}
// An implementation comment -- OK
void method() {}
}
]]>
</example>
</rule>
<rule name="UncommentedEmptyConstructor"
language="java"
since="3.4"
message="Document empty constructor"
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_documentation.html#uncommentedemptyconstructor">
<description>
Uncommented Empty Constructor finds instances where a constructor does not
contain statements, but there is no comment. By explicitly commenting empty
constructors it is easier to distinguish between intentional (commented)
and unintentional empty constructors.
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//ConstructorDeclaration[@Visibility != "private"]
[not(
pmd-java:hasAnnotation('javax.inject.Inject')
or pmd-java:hasAnnotation('org.springframework.beans.factory.annotation.Autowired')
)]
[Block[
@containsComment = false()
and (count(*) = 0 or ($ignoreExplicitConstructorInvocation = true() and count(*) = 1 and ExplicitConstructorInvocation))
]]
]]>
</value>
</property>
<property name="ignoreExplicitConstructorInvocation" type="Boolean" description="Ignore explicit constructor invocation when deciding whether constructor is empty or not" value="false"/>
</properties>
<example>
<![CDATA[
public Foo() {
// This constructor is intentionally empty. Nothing special is needed here.
}
]]>
</example>
</rule>
<rule name="UncommentedEmptyMethodBody"
language="java"
since="3.4"
message="Document empty method body"
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_java_documentation.html#uncommentedemptymethodbody">
<description>
Uncommented Empty Method Body finds instances where a method body does not contain
statements, but there is no comment. By explicitly commenting empty method bodies
it is easier to distinguish between intentional (commented) and unintentional
empty methods.
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//MethodDeclaration/Block[count(*) = 0 and @containsComment = false()]
]]>
</value>
</property>
</properties>
<example>
<![CDATA[
public void doSomething() {
}
]]>
</example>
</rule>
</ruleset>
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.