Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-4136: fix hostContext randomization to never include double slashes

Chris M. Hostetter5992a831e408
diff --git a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java
index 624cc8c9c1e..54c87482f49 100644
--- a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java
@@ -109,9 +109,11 @@ public abstract class BaseDistributedSearchTestCase extends SolrTestCaseJ4 {
// NOOP: don't try to add a subdir to nothing (ie "//" is bad)
}
}
+ // paranoia, we *really* don't want to ever get "//" in a path...
+ final String hc = hostContext.toString().replaceAll("\\/+","/");
- log.info("Setting hostContext system property: " + hostContext.toString());
- System.setProperty("hostContext", hostContext.toString());
+ log.info("Setting hostContext system property: " + hc);
+ System.setProperty("hostContext", hc);
}
/**