[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4971) Findbugs Warnings

Gail Badner (JIRA) noreply at atlassian.com
Wed Apr 21 18:59:36 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=36606#action_36606 ] 

Gail Badner commented on HHH-4971:
----------------------------------

The lines numbers have changed, but I think I see the problem in StatefulPersistenceContext getNaturalIdSnapshot:

Object[] entitySnapshot = getDatabaseSnapshot( id, persister );
if ( entitySnapshot == NO_ROW ) {
	return null;
}

entitySnapshot is Object[]
NO_ROW is a MarkerObject

As you say, entitySnapshot will never be equal to NO_ROW.

It looks like the code should be:

Object[] entitySnapshot = getDatabaseSnapshot( id, persister );
if ( entitySnapshot == null ) {
	return null;
}

> Findbugs Warnings
> -----------------
>
>                 Key: HHH-4971
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4971
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.0.Beta-1
>            Reporter: Marco Tulio Valente
>            Priority: Minor
>
> Dear all,
> We are conducting a study about the relevance of the warnings reported by the FindBugs tool when executed over several open-source systems.
> Particularly, in the case of Hibernate, we would like to confirm the relevance of the following warning reported by the tool (for version 3.5.0.beta1):
> Location: org.hibernate.engine.StatefulPersistenceContext getNaturalIdSnapshot - Line: 298
> Warning: Using pointer equality to compare different types. The method uses using pointer equality to compare two references that seem to be of different types. The result of this comparison will always be false at runtime.
> Since this warning seemed relevant to us, we would like to confirm our classification with Hibernate's developers. 
> Best regards,
> Marco Tulio Valente
> Brazil

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list