You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Jiajia Li (JIRA)" <ji...@apache.org> on 2015/07/13 09:07:05 UTC

[jira] [Commented] (DIRKRB-354) Fix getBooleanOption return null problem

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

Jiajia Li commented on DIRKRB-354:
----------------------------------

I think there is some issue in patch. For example:
{code}
1 public boolean allowUdp() {
2       Boolean allowUdp = commonOptions.getBooleanOption(KrbOption.ALLOW_UDP, false);
3        if (allowUdp != null) {
4            return allowUdp;
5        }
6       return krbConfig.allowKdcUdp();
    }
{code}
The line 6 will never run. So please check when to get the value from krbConfig.

> Fix getBooleanOption return null problem
> ----------------------------------------
>
>                 Key: DIRKRB-354
>                 URL: https://issues.apache.org/jira/browse/DIRKRB-354
>             Project: Directory Kerberos
>          Issue Type: Bug
>            Reporter: Xu Yaning
>         Attachments: DIRKRB-354-v1.patch
>
>
> org.apache.kerby.KOptions.getBooleanOption(KOption) has Boolean return type and returns explicit null; A method that returns either Boolean.TRUE, Boolean.FALSE or null is an accident waiting to happen. This method can be invoked as though it returned a value of type boolean, and the compiler will insert automatic unboxing of the Boolean value. If a null value is returned, this will result in a NullPointerException.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)