You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael Braun (JIRA)" <ji...@apache.org> on 2018/02/15 00:24:00 UTC
[jira] [Commented] (SOLR-11980) SolrCore should not lock over
non-final member variable, add final to more vars
[ https://issues.apache.org/jira/browse/SOLR-11980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16364998#comment-16364998 ]
Michael Braun commented on SOLR-11980:
--------------------------------------
Patch passes precommit, have not run the full test suite
> SolrCore should not lock over non-final member variable, add final to more vars
> -------------------------------------------------------------------------------
>
> 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
> Priority: Minor
> Attachments: SOLR-11980.patch
>
>
> [https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/core/SolrCore.java#L329] :
> Example:
> {code:java}
> public String getIndexDir() {
> synchronized (searcherLock) {
> if (_searcher == null) return getNewIndexDir();
> SolrIndexSearcher searcher = _searcher.get();
> return searcher.getPath() == null ? dataDir + "index/" : searcher
> .getPath();
> }
> }
> {code}
> Instance members that are locked over should be final. In this case, the field is searcherLock.
> This patch not only covers searcherLock but other private variables that can easily be final.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org