Skip to content

Issue #17674: remove supression#18503

Merged
romani merged 1 commit into
masterfrom
i17674-2
Jan 4, 2026
Merged

Issue #17674: remove supression#18503
romani merged 1 commit into
masterfrom
i17674-2

Conversation

@romani

@romani romani commented Jan 4, 2026

Copy link
Copy Markdown
Member

fixes #17674

@romani

romani commented Jan 4, 2026

Copy link
Copy Markdown
Member Author
<problems is_local_tool="true">
<problem>
<file>
file://$PROJECT_DIR$/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java
</file>
<line>345</line>
<module>project</module>
<package>com.puppycrawl.tools.checkstyle.checks.annotation</package>
<entry_point TYPE="method" FQNAME="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck void checkStyleType(com.puppycrawl.tools.checkstyle.api.DetailAST annotation)"/>
<problem_class id="EnumSwitchStatementWhichMissesCases" severity="ERROR" attribute_key="ERRORS_ATTRIBUTES">Enum 'switch' statement that misses case</problem_class>
<description>
<code>switch (elementStyle) { case COMPACT_NO_ARRAY -> checkCompactNoArrayStyle(annotation); ...</code> statement on enum type 'com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck.ElementStyleOption' misses case 'IGNORE' #loc
</description>
<highlighted_element>
switch (elementStyle) { case COMPACT_NO_ARRAY -> checkCompactNoArrayStyle(annotation); ...
</highlighted_element>
<language>JAVA</language>
<offset>8</offset>
<length>297</length>
</problem>
</problems>

this is from EnumSwitchStatementWhichMissesCases inspection.

If I add it
I got another violation from Inspection that Idea suggest to remove newly added case or suppress @SuppressWarnings("DuplicateBranchesInSwitch")

removal of default cause checkstyle violation that default is required.
removed "default ->" does not cause compile error, so CS violation is right.

@romani romani force-pushed the i17674-2 branch 2 times, most recently from f7808af to e4d0d43 Compare January 4, 2026 15:25
@romani

romani commented Jan 4, 2026

Copy link
Copy Markdown
Member Author

and without default
there is error from eclipse.

---------- 00:14
1. ERROR in /home/semaphore/checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java (at line 346) 00:14
	switch (elementStyle) { 00:14
	        ^^^^^^^^^^^^ 00:14
The switch over the enum type AnnotationUseStyleCheck.ElementStyleOption should have a default case 00:14

@romani romani merged commit 9e3599a into master Jan 4, 2026
103 of 120 checks passed
@romani romani deleted the i17674-2 branch January 4, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conversion to Enhance Switch for AnnotationUseStyle Check Causing Jacoco Coverage Issue

1 participant