You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Noble Paul (JIRA)" <ji...@apache.org> on 2013/06/13 19:41:24 UTC

[jira] [Updated] (SOLR-4925) Collection create throws NPE when 'numShards' param is missing

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

Noble Paul updated SOLR-4925:
-----------------------------

    Attachment: SOLR-4925.patch

Very interesting. This can go into a java tricks n tips book

{code:java}
  static Integer msgToStr(String val,Integer def ){
        return  val == null ? def : Integer.parseInt(val);
    }
{code}

compiles to

{code:java}
  static Integer msgToStr(String val,Integer def ){
        return Integer.valueOf(val == null ? def : Integer.parseInt(val));
    }
{code}

So NPE , if both 'val' and 'def' are null

I'm committing it right away
                
> Collection create throws NPE when 'numShards' param is missing
> --------------------------------------------------------------
>
>                 Key: SOLR-4925
>                 URL: https://issues.apache.org/jira/browse/SOLR-4925
>             Project: Solr
>          Issue Type: Sub-task
>            Reporter: Noble Paul
>            Assignee: Noble Paul
>            Priority: Trivial
>             Fix For: 4.4
>
>         Attachments: SOLR-4925.patch
>
>
> OverseerCollectionProcessor.msgStrToInt(ZkNodeProps message, String key, Integer def) throws NPE when the key value is null. I is expected to return the value of 'def' 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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