From 6bc45a8eda884eeadd97dfb9c75fc3789c959b47 Mon Sep 17 00:00:00 2001 From: Konstantinos Koutsilis Date: Tue, 24 Dec 2024 17:20:12 +0200 Subject: [PATCH] Issue #9280: New property 'accessModifiers' as substitution of 'scope' and 'excludeScope' in JavadocVariableCheck --- .../checks/javadoc/JavadocVariableCheck.java | 130 ++++++++---- .../checks/naming/AccessModifierOption.java | 11 ++ .../checks/javadoc/JavadocVariableCheck.xml | 13 +- .../javadoc/JavadocVariableCheckTest.java | 186 +++++++++--------- .../InputJavadocVariableInner.java | 4 +- .../InputJavadocVariableInner2.java | 4 +- ...cVariableInterfaceMemberScopeIsPublic.java | 4 +- .../InputJavadocVariableNoJavadoc2.java | 4 +- .../InputJavadocVariableNoJavadoc3.java | 4 +- .../InputJavadocVariableNoJavadoc4.java | 4 +- .../InputJavadocVariableNoJavadoc5.java | 4 +- ...avadocVariableNoJavadocNeededInLambda.java | 4 +- ...nputJavadocVariableOnInnerClassFields.java | 3 +- ...vadocVariableOnPublicInnerClassFields.java | 4 +- .../InputJavadocVariablePublicOnly.java | 4 +- .../InputJavadocVariablePublicOnly2.java | 4 +- .../InputJavadocVariableTags.java | 4 +- .../JavadocVariableCheckExamplesTest.java | 4 +- .../javadoc/javadocvariable/Example2.java | 2 +- .../javadoc/javadocvariable/Example3.java | 3 +- src/xdocs/checks/javadoc/javadocvariable.xml | 35 ++-- .../javadoc/javadocvariable.xml.template | 13 +- 22 files changed, 238 insertions(+), 210 deletions(-) diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java index df40b49a0f2..e7405de58c6 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java @@ -19,15 +19,17 @@ package com.puppycrawl.tools.checkstyle.checks.javadoc; +import com.puppycrawl.tools.checkstyle.utils.CheckUtil; +import java.util.Arrays; import java.util.regex.Pattern; import com.puppycrawl.tools.checkstyle.StatelessCheck; import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.FileContents; -import com.puppycrawl.tools.checkstyle.api.Scope; import com.puppycrawl.tools.checkstyle.api.TextBlock; import com.puppycrawl.tools.checkstyle.api.TokenTypes; +import com.puppycrawl.tools.checkstyle.checks.naming.AccessModifierOption; import com.puppycrawl.tools.checkstyle.utils.ScopeUtil; /** @@ -36,10 +38,10 @@ * *