lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (SOLR-3117) CoreDescriptor attempts to use the name before checking if it is null
Date Mon, 13 Feb 2012 01:40:59 GMT

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

Mark Miller resolved SOLR-3117.
-------------------------------

    Resolution: Fixed

Thanks Jaime!
                
> CoreDescriptor attempts to use the name before checking if it is null
> ---------------------------------------------------------------------
>
>                 Key: SOLR-3117
>                 URL: https://issues.apache.org/jira/browse/SOLR-3117
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrCloud
>    Affects Versions: 4.0
>            Reporter: Jamie Johnson
>            Assignee: Mark Miller
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: CoreDescriptor.patch
>
>
> in CoreDescriptor when creating the cloudDesc the name is accessed before checking if
it is null 
> I believe it should be the following instead
> {code}
>   public CoreDescriptor(CoreContainer coreContainer, String name, String instanceDir)
{
>     this.coreContainer = coreContainer;
>     this.name = name;
>     
>     if (name == null) {
>         throw new RuntimeException("Core needs a name");
>       }
>     
>     if(coreContainer != null && coreContainer.getZkController() != null) {
>       this.cloudDesc = new CloudDescriptor();
>       // cloud collection defaults to core name
>       cloudDesc.setCollectionName(name.isEmpty() ? coreContainer.getDefaultCoreName()
: name);
>     }
>     
>     if (instanceDir == null) {
>       throw new NullPointerException("Missing required \'instanceDir\'");
>     }
>     instanceDir = SolrResourceLoader.normalizeDir(instanceDir);
>     this.instanceDir = instanceDir;
>     this.configName = getDefaultConfigName();
>     this.schemaName = getDefaultSchemaName();
>   }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message