Skip to content

Skip unnecessary source level queries where possible - #9697

Open
mbien wants to merge 1 commit into
apache:masterfrom
mbien:skip-maven-sourcelevel-queries
Open

mbien wants to merge 1 commit into
apache:masterfrom
mbien:skip-maven-sourcelevel-queries

Conversation

@mbien

@mbien mbien commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Run javac profile queries only for java 8 targets which is the only java version where profiles existed.

Skip over query code in MavenSourceLevelImpl if the result value is already known. Add fast path for files outside of test dirs.

@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) performance Maven [ci] enable "build tools" tests labels Oct 10, 2026
@neilcsmith-net

Copy link
Copy Markdown
Member

Generally looks good.

Add fast path for files outside of test dirs.

Is there much difference with the fast path? Do we support custom paths elsewhere anyway? eg. assuming the path contains "test" might reach edge cases with things like https://maven.apache.org/whatsnewinmaven4.html#new-way-to-declare-source-directories ??

@mbien

mbien commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

if you take a look at getSourceRoots and getGeneratedSourceRoots which are both called from within the if block. They build the path with /test/. So its already a given that test must be in the path.

@neilcsmith-net

neilcsmith-net commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

I already looked at them. Are you sure getSourceRoots does that for the paths reported by Maven itself? It does for JavaLikeRootProvider results.

Run javac profile queries only for java 8 targets which is the only
java version where profiles existed.

Skip over query code in MavenSourceLevelImpl if the result value is
already known.
@mbien
mbien force-pushed the skip-maven-sourcelevel-queries branch from 52ae3e5 to 648ab58 Compare October 10, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) Maven [ci] enable "build tools" tests performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants