Add new import schema with path, is_static, and is_wildcard fields#144
Merged
sinha108 merged 2 commits intoMar 5, 2026
Merged
Conversation
sinha108
approved these changes
Mar 5, 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.
These changes replace the flat, lossy string-based import representation (
List<String>) with a structuredImportobject containingpath,is_static, andis_wildcardfields. They also add a legacy schema detection guard that rejects oldanalysis.jsonfiles with a clear error message.Additionally, after running into some problems with existing integration tests, there are fixes to integration test assertions to be structure-aware rather than relying on fragile string matching.
Motivation and Context
The previous import model only stored the import path as a plain string, losing information about whether imports were static or wildcard. This change enriches the schema so that each import carries its full semantics.
How Has This Been Tested?
New
SymbolTableTest.testExtractSingleImportMetadatavalidates parsing of regular, wildcard, static, and static-wildcard imports, including JSON serialization shape. Also, newCodeAnalyzerTesttests legacy schema rejection (testReadSymbolTableFromFileRejectsLegacyImportSchema) and correct parsing of the new schema (testReadSymbolTableFromFileParsesExplicitImportSchema).Breaking Changes
Yes. Consumers that read the
importsarray as strings will need to update. By design, loading a pre-2.3.7analysis.jsonvia--inputwill now fail with an error asking the user to regenerate.Types of changes
Checklist
Additional context
gradle.properties.hasLegacyImportSchemaguard inCodeAnalyzer.javadetects old files by checking if any import element is a JSON primitive string, and throwsIllegalStateExceptionwith an actionable message.