Skip to content

Issue #18092: Add -i flag to compilation jobs in CircleCI#18094

Merged
romani merged 1 commit into
checkstyle:masterfrom
stoyanK7:18092
Nov 14, 2025
Merged

Issue #18092: Add -i flag to compilation jobs in CircleCI#18094
romani merged 1 commit into
checkstyle:masterfrom
stoyanK7:18092

Conversation

@stoyanK7

Copy link
Copy Markdown
Collaborator

Resolves issue

Added -i grep flag to all javacX jobs.

@stoyanK7

stoyanK7 commented Nov 14, 2025

Copy link
Copy Markdown
Collaborator Author

Part of InputMissingSwitchDefaultCaseLabelElements.java is not compilable according to CI??:

src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:33: error: : or -> expected
            case Object o1 && o1.toString().length() > 2:
                          ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:33: error: illegal start of expression
            case Object o1 && o1.toString().length() > 2:
                           ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:33: error: ';' expected
            case Object o1 && o1.toString().length() > 2:
                                                        ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:36: error: : or -> expected
            case Object o1 && o1.toString().length() <= 2:
                          ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:36: error: illegal start of expression
            case Object o1 && o1.toString().length() <= 2:
                           ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:36: error: ';' expected
            case Object o1 && o1.toString().length() <= 2:
                                                         ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:55: error: : or -> expected
            case String s && s.length() > 2 ->
                         ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:55: error: illegal start of expression
            case String s && s.length() > 2 ->
                          ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:55: error: ';' expected
            case String s && s.length() > 2 ->
                                           ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:61: error: default label not allowed here
            case default, null ->
                 ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:66: error: default label not allowed here
            case default, null:
                 ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:84: error: default label not allowed here
            case default: break;
                 ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/checks/coding/missingswitchdefault/InputMissingSwitchDefaultCaseLabelElements.java:88: error: default label not allowed here
            case default -> {}
                 ^
13 errors

Exited with code exit status 1

@stoyanK7

Copy link
Copy Markdown
Collaborator Author

I'm getting different output locally:

$ java --version
java 22.0.2 2024-07-16
Java(TM) SE Runtime Environment (build 22.0.2+9-70)
Java HotSpot(TM) 64-Bit Server VM (build 22.0.2+9-70, mixed mode, sharing)

$ javac --version
javac 22.0.2

$ ./.ci/validation.sh javac22
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/antlr4/InputAntlr4AstRegressionPatternsInIfStatement.java:15: error: illegal start of type
        if (o instanceof (String s && s.length() > 4)) { // parenthesized pattern, `PATTERN_DEF`
                         ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/antlr4/InputAntlr4AstRegressionPatternsInIfStatement.java:15: error: ')' expected
        if (o instanceof (String s && s.length() > 4)) { // parenthesized pattern, `PATTERN_DEF`
                                  ^
src/test/resources-noncompilable/com/puppycrawl/tools/checkstyle/grammar/antlr4/InputAntlr4AstRegressionPatternsInIfStatement.java:15: error: illegal start of expression
        if (o instanceof (String s && s.length() > 4)) { // parenthesized pattern, `PATTERN_DEF`

@romani

romani commented Nov 14, 2025

Copy link
Copy Markdown
Member

please add java --version to validation.sh jobs. looks like we running into difference of compilers. It will be good to have such prints in logs.
it is possible as feature is in preview, so there might be some differences.

can you try upper jdks 23,24,25 ? to see if we can get consistent behavior.

if no luck, CI state is more in priority. lets remove compilation comment from such input (we can create separate issue for this) to not block this PR. it will help us to resolve problems separetely.

@stoyanK7

stoyanK7 commented Nov 14, 2025

Copy link
Copy Markdown
Collaborator Author

Nevermind, it's not a compiler mismatch at all. The ordering of the files differs between local and CI. The job stops on the first compilation failure it sees, therefore different output. I also cannot compile InputMissingSwitchDefaultCaseLabelElements locally and get the same errors as CI.

There are actually 7 files marked as compilable with java22, but do not compile.

I will open a separate issue for those and mark them with // non-compiled with javac: until https://github.com/checkstyle/checkstyle/issues/....

EDIT: Created issue:

@stoyanK7 stoyanK7 marked this pull request as ready for review November 14, 2025 16:35

@romani romani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot.

Even we we are draconic in review, bad stuff still leaking

@romani romani merged commit f895976 into checkstyle:master Nov 14, 2025
121 of 122 checks passed
@stoyanK7 stoyanK7 deleted the 18092 branch November 14, 2025 17:02
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.

2 participants