[
https://issues.apache.org/jira/browse/KAFKA-6899?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
lujie updated KAFKA-6899:
-------------------------
Summary: two Potential NPEs (was: An Potential NPE)
> two Potential NPEs
> ------------------
>
> 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 some callees may return null 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 checker while using the return
> value, 2 of them have no checker :
> {code:java}
> //caller1:KerberosLogin#login(Stirng, callback)
> AppConfigurationEntry entries[] =
> Configuration.getConfiguration().getAppConfigurationEntry(loginContextName);
> for (AppConfigurationEntry entry: entries) {}//may NPE
> //caller2:KerberosLogin#login()
> AppConfigurationEntry[] entries =
> configuration().getAppConfigurationEntry(contextName());
> if (entries.length == 0)/may NPE
> {code}
> I am not sure these two are bug o or not, please correct me without any
> without any hesitation.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)