elharo opened a new pull request, #155:
URL: https://github.com/apache/maven-shared-jar/pull/155

   Closes #136
   
   ### Summary
   
   `CLASS_FILTER` in `JarAnalyzer` is used to identify class file entries in a 
JAR. The character class `[A-Za-z0-9]` did not include `_`, which is a legal 
character in Java class names. This change adds `_` to the character class so 
the pattern `[A-Za-z0-9_]*\\.class$` correctly expresses the set of valid class 
name characters.
   
   ### 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()`.
   
   Note: because `filterEntries` uses `Matcher.find()`, an entry ending in 
`.class` is already matched regardless of the character class, so this fix 
makes the pattern match its documented intent rather than changing filtering 
behavior for these inputs. The test guards against regressions and documents 
the expected behavior.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to