You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "James Carman (JIRA)" <ji...@apache.org> on 2012/06/01 20:23:23 UTC

[jira] [Updated] (OPENJPA-2206) Bad practice - Method with Boolean return type returns explicit null

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

James Carman updated OPENJPA-2206:
----------------------------------

    Description: 
FindBugs is reporting this error on our enhanced classes.  The pcIsDetached() method appears to be the culprit.  Details about the error:

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. 

  was:
FindBugs is reporting this error on our enhanced classes.  Details about the error:

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. 

    
> Bad practice - Method with Boolean return type returns explicit null
> --------------------------------------------------------------------
>
>                 Key: OPENJPA-2206
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2206
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: Enhance
>    Affects Versions: 2.2.0
>            Reporter: James Carman
>
> FindBugs is reporting this error on our enhanced classes.  The pcIsDetached() method appears to be the culprit.  Details about the error:
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira