Michael Braun created SOLR-11980:

             Summary: SolrCore should not lock over non-final member variable
                 Key: SOLR-11980
                 URL: https://issues.apache.org/jira/browse/SOLR-11980
             Project: Solr
          Issue Type: Improvement
      Security Level: Public (Default Security Level. Issues are Public)
            Reporter: Michael Braun


public String getIndexDir() {
synchronized (searcherLock) {
  if (_searcher == null) return getNewIndexDir();
  SolrIndexSearcher searcher = _searcher.get();
  return searcher.getPath() == null ? dataDir + "index/" : searcher

Instance members that are locked over should be final. In this case, the field 
is searcherLock. 

Side note but there are a number of other fields in the class that could be 
made final.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to