SOLR-18092: fix solr-test-framework for 3rd party -- ExternalPaths NPE#4225
SOLR-18092: fix solr-test-framework for 3rd party -- ExternalPaths NPE#4225dweiss wants to merge 3 commits intoapache:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR intends to prevent a null-pointer failure during ExternalPaths initialization when the Solr source/test base directory can’t be determined (e.g., when tests.src.home isn’t provided and the expected directories don’t exist).
Changes:
- Fixes the short-circuit evaluation order in the directory-walk loop so
baseis checked for null before callingbase.resolve(...).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| Path base = file.toAbsolutePath(); | ||
| while (!Files.exists(base.resolve("solr/test-framework/build.gradle")) && null != base) { | ||
| while (null != base && !Files.exists(base.resolve("solr/test-framework/build.gradle"))) { |
There was a problem hiding this comment.
Copilot is right!
And furthermore, SolrTestCase references these constants in a way that will also NPE
|
I didn't realize that this bug that I ran into separately was already fixed, even though I reviewed it just a day before!!! |
|
FYI my PR focused on testing this is #4227 and it includes a more expanded fix and another fix for the pom version ambiguity issue. It's still Draft/WIP. I'd rather separate the fixes of both problems and merge them before finally the test. I'll commit to this PR to take my edits from that one. |
and reference hossman
The order of arguments in the loop is not right.