Skip to content

fix: avoid reflective help text formatting - #443

Merged
slachiewicz merged 2 commits into
apache:masterfrom
efegokdemir:codex/issue-390-direct-formatting
Oct 27, 2026
Merged

slachiewicz merged 2 commits into
apache:masterfrom
efegokdemir:codex/issue-390-direct-formatting

Conversation

@efegokdemir

@efegokdemir efegokdemir commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

describe no longer depends on the generated HelpMojo.toLines method through reflection. The formatting implementation is kept local and rejects indentation sizes that would overflow the backing buffer.

Changes

  • move line wrapping into DescribeMojo
  • guard repeated indentation against integer overflow
  • add regression coverage for oversized indentation

Testing

  • mvn -Prun-its verify passed on JDK 17 (31 unit tests and 36 integration tests).
  • mvn spotless:check passed.

Fixes #390


To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
check one of the following:

@efegokdemir

Copy link
Copy Markdown
Contributor Author

Moved assertNull before assertThrows in DescribeMojoTest. mvn -Prun-its verify (31 unit tests and 36 integration tests) and mvn spotless:check pass on JDK 17.

@slachiewicz slachiewicz added the bug Something isn't working label Oct 27, 2026
@slachiewicz
slachiewicz merged commit f7b1aff into apache:master Oct 27, 2026
18 checks passed
@github-actions github-actions Bot added this to the 3.5.3 milestone Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DescribeMojo.toLines() delegates to generated HelpMojo via fragile reflection

2 participants