Skip to content

Apache Lucene open-source search software

SOLR-5281: IndexSchema log message was printing '[null]' instead of '[<core name>]'

Steven Rowe60479b32b099
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 0bd9062cfb8..e8cf1ce63aa 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -81,6 +81,9 @@ Bug Fixes
----------------------
* SOLR-4590: Collections API should return a nice error when not in SolrCloud mode.
(Anshum Gupta, Mark Miller)
+
+* SOLR-5281: IndexSchema log message was printing '[null]' instead of
+ '[<core name>]' (Jun Ohtani via Steve Rowe)
Security
----------------------
diff --git a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
index 2142a8b3539..241aa9a7909 100644
--- a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
+++ b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
@@ -107,6 +107,7 @@ public class IndexSchema {
private static final String AT = "@";
private static final String DESTINATION_DYNAMIC_BASE = "destDynamicBase";
private static final String MAX_CHARS = "maxChars";
+ private static final String SOLR_CORE_NAME = "solr.core.name";
private static final String SOURCE_DYNAMIC_BASE = "sourceDynamicBase";
private static final String SOURCE_EXPLICIT_FIELDS = "sourceExplicitFields";
private static final String TEXT_FUNCTION = "text()";
@@ -436,7 +437,7 @@ public class IndexSchema {
// Another case where the initialization from the test harness is different than the "real world"
sb.append("[");
if (loader.getCoreProperties() != null) {
- sb.append(loader.getCoreProperties().getProperty(NAME));
+ sb.append(loader.getCoreProperties().getProperty(SOLR_CORE_NAME));
} else {
sb.append("null");
}