Skip to content

[#546] Reduce reflection in generated metadata and runtime code#547

Merged
stalep merged 1 commit into
aeshell:masterfrom
tristantarrant:546/less_reflection
Jul 1, 2026
Merged

[#546] Reduce reflection in generated metadata and runtime code#547
stalep merged 1 commit into
aeshell:masterfrom
tristantarrant:546/less_reflection

Conversation

@tristantarrant

Copy link
Copy Markdown
Contributor

Closes #546

- Add initialValueFactory (Supplier) to ProcessedOption so generated code
  can restore Collection/Map fields without getDeclaredConstructor().newInstance()
- GeneratedProcessedOption.restoreInitialValue() uses factory when available
- CodeGenerator emits setInitialValueFactory(ArrayList::new) etc. for
  @OptionList, @OptionGroup, and @arguments fields
- CommandContext.ContextFrame uses ProcessedOption.getFieldAccessor() for
  caching and restoring field values instead of raw Field reflection
- Move internal command metadata providers into inner classes of
  AliasCommand, UnAliasCommand, ExportCommand for direct private field
  access without reflection
- Annotation processor warns when private fields require reflective access,
  suggesting package-private visibility for reflection-free generated code
@stalep stalep merged commit 2f9cf7a into aeshell:master Jul 1, 2026
2 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.

Reduce reflection in generated metadata and runtime code

2 participants