You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/08/30 14:57:36 UTC
[lucene-solr] branch reference_impl_dev updated: @629 Defend
against NPE you can get with this kind of wild coredescriptor thing we do
now.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/reference_impl_dev by this push:
new db798f2 @629 Defend against NPE you can get with this kind of wild coredescriptor thing we do now.
db798f2 is described below
commit db798f25a5f6231b8413b2167867c5b8a9e4ec26
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sun Aug 30 09:54:56 2020 -0500
@629 Defend against NPE you can get with this kind of wild coredescriptor thing we do now.
---
solr/core/src/java/org/apache/solr/core/SolrCore.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index c82a95d..f67ed5d 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -1051,7 +1051,7 @@ public final class SolrCore implements SolrInfoBean, Closeable {
initSearcher(prev);
// Initialize the RestManager
- restManager = initRestManager();
+ restManager = initRestManager(cd);
// at this point we can load jars loaded from remote urls.
memClassLoader.loadRemoteJars();
@@ -2975,9 +2975,10 @@ public final class SolrCore implements SolrInfoBean, Closeable {
* Creates and initializes a RestManager based on configuration args in solrconfig.xml.
* RestManager provides basic storage support for managed resource data, such as to
* persist stopwords to ZooKeeper if running in SolrCloud mode.
+ * @param cd
*/
@SuppressWarnings("unchecked")
- protected RestManager initRestManager() throws SolrException {
+ protected RestManager initRestManager(CoreDescriptor cd) throws SolrException {
PluginInfo restManagerPluginInfo =
getSolrConfig().getPluginInfo(RestManager.class.getName());
@@ -3000,7 +3001,7 @@ public final class SolrCore implements SolrInfoBean, Closeable {
if (initArgs == null)
initArgs = new NamedList<>();
- String collection = getCoreDescriptor().getCollectionName();
+ String collection = cd.getCollectionName();
StorageIO storageIO =
ManagedResourceStorage.newStorageIO(collection, resourceLoader, initArgs);
mgr.init(resourceLoader, initArgs, storageIO);