Skip to content

Commit 973ead8

Browse files
committed
Small style changes; remove non-standard tags and PIID
1 parent a9a3744 commit 973ead8

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/main/java/org/infernus/idea/checkstyle/checker/CheckstyleQuickFixProvider.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
*
1414
* @author dong4j
1515
* @version 1.0.0
16-
* @email "mailto:dong4j@gmail.com"
17-
* @date 2026.01.20
1816
* @since 26.0.0
1917
*/
2018
public interface CheckstyleQuickFixProvider {

src/main/java/org/infernus/idea/checkstyle/checker/Problem.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public record Problem(@NotNull PsiElement target,
3636
@NotNull
3737
public ProblemDescriptor toProblemDescriptor(final InspectionManager inspectionManager,
3838
final boolean onTheFly) {
39-
String sourceCheck = DisplayFormats.shortenClassName(sourceName);
39+
final String sourceCheck = DisplayFormats.shortenClassName(sourceName);
4040
return inspectionManager.createProblemDescriptor(target,
4141
CheckStyleBundle.message("inspection.message", message, sourceCheck),
4242
quickFixes(sourceCheck), problemHighlightType(), onTheFly, afterEndOfLine);
@@ -52,7 +52,7 @@ public ProblemDescriptor toProblemDescriptor(final InspectionManager inspectionM
5252
* @param sourceCheck The source check name used to create a suppress fix, or {@code null} if not applicable
5353
* @return An array of {@link LocalQuickFix} instances, or {@code null} if no fixes are available
5454
*/
55-
private LocalQuickFix[] quickFixes(final String sourceCheck) {
55+
private LocalQuickFix @Nullable [] quickFixes(@Nullable final String sourceCheck) {
5656
List<LocalQuickFix> fixes = new ArrayList<>();
5757

5858
if (sourceCheck != null) {
@@ -72,12 +72,13 @@ private LocalQuickFix[] quickFixes(final String sourceCheck) {
7272
* @param fixes The list to which collected quick fixes will be added
7373
* @return An array of {@link LocalQuickFix} instances, or {@code null} if no fixes are available
7474
*/
75-
private LocalQuickFix @Nullable [] addLocalQuickFixes(List<LocalQuickFix> fixes) {
76-
Project project = target.getProject();
75+
@NotNull
76+
private LocalQuickFix @Nullable [] addLocalQuickFixes(@NotNull final List<LocalQuickFix> fixes) {
77+
final Project project = target.getProject();
7778
if (!project.isDisposed()) {
7879
try {
7980
for (CheckstyleQuickFixProvider provider : QUICK_FIX_PROVIDER_EP.getExtensions(project)) {
80-
LocalQuickFix[] providedFixes = provider.getQuickFixes(this);
81+
final LocalQuickFix[] providedFixes = provider.getQuickFixes(this);
8182
if (providedFixes != null && providedFixes.length > 0) {
8283
fixes.addAll(Arrays.asList(providedFixes));
8384
}
@@ -86,7 +87,11 @@ private LocalQuickFix[] quickFixes(final String sourceCheck) {
8687
// The extension point remains backward compatible when not available.
8788
}
8889
}
89-
return fixes.isEmpty() ? null : fixes.toArray(new LocalQuickFix[0]);
90+
91+
if (fixes.isEmpty()) {
92+
return null;
93+
}
94+
return fixes.toArray(new LocalQuickFix[0]);
9095
}
9196

9297
private ProblemHighlightType problemHighlightType() {

0 commit comments

Comments
 (0)