Skip to content

Commit 3ce0224

Browse files
SteLeo1602romani
authored andcommitted
Issue #17225: Continue to extend 'Since version' javadoc marking implementation
1 parent 686ca93 commit 3ce0224

File tree

8 files changed

+23
-59
lines changed

8 files changed

+23
-59
lines changed

src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheck.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
* SortedMap, SortedSet, Stream, String, StringBuffer, StringBuilder, SuppressWarnings, Throwable,
100100
* TreeMap, TreeSet, UnsupportedOperationException, Void, boolean, byte, char, double,
101101
* float, int, long, short, var, void}.
102+
* Since version 5.7
102103
* </li>
103104
* <li>
104105
* Property {@code excludedPackages} - Specify user-configured packages to ignore.

src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheck.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
* SortedMap, SortedSet, Stream, String, StringBuffer, StringBuilder, SuppressWarnings, Throwable,
6767
* TreeMap, TreeSet, UnsupportedOperationException, Void, boolean, byte, char, double,
6868
* float, int, long, short, var, void}.
69+
* Since version 5.7
6970
* </li>
7071
* <li>
7172
* Property {@code excludedPackages} - Specify user-configured packages to ignore.

src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheck.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,25 @@
3737
* Property {@code applyToPackage} - Control if check should apply to package-private members.
3838
* Type is {@code boolean}.
3939
* Default value is {@code true}.
40+
* Since version 5.0
4041
* </li>
4142
* <li>
4243
* Property {@code applyToPrivate} - Control if check should apply to private members.
4344
* Type is {@code boolean}.
4445
* Default value is {@code true}.
46+
* Since version 5.0
4547
* </li>
4648
* <li>
4749
* Property {@code applyToProtected} - Control if check should apply to protected members.
4850
* Type is {@code boolean}.
4951
* Default value is {@code true}.
52+
* Since version 5.0
5053
* </li>
5154
* <li>
5255
* Property {@code applyToPublic} - Control if check should apply to public members.
5356
* Type is {@code boolean}.
5457
* Default value is {@code true}.
58+
* Since version 5.0
5559
* </li>
5660
* <li>
5761
* Property {@code format} - Sets the pattern to match valid identifiers.

src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheck.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,25 @@
3232
* Property {@code applyToPackage} - Control if check should apply to package-private members.
3333
* Type is {@code boolean}.
3434
* Default value is {@code true}.
35+
* Since version 3.4
3536
* </li>
3637
* <li>
3738
* Property {@code applyToPrivate} - Control if check should apply to private members.
3839
* Type is {@code boolean}.
3940
* Default value is {@code true}.
41+
* Since version 3.4
4042
* </li>
4143
* <li>
4244
* Property {@code applyToProtected} - Control if check should apply to protected members.
4345
* Type is {@code boolean}.
4446
* Default value is {@code true}.
47+
* Since version 3.4
4548
* </li>
4649
* <li>
4750
* Property {@code applyToPublic} - Control if check should apply to public members.
4851
* Type is {@code boolean}.
4952
* Default value is {@code true}.
53+
* Since version 3.4
5054
* </li>
5155
* <li>
5256
* Property {@code format} - Sets the pattern to match valid identifiers.

src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheck.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,25 @@
4848
* Property {@code applyToPackage} - Control if check should apply to package-private members.
4949
* Type is {@code boolean}.
5050
* Default value is {@code true}.
51+
* Since version 5.1
5152
* </li>
5253
* <li>
5354
* Property {@code applyToPrivate} - Control if check should apply to private members.
5455
* Type is {@code boolean}.
5556
* Default value is {@code true}.
57+
* Since version 5.1
5658
* </li>
5759
* <li>
5860
* Property {@code applyToProtected} - Control if check should apply to protected members.
5961
* Type is {@code boolean}.
6062
* Default value is {@code true}.
63+
* Since version 5.1
6164
* </li>
6265
* <li>
6366
* Property {@code applyToPublic} - Control if check should apply to public members.
6467
* Type is {@code boolean}.
6568
* Default value is {@code true}.
69+
* Since version 5.1
6670
* </li>
6771
* <li>
6872
* Property {@code format} - Sets the pattern to match valid identifiers.

src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheck.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,26 @@
3333
* members.
3434
* Type is {@code boolean}.
3535
* Default value is {@code true}.
36+
* Since version 5.0
3637
* </li>
3738
* <li>
3839
* Property {@code applyToPrivate} - Control if check should apply to private members.
3940
* Type is {@code boolean}.
4041
* Default value is {@code true}.
42+
* Since version 5.0
4143
* </li>
4244
* <li>
4345
* Property {@code applyToProtected} - Control if check should apply to protected
4446
* members.
4547
* Type is {@code boolean}.
4648
* Default value is {@code true}.
49+
* Since version 5.0
4750
* </li>
4851
* <li>
4952
* Property {@code applyToPublic} - Control if check should apply to public members.
5053
* Type is {@code boolean}.
5154
* Default value is {@code true}.
55+
* Since version 5.0
5256
* </li>
5357
* <li>
5458
* Property {@code format} - Sets the pattern to match valid identifiers.

