madrob commented on a change in pull request #340:
URL: https://github.com/apache/solr/pull/340#discussion_r739428642
##########
File path: solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
##########
@@ -58,21 +58,23 @@
static String determineSourceHome() {
try {
File file;
- try {
- file = new File("solr/conf");
- if (!file.exists()) {
- file = new
File(ExternalPaths.class.getClassLoader().getResource("solr/conf").toURI());
+
+ file = new File("solr/conf");
Review comment:
nit: this can be combined with the declaration on line 60.
##########
File path: solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
##########
@@ -58,21 +58,23 @@
static String determineSourceHome() {
try {
File file;
- try {
- file = new File("solr/conf");
- if (!file.exists()) {
- file = new
File(ExternalPaths.class.getClassLoader().getResource("solr/conf").toURI());
+
+ file = new File("solr/conf");
+ if (!file.exists()) {
+ URL resourceUrl =
ExternalPaths.class.getClassLoader().getResource("solr/conf");
+ if(resourceUrl != null) {
+ file = new File(resourceUrl.toURI());
+ } else {
+ file = new File(System.getProperty("tests.src.home", "."));
}
- } catch (Exception e) {
- // If there is no "solr/conf" in the classpath, fall back to searching
from the current directory.
Review comment:
we should keep this comment
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]