dsmiley commented on a change in pull request #1894:
URL: https://github.com/apache/lucene-solr/pull/1894#discussion_r492252261



##########
File path: 
solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
##########
@@ -139,8 +140,19 @@ public void handleRequestBody(SolrQueryRequest req, 
SolrQueryResponse rsp) throw
     if (solrCloudMode) {
       rsp.add("zkHost", getCoreContainer(req, 
core).getZkController().getZkServerAddress());
     }
-    if (cc != null)
-      rsp.add( "solr_home", cc.getSolrHome());
+    if (cc != null) {
+      String solrHome = cc.getSolrHome();
+      rsp.add("solr_home", solrHome);
+
+      Path coreRootDirectory = cc.getCoreRootDirectory();
+      if (coreRootDirectory != null) {
+        String coreRootDirectoryString = coreRootDirectory.toString();
+        if (!coreRootDirectoryString.equals(solrHome)) {

Review comment:
       I disagree with this condition.  I think this should always emitted no 
matter where it is.  It's more helpful on consumers to depend on its existence 
rather than having it vary in some cases but not others.

##########
File path: 
solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java
##########
@@ -139,8 +140,19 @@ public void handleRequestBody(SolrQueryRequest req, 
SolrQueryResponse rsp) throw
     if (solrCloudMode) {
       rsp.add("zkHost", getCoreContainer(req, 
core).getZkController().getZkServerAddress());
     }
-    if (cc != null)
-      rsp.add( "solr_home", cc.getSolrHome());
+    if (cc != null) {
+      String solrHome = cc.getSolrHome();
+      rsp.add("solr_home", solrHome);
+
+      Path coreRootDirectory = cc.getCoreRootDirectory();
+      if (coreRootDirectory != null) {

Review comment:
       coreRootDirectory is always non-null.  I don't like null checks that are 
unnecessary; it may feel "safe" but slightly obscures code clarity and suggests 
possibilities that are impossibilities.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to