[ 
https://issues.apache.org/jira/browse/SOLR-736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan McKinley reassigned SOLR-736:
----------------------------------

    Assignee: Ryan McKinley

> SolrCore.getSolrCore() may create a SolrCore without a CoreContainer
> --------------------------------------------------------------------
>
>                 Key: SOLR-736
>                 URL: https://issues.apache.org/jira/browse/SOLR-736
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Henri Biestro
>            Assignee: Ryan McKinley
>
> The method is deprecated but one can still initialize & start working this 
> way.
> Potential fix could be:
> {code}
>   @Deprecated
>   public static SolrCore getSolrCore() {
>     synchronized( SolrCore.class ) {
>       if( instance == null ) {
>         try {
>           // sets 'instance' to the latest solr core
>           CoreContainer.Initializer init = new CoreContainer.Initializer();
>           instance = init.initialize().getCore("");
>         } catch(Exception xany) {
>           throw new SolrException( SolrException.ErrorCode.SERVER_ERROR,
>               "error creating core", xany );
>         }
>       }
>     }
>     return instance;
>   }
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to