SOLR-10272: Fix precommit (the correct way)

This commit is contained in:
Ishan Chattopadhyaya 2017-06-27 21:59:32 +05:30
parent 2f2e00ffe2
commit ab319eab24
1 changed files with 1 additions and 4 deletions

View File

@ -50,7 +50,6 @@ import java.util.concurrent.atomic.AtomicReference;
import com.google.common.base.Strings;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.util.SuppressForbidden;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.impl.HttpSolrClient.Builder;
import org.apache.solr.client.solrj.request.CoreAdminRequest.WaitForState;
@ -716,10 +715,8 @@ public class ZkController {
return configDirPath;
}
@SuppressForbidden(reason = "This will be loaded for unit tests, and hence an exception can be made. "
+ "In regular server operation, there shouldn't be a situation where we reach this point.")
private static String getDefaultConfigDirFromClasspath(String serverSubPath) {
URL classpathUrl = Thread.currentThread().getContextClassLoader().getResource(serverSubPath);
URL classpathUrl = ZkController.class.getClassLoader().getResource(serverSubPath);
try {
if (classpathUrl != null && new File(classpathUrl.toURI()).exists()) {
return new File(classpathUrl.toURI()).getAbsolutePath();