[ 
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-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to