gsingers opened a new pull request, #2968:
URL: https://github.com/apache/tika/pull/2968

   ## Summary
   - `MagicDetector` recompiled its `Pattern` on every regex match even though 
the pattern bytes and case-insensitivity flag are fixed at construction time; 
now compiled once in the constructor and reused (`Pattern` is immutable, 
`Matcher` is still created per call, so the regex path stays thread-safe).
   - Adds direct coverage for the regex branch of `matches(byte[])`, which 
`MagicMatch.eval` exercises for every magic in `tika-mimetypes.xml` but which 
was previously only tested indirectly, plus repeated-call and concurrent-use 
tests over a shared detector instance.
   - CHANGES.txt entry added.
   
   ## Test plan
   - [x] `./mvnw clean test -pl :tika-core -Dtest=MagicDetectorTest`
   - [x] `./mvnw clean install`
   
   https://claude.ai/code/session_01Pp6TVDKF7ztw7SS7hwwuFd


-- 
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