Skip to content

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

Open
elharo wants to merge 1 commit into
masterfrom
fix/issue-140-utf8-pattern-inner-class-dollars
Open

fix(classes): keep inner class references ($) from UTF-8 pool in ImportVisitor#149
elharo wants to merge 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.

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.

VALID_UTF8_PATTERN in ImportVisitor filters out inner class dollar sign references

1 participant