test(code-graph): add Java 17 sealed interface and permitted class fixture

What does this MR do?

Adds integration-test coverage for Java 17 sealed types (JEP 409), which the code indexer previously had no fixtures for.

  • New fixture crates/integration-tests-codegraph/fixtures/java/sealed_classes.yaml: a sealed interface Shape permits Circle, Rectangle, Triangle, with final classes Circle and Rectangle and a non-sealed class Triangle.
  • Registers the suite in crates/integration-tests-codegraph/tests/suites.rs (yaml_test!(java_sealed_classes, ...)), which the issue's affected-files list did not mention but is required since fixtures are not auto-discovered.

The tests assert:

  1. Shape is extracted as an Interface definition with FQN com.example.shapes.Shape
  2. Circle, Rectangle, and Triangle are extracted as Class definitions
  3. Extends edges connect each permitted class to the sealed interface

Closes #738 (closed)

Closes Deviations from the issue's proposed YAML

  • There is no IMPLEMENTS edge kind in the schema; inheritance and interface implementation both produce edge_kind = 'Extends' on DefinitionToDefinition relationships, so the edge assertions use that (same pattern as java/v1_main_resolution.yaml).

Known gap (as anticipated by the issue)

The indexer does not extract the permits clause itself (java_super_types() in crates/code-graph/src/v2/langs/generic/java.rs only reads superclass/interfaces). The Extends edges asserted here come from each class's implements Shape clause, not from permits. This is documented in a comment at the top of the fixture. The sealed and non-sealed modifiers parse cleanly with tree-sitter-java 0.23.5 and do not affect name extraction.

Testing

cargo nextest run -p integration-tests-codegraph --no-capture (what mise run test:integration:codegraph wraps): 173 tests run: 173 passed, 0 skipped, including [PASS] Suite: Java 17: sealed interfaces and permitted classes (3 tests). Baseline before the change was 172/172.

Performance Analysis

No performance impact. This MR is test-only: it adds one YAML fixture and one yaml_test! registration, with no changes to indexer or query-engine code. The new suite adds ~0.03s to the integration test run (PASS [0.029s] java_sealed_classes, full suite 173 tests in ~9.3s). No flamegraphs or benchmarks needed.

  • This merge request does not introduce any performance regression. If a performance regression is expected, explain why.

Agent context — long-form analysis, file-by-file walkthroughs, profiler output, alternatives considered

  • test(code-graph): add Java 17 sealed interface and permitted class fixture

Add integration-test coverage for Java 17 sealed types (JEP 409): a sealed interface with a permits clause and three permitted classes (final and non-sealed). Tests assert the sealed interface is extracted as an Interface definition, each permitted class as a Class definition, and Extends edges connect the permitted classes to the sealed interface via their implements clauses.Known gap (documented in the fixture): the permits clause itself is not extracted by the indexer, so no edges are derived from permits.

fix #738 (closed)

Edited by MatthewOscar

Merge request reports

Loading
Loading