You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jamie Johnson (Created) (JIRA)" <ji...@apache.org> on 2012/02/09 17:07:59 UTC
[jira] [Created] (SOLR-3117) CoreDescriptor attempts to use the
name before checking if it is null
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
Priority: Minor
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
[jira] [Resolved] (SOLR-3117) CoreDescriptor attempts to use the
name before checking if it is null
Posted by "Mark Miller (Resolved) (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Updated] (SOLR-3117) CoreDescriptor attempts to use the
name before checking if it is null
Posted by "Jamie Johnson (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jamie Johnson updated SOLR-3117:
--------------------------------
Attachment: CoreDescriptor.patch
patch to move check if name is null above accessing it
> 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
> Priority: Minor
> 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
[jira] [Updated] (SOLR-3117) CoreDescriptor attempts to use the
name before checking if it is null
Posted by "Mark Miller (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Miller updated SOLR-3117:
------------------------------
Fix Version/s: 4.0
Assignee: Mark Miller
> 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