krickert commented on PR #1163:
URL: https://github.com/apache/opennlp/pull/1163#issuecomment-4952773667

   Fixed the dedupe. I extracted a package-private `DelegatingStemmer` base 
that holds the shared per-thread plumbing (the `OwnerOrPerThreadState` field, 
factory validation, and `clearThreadLocalState`), so `SharingStemmer` and 
`CachingStemmer` now differ only in their per-thread payload and their `stem` 
logic. One deliberate difference from the suggestion: the type parameter is the 
per-thread payload, not the wrapped `Stemmer` type. Both wrappers mint 
delegates from a `StemmerFactory` and only call the `Stemmer` contract, so 
parameterizing over the concrete stemmer would push a type parameter onto 
`StemmerFactory` as well without changing behavior. Fail-fast construction is 
unchanged and the existing tests cover both wrappers.
   


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