Repository navigation
SONARJAVA-7255 Convert the PSI syntax tree to the Sonar AST - #6424
aurelien-coet-sonarsource wants to merge 1 commit into
Conversation
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 3 Pipeline jobs failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 02a60f3 | Docs | View more details | Give us feedback! |
| @AfterAll | ||
| static void close() { | ||
| if (session != null) { | ||
| session.close(); | ||
| } | ||
| var expected = java.util.EnumSet.allOf(Tree.Kind.class); | ||
| expected.remove(Tree.Kind.OTHER); | ||
| assertThat(observedKinds).containsAll(expected); | ||
| } |
There was a problem hiding this comment.
💡 Quality: @afterall kind-coverage assertion fails any partial test run
PsiTreeConverterTest.close() asserts that observedKinds contains every Tree.Kind except OTHER. observedKinds is filled as a side effect of whichever compare calls happened to run in that JVM. If you run one test method or one parameterized case on its own (e.g. -Dtest=PsiTreeConverterTest#module_declarations, or rerunning a single failure from the IDE), the class fails in @AfterAll even though the selected test passed. The failure is also reported against the class rather than the test that caused it. Moving the coverage check into its own @Test that converts a fixed corpus would make each test independent.
Was this helpful? React with 👍 / 👎
512ad09 to
37afb04
Compare
37afb04 to
02a60f3
Compare
CI failed: Three CI failures: a PsiTreeConverterTest NullPointerException in java-frontend (change-related, high confidence), a license-maven-plugin download failure for 21 artifacts including java-frontback-psi (relationship to PR unclear), and a skipped ruling QA prerequisite breaking the ruling update job (unrelated to PR).OverviewThree unique error templates were analyzed across 8 logs for commit 02a60f3. One failure is directly tied to the PR's new PSI-to-AST test, one is a dependency/license issue whose relation to the PR is unclear, and one is an unrelated workflow configuration problem. FailuresTest NullPointerException in PsiTreeConverterTest (confidence: high)
License download failure for 21 artifacts, including java-frontback-psi (confidence: high)
Ruling update job failed after ruling QA was skipped (confidence: high)
Summary
Code Review 👍 Approved with suggestions 1 closed / 2 findings🟡 Medium risk · Adding a PSI-to-Sonar AST conversion path and IntelliJ runtime dependencies could affect syntax-tree interpretation and Java analysis results. Adds 💡 Quality:
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
Summary by Gitar
PsiTreeConverterto map IntelliJ PSI trees onto the existing Sonar syntax modelPsiTokenIndexandPsiSourceSnapshotto track tokens, comments, and Unicode escape offsetsjava-frontend/pom.xmlwith transitive dependencies excludedsonar-java-plugin/pom.xmlJParserinto newJavaTreeFinalizerand madeKeywordThisandKeywordSuperpublicJavaPsiApplicationto register IntelliJ core extensions and services for PSI parsingThis will update automatically on new commits.