Skip to content

fix(extract): emit Java type annotation references - #1487

Closed
oleksii-tumanov wants to merge 1 commit into
Graphify-Labs:v8from
oleksii-tumanov:fix/java-type-annotation-references
Closed

oleksii-tumanov wants to merge 1 commit into
Graphify-Labs:v8from
oleksii-tumanov:fix/java-type-annotation-references

Conversation

@oleksii-tumanov

Copy link
Copy Markdown
Contributor

Summary

  • emit references edges for annotations on Java classes, interfaces, and records
  • reuse the existing attribute context used by Java method annotations

Why

Type-level annotations such as @Service and @Entity were missing from the extraction cache and final graph, hiding framework roles in Java and Spring projects.

Fixes #1486

Result

The extraction cache now includes:

[
  {"source": "typeannotations_checkoutservice", "target": "service", "relation": "references", "confidence": "EXTRACTED", "context": "attribute"},
  {"source": "typeannotations_checkoutservice", "target": "entity", "relation": "references", "confidence": "EXTRACTED", "context": "attribute"}
]

Testing

  • uv run --frozen pytest tests/test_languages.py tests/test_java_type_resolution.py -q -k java (16 passed, 261 deselected)
  • uv run --frozen pytest tests/ -q --tb=short (2413 passed, 28 skipped)
  • uv run --frozen ruff check graphify/extract.py tests/test_languages.py (passed)

@safishamsi

Copy link
Copy Markdown
Member

Thanks @oleksii-tumanov — correct and consistent with the existing method-annotation handling (same attribute context). Landed on v8 in d8aa607 with your authorship (resolved a trivial additive test conflict with #1485 by keeping both tests). Closing as merged-by-port.

@safishamsi safishamsi closed this Jun 27, 2026
safishamsi pushed a commit that referenced this pull request Jun 27, 2026
Annotations on Java classes/interfaces/records (e.g. @service, @entity) produced
no edge, so type-level framework wiring was invisible even though method-level
annotations were already captured. The class/interface/record handler now emits
`references` edges with the existing `attribute` context, reusing the renamed
`_java_annotation_names` helper (was `_java_method_annotation_names`; logic
unchanged) at both the type and method call sites.

Ported from PR #1487 by @oleksii-tumanov. Resolved an additive test conflict with
#1485 by keeping both new test functions.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
safishamsi added a commit that referenced this pull request Jun 27, 2026
Dates the 0.8.50 CHANGELOG and bumps the version. Highlights: WPF/XAML extraction
+ ViewModel/binding links (#1460/#1473), Objective-C relationship fixes (#1475),
.vue SFC grammar fix (#1468), Metal shader indexing (#1480), Java field/annotation
references (#1485/#1487), portable wiki links (#1444), *_BASE_URL backend overrides
(#1458), non-streaming OpenAI-compatible calls (#1223), reflect --if-stale sidecar
freshness (#1470), label --missing-only (#1481), canvas grid + case-fold dedup
(#1452/#1453), the Read|Glob hook extension fix (#1463), and the no-API-key skill
clarification (#1461).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
PerryLin-0420 pushed a commit to PerryLin-0420/graphify-decouple that referenced this pull request Aug 13, 2026
…s#1487)

Annotations on Java classes/interfaces/records (e.g. @service, @entity) produced
no edge, so type-level framework wiring was invisible even though method-level
annotations were already captured. The class/interface/record handler now emits
`references` edges with the existing `attribute` context, reusing the renamed
`_java_annotation_names` helper (was `_java_method_annotation_names`; logic
unchanged) at both the type and method call sites.

Ported from PR Graphify-Labs#1487 by @oleksii-tumanov. Resolved an additive test conflict with
Graphify-Labs#1485 by keeping both new test functions.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
PerryLin-0420 pushed a commit to PerryLin-0420/graphify-decouple that referenced this pull request Aug 13, 2026
Dates the 0.8.50 CHANGELOG and bumps the version. Highlights: WPF/XAML extraction
+ ViewModel/binding links (Graphify-Labs#1460/Graphify-Labs#1473), Objective-C relationship fixes (Graphify-Labs#1475),
.vue SFC grammar fix (Graphify-Labs#1468), Metal shader indexing (Graphify-Labs#1480), Java field/annotation
references (Graphify-Labs#1485/Graphify-Labs#1487), portable wiki links (Graphify-Labs#1444), *_BASE_URL backend overrides
(Graphify-Labs#1458), non-streaming OpenAI-compatible calls (Graphify-Labs#1223), reflect --if-stale sidecar
freshness (Graphify-Labs#1470), label --missing-only (Graphify-Labs#1481), canvas grid + case-fold dedup
(Graphify-Labs#1452/Graphify-Labs#1453), the Read|Glob hook extension fix (Graphify-Labs#1463), and the no-API-key skill
clarification (Graphify-Labs#1461).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.

Java type-level annotations do not emit reference edges

2 participants