Skip to content

Modernize metadata builder collection factories to Map.of / Set.of#25

Merged
hazendaz merged 1 commit into
masterfrom
copilot/modernize-java-collections
May 17, 2026
Merged

Modernize metadata builder collection factories to Map.of / Set.of#25
hazendaz merged 1 commit into
masterfrom
copilot/modernize-java-collections

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

This updates legacy empty/singleton collection factory usage flagged by modernization checks in the DeltaSpike metadata builder internals. The change is scoped to API modernization only and preserves behavior/runtime constraints.

  • Scope

    • Updated only:
      • AnnotatedImpl
      • AnnotationStore
  • Collection factory modernization

    • Replaced Collections.singleton(overriddenType) with Set.of(overriddenType).
    • Replaced emptyMap() / emptySet() with Map.of() / Set.of().
  • Import cleanup

    • Removed now-unused Collections and static emptyMap / emptySet imports.
// before
typeClosure = Collections.singleton(overriddenType);
annotationMap = emptyMap();
annotationSet = emptySet();

// after
typeClosure = Set.of(overriddenType);
annotationMap = Map.of();
annotationSet = Set.of();

@hazendaz hazendaz marked this pull request as ready for review May 17, 2026 23:18
@hazendaz hazendaz merged commit d7b96b8 into master May 17, 2026
22 checks passed
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.

2 participants