solr
solr copied to clipboard
SOLR-15591 / Avoid needless catch by checking condition
https://issues.apache.org/jira/browse/SOLR-15591
Description
Remove unnecessary catch in ExternalPaths.
Solution
Instead of catching the exception and setting the next possible path, instead we check for the condition that triggers the NPE and act accordingly.
Tests
Per the issue description, the issue was that when setting the test to hit a breakpoint on exceptions. Sometimes the debugger would stop on ExternalPaths, in order to test the change. The debugger shouldn't stop on this class.
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.
- [ ] 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)
- [ ] 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
I tagged @madrob for this one, however it LGTM. I've been bit by this issue before, especially in Eclipse.
This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the [email protected] mailing list. Thank you for your contribution!