Repository navigation
fix: Keep Spring inspections unavailable while the IDE indexes instead of throwing IndexNotReadyException (#688) - #694
Merged
Conversation
|
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
While the IDE indexes, Spring inspections log one
PluginException: Inspection tool '<name>' thrown exception from its buildVisitor()each (about 50 at once), caused byIndexNotReadyException:On IntelliJ 2026.2,
InspectionEngine.createVisitorturns any non-control-flow exception fromisAvailableForFileorbuildVisitorinto a loggedPluginException.LocalInspectionsPassdrops tools that are notDumbAwareonly when a pass starts, and other callers ofInspectionEnginedo not drop them at all, soisAvailableForFileof a Spring inspection can run while indexing. A project sync changes libraries and starts indexing at the same time, so the next availability check recomputesLibraryClassCachein dumb mode and throws.Change
InspectionAvailabilityinbase:isIndexReady(file)andhasLibraryClass(file, fqn), which answers "not available" while the IDE indexes before any index access.SpringBaseUastLocalInspectionTool,SpringBaseLocalInspectionTool) and the four overrides that do not callsuperfirst (SpringBoot3JakartaMigrationInspection,SpringDataBaseUastLocalInspectionTool,SpringWebBaseUastLocalInspectionTool,SpringJdbcClientParamInspection) use it. Overrides that callsuperfirst are covered by the base classes. No inspection isDumbAware, so availability in smart mode is unchanged; the platform restarts highlighting when indexing ends.LibraryClassCacheis unchanged: a lookup that must compute while indexing still throwsIndexNotReadyException, the platform's retry signal, so no cache built on it stores an answer computed during indexing.Verification
isAvailableForFilein dumb mode with cold library caches; all failed withIndexNotReadyException.LibraryClassCachecontract: a cold lookup while indexing throws, and the class is found once indexing ends (no stale answer). The existingNativeSyncDumbModeTestpins the same contract for the native sync.NativeSyncDumbModeTest4/4;NativeLinkRepairServiceTest15/15.:spring-bootstrap:test --rerun-taskson 7326787, fresh JUnit XML): spring-core 2394, spring-web 906 (6 skipped), spring-ai 776, spring-data 142, jpa 138, base 35, aop 6, security 6, initializr 5 — 0 failures except one ExodusThreadLeakTrackerleak assertion inSpringBootApplicationMcpToolsetTraceFunctionalRouteTest, which passed 40/40 when rerun alone (known flake).Backport
Main first. The fix applies to every supported line (242–262) with per-line shapes:
LibraryClassCache,SpringBaseLocalInspectionTool,SpringBoot3JakartaMigrationInspectionandSpringJdbcClientParamInspectionare identical on all release branches;SpringDataBaseUastLocalInspectionTooldiffers on 242–252;SpringWebBaseUastLocalInspectionTooldoes not exist on 242–252. Backport PRs follow after this one merges.Closes #688