Skip to content

fix(classes): keep inner class references ($) from UTF-8 pool in ImportVisitor - #149

Merged
elharo merged 1 commit into
masterfrom
fix/issue-140-utf8-pattern-inner-class-dollars
Aug 6, 2026
Merged

fix(classes): keep inner class references ($) from UTF-8 pool in ImportVisitor#149
elharo merged 1 commit into
masterfrom
fix/issue-140-utf8-pattern-inner-class-dollars

Conversation

@elharo

@elharo elharo commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #140

The UTF-8 constant pool filter in ImportVisitor (VALID_UTF8_PATTERN) rejected strings containing $, so inner class references like org/apache/tools/ant/XmlLogger$TimedElement were silently dropped from the discovered imports. Additionally, QUALIFIED_IMPORT_PATTERN did not allow $, causing raw descriptor strings (e.g. L...$Inner;) to leak in unparsed.

Changes:

  • allow $ in VALID_UTF8_PATTERN
  • allow $ in the qualified-class portion of QUALIFIED_IMPORT_PATTERN so descriptors are still unwrapped correctly
  • add a regression test that compiles a class holding an inner-class reference in its UTF-8 pool and asserts it is collected as an import

All 76 tests pass; checkstyle clean.

@slachiewicz slachiewicz added the bug Something isn't working label Aug 6, 2026
@elharo
elharo merged commit 91984bc into master Aug 6, 2026
15 checks passed
@elharo
elharo deleted the fix/issue-140-utf8-pattern-inner-class-dollars branch August 6, 2026 18:24
@github-actions github-actions Bot added this to the 3.2.1 milestone Aug 6, 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.

VALID_UTF8_PATTERN in ImportVisitor filters out inner class dollar sign references

2 participants