Skip to content

JAVA-7419 Read SemSitter array terms as the arrays of their element - #6587

Open
rombirli wants to merge 1 commit into
rombirli/semsitter-semantic-modelfrom
rombirli/semsitter-array-terms
Open

rombirli wants to merge 1 commit into
rombirli/semsitter-semantic-modelfrom
rombirli/semsitter-array-terms

Conversation

@rombirli

@rombirli rombirli commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Part 5 of 17 of JAVA-7392. Ticket: JAVA-7419.

Intent

Since SonarSource/semsitter#5876 and #5950, the server names array types with a term id spelled over their element, java::byte[], instead of a plain byte[]. FactTypes read such a term as a class literally named java::byte[], with no element, so no signature with an array parameter matched its overridden method.

flowchart LR
  T["java::byte[][]"] --> A["array of"] --> B["java::byte[]"] --> C["array of"] --> P["byte"]
  H["java::{a1b2}"] --> U["unknown"]
Loading
public class RedissonConnection extends AbstractRedisConnection {
  public Boolean exists(byte[] key) { ... }   // overrides a deprecated DefaultedRedisConnection method (S1874, S1161)
}

A hashed term, java::{...}, spells no element and stays unknown.

redisson probe, RedissonConnection.exists(byte[]) before after
parameter type class java::byte[] byte[]
overridden methods none DefaultedRedisConnection (deprecated), RedisKeyCommands

This explains part of the issues lost on the last PVF compared to the earlier stack.

State on master

FactTypes does not exist on master: it comes with part 4.

Test plan

  • FactTypesTest.array_terms_are_the_arrays_of_their_element: java::byte[], java::int[][], generic and type variable elements, hashed terms stay unknown

@rombirli rombirli self-assigned this Nov 25, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

JAVA-7419

@rombirli
rombirli added this pull request to stack #6589 November 25, 2026 20:48
@datadog-sonarsource

This comment has been minimized.

@rombirli
rombirli force-pushed the rombirli/semsitter-array-terms branch from 9f0c1e8 to 2c894b0 Compare November 27, 2026 07:55
The server now names the type of an array parameter, result or field with an
array term, java::byte[], instead of the written byte[]. Read the element of
the term so these types keep the name of the array the code declares; a hashed
term spells no element and stays unknown.
@rombirli
rombirli force-pushed the rombirli/semsitter-array-terms branch from 2c894b0 to b7c0217 Compare November 27, 2026 09:24
@gitar-bot

gitar-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown
CI failed: The Ruling Update and Notify job (job 140420072665) failed because the upstream ruling-qa job was cancelled, leaving no actual_* artifacts to download. The analyzer found no evidence linking this to the PR, and the reason for the cancellation remains unknown.

Overview

The Ruling Update and Notify job (job 140420072665) failed because the upstream ruling-qa job was cancelled, leaving no actual_* artifacts to download. The analyzer found no evidence linking this to the PR, and the reason for the cancellation remains unknown.

Failures

Ruling Update and Notify job failed: actual_* artifacts unavailable after upstream ruling-qa was cancelled

  • Type: infrastructure
  • Affected jobs: 140420072665
  • Related to change: no
  • Confidence: high
  • Root cause: The log shows needs.ruling-qa.result was cancelled; the update action then attempted to sync ruling artifacts and failed because none were available. The log does not explain why ruling QA was cancelled. This PR changes SemSitter array-term type handling in FactTypes, but there is no evidence connecting that change to the cancellation or the missing-artifact failure.
  • Suggested fix: Investigate why the ruling QA job was cancelled and rerun it if appropriate. Update the notification workflow to handle cancelled upstream jobs or missing artifacts without failing the downstream job.

Summary

  • Change-related failures: 0
  • Infrastructure/flaky failures: 1
  • Recommended action: Investigate why the ruling QA job was cancelled and rerun it if appropriate. Update the notification workflow to handle cancelled upstream jobs or missing artifacts without failing the downstream job.
Code Review ✅ Approved 🟡 Medium risk

Parsing SemSitter array terms changes inferred Java types, which could affect overridden-method matching and related analyzer findings.

Reads SemSitter array terms such as java::byte[] as arrays of their element type, so array-parameter signatures like exists(byte[]) now match their overridden methods. Hashed terms java::{...} remain unknown. No issues found.

Verification Rules 3/3 met Repos 3 inspected · PRs 3 inspected

Functional validation No results

Rules 3 passed 2 not applicable

✅ Internal artifact registries
✅ Release secrets usage
✅ Repository license compliance

Broader impact Repos 3 inspected PRs 3 inspected
Cross-repo 3 repositories inspected 0 open impacts

SonarSource/sonarlint-intellij Inspected
SonarSource/sonarlint-eclipse Inspected
SonarSource/sonar-iac Inspected

Cross-PR 3 PRs inspected 0 open impacts

PR 6575: JAVA-7398 Translate SemSitter documents into the Java syntax tree Inspected
PR 6578: JAVA-7401 Rank library overloads to pick the most specific method Inspected
PR 6579: JAVA-7402 Expose annotations and nullability through symbol metadata Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Tip

Comment Gitar fix CI or enable auto-apply: gitar auto-apply:on

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqube-next

Copy link
Copy Markdown
Contributor

This branch has not been deployed

No deployments
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.

1 participant