[ 
https://issues.apache.org/jira/browse/KAFKA-6899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16473436#comment-16473436
 ] 

ASF GitHub Bot commented on KAFKA-6899:
---------------------------------------

lujiefsi opened a new pull request #5015: [KAFKA-6899] One Potential NPE
URL: https://github.com/apache/kafka/pull/5015
 
 
   We have developed a static analysis tool [NPEDetector 
](https://github.com/lujiefsi/NPEDetector) find some potential NPE. Our 
analysis shows that NPE reason can be simple:some callees may return null 
directly in corner case(e.g. node crash , IO exception), some of their callers 
have  !=null check but some do not have. 
   
   ### Bug:
   
   callee JaasConfig#getAppConfigurationEntry  can return null, it has 13 
callers, 11 of the callers have the null check while using the return value, 
one of them have no checker :
   
   <pre>
   //caller:KerberosLogin#login()
   AppConfigurationEntry[] entries = 
configuration().getAppConfigurationEntry(contextName());
   if (entries.length == 0)/may NPE
   </pre>
   I am not sure whether it is an bug or not, please correct me without any 
without any hesitation.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> One Potential NPE
> -----------------
>
>                 Key: KAFKA-6899
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6899
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: lujie
>            Priority: Major
>
> We have developed a static analysis tool 
> [NPEDetector|https://github.com/lujiefsi/NPEDetector] to find some potential 
> NPE. Our analysis shows that NPE reason can be simple:some callees may return 
> null directly in corner case(e.g. node crash , IO exception), some of their 
> callers have  _!=null_ check but some do not have. 
> *Bug:*
> callee JaasConfig#getAppConfigurationEntry  can return null, it has 13 
> callers, 11 of the callers have the null check while using the return value, 
> one of them have no checker :
> {code:java}
> //caller:KerberosLogin#login()
> AppConfigurationEntry[] entries = 
> configuration().getAppConfigurationEntry(contextName());
> if (entries.length == 0)/may NPE
> {code}
> I am not sure whether it is an bug or not, please correct me without any 
> without any hesitation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to