src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheck.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,26 @@
3232
* members.
3333
* Type is {@code boolean}.
3434
* Default value is {@code true}.
35+
* Since version 5.0
3536
* </li>
3637
* <li>
3738
* Property {@code applyToPrivate} - Control if check should apply to private members.
3839
* Type is {@code boolean}.
3940
* Default value is {@code true}.
41+
* Since version 5.0
4042
* </li>
4143
* <li>
4244
* Property {@code applyToProtected} - Control if check should apply to protected
4345
* members.
4446
* Type is {@code boolean}.
4547
* Default value is {@code true}.
48+
* Since version 5.0
4649
* </li>
4750
* <li>
4851
* Property {@code applyToPublic} - Control if check should apply to public members.
4952
* Type is {@code boolean}.
5053
* Default value is {@code true}.
54+
* Since version 5.0
5155
* </li>
5256
* <li>
5357
* Property {@code format} - Sets the pattern to match valid identifiers.

src/main/java/com/puppycrawl/tools/checkstyle/site/SiteUtil.java

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -175,59 +175,6 @@ public final class SiteUtil {
175175
"CustomImportOrderCheck.customImportOrderRules"
176176
);
177177

178-
/**
179-
* Frequent version.
180-
*/
181-
private static final String VERSION_5_0 = "5.0";
182-
183-
/**
184-
* Frequent version.
185-
*/
186-
private static final String VERSION_5_7 = "5.7";
187-
188-
/**
189-
* Frequent version.
190-
*/
191-
private static final String VERSION_5_1 = "5.1";
192-
193-
/**
194-
* Frequent version.
195-
*/
196-
private static final String VERSION_3_4 = "3.4";
197-
198-
/**
199-
* Map of properties whose since version is different from module version but
200-
* are not specified in code because they are inherited from their super class(es).
201-
* Until <a href="https://github.com/checkstyle/checkstyle/issues/14052">#14052</a>.
202-
*
203-
* @noinspectionreason JavacQuirks until #14052
204-
*/
205-
private static final Map<String, String> SINCE_VERSION_FOR_INHERITED_PROPERTY = Map.ofEntries(
206-
Map.entry("ClassDataAbstractionCouplingCheck.excludedClasses", VERSION_5_7),
207-
Map.entry("ClassFanOutComplexityCheck.excludedClasses", VERSION_5_7),
208-
// until https://github.com/checkstyle/checkstyle/issues/14052
209-
Map.entry("StaticVariableNameCheck.applyToPackage", VERSION_5_0),
210-
Map.entry("StaticVariableNameCheck.applyToPrivate", VERSION_5_0),
211-
Map.entry("StaticVariableNameCheck.applyToProtected", VERSION_5_0),
212-
Map.entry("StaticVariableNameCheck.applyToPublic", VERSION_5_0),
213-
Map.entry("TypeNameCheck.applyToPackage", VERSION_5_0),
214-
Map.entry("TypeNameCheck.applyToPrivate", VERSION_5_0),
215-
Map.entry("TypeNameCheck.applyToProtected", VERSION_5_0),
216-
Map.entry("TypeNameCheck.applyToPublic", VERSION_5_0),
217-
Map.entry("ConstantNameCheck.applyToPackage", VERSION_5_0),
218-
Map.entry("ConstantNameCheck.applyToPrivate", VERSION_5_0),
219-
Map.entry("ConstantNameCheck.applyToProtected", VERSION_5_0),
220-
Map.entry("ConstantNameCheck.applyToPublic", VERSION_5_0),
221-
Map.entry("MemberNameCheck.applyToPackage", VERSION_3_4),
222-
Map.entry("MemberNameCheck.applyToPrivate", VERSION_3_4),
223-
Map.entry("MemberNameCheck.applyToProtected", VERSION_3_4),
224-
Map.entry("MemberNameCheck.applyToPublic", VERSION_3_4),
225-
Map.entry("MethodNameCheck.applyToPackage", VERSION_5_1),
226-
Map.entry("MethodNameCheck.applyToPrivate", VERSION_5_1),
227-
Map.entry("MethodNameCheck.applyToProtected", VERSION_5_1),
228-
Map.entry("MethodNameCheck.applyToPublic", VERSION_5_1)
229-
);
230-
231178
/** Map of all superclasses properties and their javadocs. */
232179
private static final Map<String, DetailNode> SUPER_CLASS_PROPERTIES_JAVADOCS =
233180
new HashMap<>();
@@ -755,15 +702,10 @@ public static String getSinceVersion(String moduleName, DetailNode moduleJavadoc
755702
throws MacroExecutionException {
756703
final String sinceVersion;
757704

758-
final String hardCodedPropertyVersion = SINCE_VERSION_FOR_INHERITED_PROPERTY.get(
759-
moduleName + DOT + propertyName);
760705
final Optional<String> specifiedPropertyVersion =
761706
getSpecifiedPropertyVersion(propertyName, moduleJavadoc);
762707

763-
if (hardCodedPropertyVersion != null) {
764-
sinceVersion = hardCodedPropertyVersion;
765-
}
766-
else if (specifiedPropertyVersion.isPresent()) {
708+
if (specifiedPropertyVersion.isPresent()) {
767709
sinceVersion = specifiedPropertyVersion.get();
768710
}
769711
else {

0 commit comments

Comments
 (0)