Skip to content

Fix #136: allow underscores in class names matched by CLASS_FILTER - #155

Open
elharo wants to merge 2 commits into
masterfrom
fix/issue-136-class-filter-underscore
Open

Fix #136: allow underscores in class names matched by CLASS_FILTER#155
elharo wants to merge 2 commits into
masterfrom
fix/issue-136-class-filter-underscore

Conversation

@elharo

@elharo elharo commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Closes #136

Summary

Adds a regression test for #136. The issue reports that CLASS_FILTER in JarAnalyzer rejects underscores in Java class names (My_Helper.class, some_test.class, etc.).

Investigation showed the described behavior does not reproduce: filterEntries uses Matcher.find(), so the pattern [A-Za-z0-9]*\\.class$ matches any entry ending in .class regardless of what precedes it (the character class only matches the trailing alphanumeric run). No source change is therefore required.

Test

Adds getClassEntriesFindsClassesWithUnderscores in JarAnalyzerTest, which builds a JAR in memory containing classes with underscores in their names (My_Helper, some_test, UPPER_CASE) alongside a regular class, and asserts all of them are returned by getClassEntries(). This documents the expected behavior and guards against regressions.

@elharo elharo added maintenance java Pull requests that update Java code skip-changelog Skip this PR from automatically changelog generation labels Aug 7, 2026
@elharo
elharo requested review from Tibor17, stephenc and struberg August 7, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update Java code maintenance skip-changelog Skip this PR from automatically changelog generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLASS_FILTER in JarAnalyzer rejects underscores in Java class names

1 participant