Skip to content

Issue #19734: Added checks for OpenJDK Style §3.3.1 - Wildcard Imports#19735

Merged
romani merged 1 commit into
checkstyle:masterfrom
Anushreebasics:3.3.1
Jun 7, 2026
Merged

Issue #19734: Added checks for OpenJDK Style §3.3.1 - Wildcard Imports#19735
romani merged 1 commit into
checkstyle:masterfrom
Anushreebasics:3.3.1

Conversation

@Anushreebasics

Copy link
Copy Markdown
Contributor

fixes #19734

Implements OpenJDK Style §3.3.1 (Wildcard Imports) for issue #19734.

This PR adds AvoidStarImport to OpenJDK config, updates OpenJDK style coverage docs, and adds integration tests for both regular and static wildcard imports.

Parent umbrella issue: #19604

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@vivek-0509 please review

Comment on lines +2 to +5

import java.util.*; // violation '.*form of import should be avoided.*'
import static java.lang.Math.*; // violation '.*form of import should be avoided.*'

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.

Using the '.*' form of import should be avoided

use this as violation message and do not put .* at last, also do add more imports in this that are not star imports

Comment on lines +37 to +41

@Test
public void avoidStarImportValidTest() throws Exception {
verifyWithWholeConfig(getPath("InputWildcardImportsValid.java"));
}

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.

we do not need this, rather add valid imports in the same file which has star imports take reference from google style

@Anushreebasics Anushreebasics force-pushed the 3.3.1 branch 2 times, most recently from b5989f3 to 2b6fdfb Compare April 22, 2026 14:47
@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@vivek-0509 please review

@vivek-0509

Copy link
Copy Markdown
Member

Github, generate website

@vivek-0509 vivek-0509 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.

LGTM
@romani Please take a look

@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.

blocking this as start imports are allowed and Check need to be improved before used in this style guide

@Anushreebasics Anushreebasics force-pushed the 3.3.1 branch 11 times, most recently from 074cd5f to 96e0a33 Compare April 25, 2026 06:04
@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@vivek-0509 please review

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@vivek-0509 please review

@romani

romani commented Apr 28, 2026

Copy link
Copy Markdown
Member

as new property is required, lets do just new property at scope of #19496

and then add it style guide in scope of this PR.

I am blocking this PR until new property is added.

@romani romani added the blocked label Apr 28, 2026
@Aman-Baliyan

Copy link
Copy Markdown
Contributor

as new property is required, lets do just new property at scope of #19496

and then add it style guide in scope of this PR.

I am blocking this PR until new property is added.

@romani the new property is merged please remove the blocked label

@romani romani removed the blocked label May 19, 2026
@romani

romani commented May 19, 2026

Copy link
Copy Markdown
Member

blocker label is removed.

@Anushreebasics , do you have time to finish update ?
it is ok to abandon PR, to let @Aman-Baliyan finish.

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@romani thank you, I will finish it

Comment thread src/site/xdoc/openjdk_style.xml Outdated
@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@Aman-Baliyan pls review

@Aman-Baliyan

Aman-Baliyan commented May 31, 2026

Copy link
Copy Markdown
Contributor

Last one :

Plese fix this ci failure ->

ERROR] Tests run: 18, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 42.02 s <<< FAILURE! -- in com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest
[ERROR] com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.testOpenJdkStyleRules -- Time elapsed: 0.039 s <<< FAILURE!
openjdk_style.xml rule 'Formatting' is missing sample link
expected to be false
	at com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.validateOpenJdkStyleSamples(XdocsPagesTest.java:2569)
	at com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.validateOpenJdkStyleModules(XdocsPagesTest.java:2533)
	at com.puppycrawl.tools.checkstyle.internal.XdocsPagesTest.testOpenJdkStyleRules(XdocsPagesTest.java:2461)


@Aman-Baliyan

Copy link
Copy Markdown
Contributor

And make a single commit

@Anushreebasics Anushreebasics force-pushed the 3.3.1 branch 2 times, most recently from 9effe99 to d3e2395 Compare May 31, 2026 16:06
@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@Aman-Baliyan pls review

Comment thread src/site/xdoc/openjdk_style.xml Outdated
@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@Aman-Baliyan pls review the changes

@Anushreebasics Anushreebasics force-pushed the 3.3.1 branch 2 times, most recently from f37c0c4 to c3b0a69 Compare June 1, 2026 09:12

@Aman-Baliyan Aman-Baliyan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ready to merge

@Aman-Baliyan

Copy link
Copy Markdown
Contributor

@romani ping

@Aman-Baliyan

Copy link
Copy Markdown
Contributor

Github, generate site

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@Aman-Baliyan

Copy link
Copy Markdown
Contributor

@Aman-Baliyan could you pls help me resolve this CI failure: https://dev.azure.com/romanivanovjr/romanivanovjr/_build/results?buildId=42489&view=logs&j=23a36c3d-5ffa-5070-05d6-edc73e064208&t=e897831a-50c7-5d42-b05f-b6cc4fc690b4

this ci failure is not from your pr it is something else

@Anushreebasics

Copy link
Copy Markdown
Contributor Author

@romani pls merge this PR

@Aman-Baliyan

Copy link
Copy Markdown
Contributor

@romani ping

@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

@romani romani merged commit ff3a849 into checkstyle:master Jun 7, 2026
125 of 128 checks passed
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.

Add checks for OpenJDK Style - Wildcard Imports

4 participants