You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Austin Stephens (JIRA)" <ji...@apache.org> on 2018/04/25 17:57:00 UTC

[jira] [Updated] (NETBEANS-734) False positive of possible null pointer derefernce in catch

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

Austin Stephens updated NETBEANS-734:
-------------------------------------
    Description: 
{code:java}
    private void someMethod(){}
    private void falsePositive(){
        try{
            someMethod();
        }
        catch(RuntimeException e){
            if (e instanceof NullPointerException){
                throw e;
            }
            //false positive for possible null pointer
            Throwable cause = e.getCause();
        }
    }
{code}
Is it even possible for e to be null?

  was:
{code:java}
    private void someMethod(){}
    private void falsePositive(){
        try{
            someMethod();
        }
        catch(RuntimeException e){
            if (e instanceof NullPointerException){
                throw e;
            }
            //false positive for possible null pointer
            Throwable cause = e.getCause();
        }
    }
{code}
Is it event possible for e to be null?


> False positive of possible null pointer derefernce in catch
> -----------------------------------------------------------
>
>                 Key: NETBEANS-734
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-734
>             Project: NetBeans
>          Issue Type: Bug
>          Components: java - Source
>    Affects Versions: 9.0
>            Reporter: Austin Stephens
>            Priority: Major
>
> {code:java}
>     private void someMethod(){}
>     private void falsePositive(){
>         try{
>             someMethod();
>         }
>         catch(RuntimeException e){
>             if (e instanceof NullPointerException){
>                 throw e;
>             }
>             //false positive for possible null pointer
>             Throwable cause = e.getCause();
>         }
>     }
> {code}
> Is it even possible for e to be null?



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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists