solr
solr copied to clipboard
Don't create a Thread when there is no thread
No Jira. This is just to clean-up a bad smell in the code.
Description
We create a java.lang.Thread instance, but this thread is never started. It just acts as a target for another existing thread, from the executor pool. The call to setDaemon() has no effect.
This code was reported by errorprone because of the thread creation without a name (hence the removed @SuppressForbidden)
Replacing the thread by a Runnable makes the full thing cleaner.
Checklist
Please review the following and check all that apply:
- [x] I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
- [x] I have created a Jira issue and added the issue ID to my pull request title.
- [x] I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
- [x] I have developed this patch against the
mainbranch. - [x] I have run
./gradlew check. - [ ] I have added tests for my changes.
- [ ] I have added documentation for the Reference Guide
@dsmiley wpuld you like me to shepherd merging this? It looks ready?