[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-6499) NPE can be thrown by some implementations of Helper.ValueSourcesAdapter.isIncludedInInsertByDefault() and isIncludedInUpdateByDefault()
Gail Badner (JIRA)
noreply at atlassian.com
Wed Jul 27 23:02:19 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gail Badner updated HHH-6499:
-----------------------------
Description:
In PropertyAttributeSourceImpl, implementations of Helper.ValueSourcesAdapter.isIncludedInInsertByDefault() and isIncludedInUpdateByDefault() can throw NullPointerException. This is because XMLPropertyElement.isInsert() and isUpdate() returns Boolean, which can be null.
In VersionAttributeSourceImpl implementation of Helper.ValueSourcesAdapter.isIncludedInInsertByDefault() can throw NullPointerException. This is because XMLHibernateMapping.XMLVersion.isInsert() returns Boolean, which can be null.
I see 2 alternatives for fixing this:
1) change XMLPropertyElement.isInsert(), XMLPropertyElement.isUpdate(), and XMLHibernateMapping.XMLVersion.isInsert() to return a boolean instead of Boolean, with a default of true;
2) change the implementations of Helper.ValueSourcesAdapter.isIncludedInInsertByDefault() and isIncludedInUpdateByDefault() in PropertyAttributeSourceImpl and VersionAttributeSourceImpl to return true when the delegated method returns null.
Which is more appropriate?
Assignee: (was: Gail Badner)
Summary: NPE can be thrown by some implementations of Helper.ValueSourcesAdapter.isIncludedInInsertByDefault() and isIncludedInUpdateByDefault() (was: Implementation of Helper.ValueSourcesAdapter in PropertyAttributeSourceImpl does not handle null returned by XMLPropertyElement.isInsert() or isUpdate())
> NPE can be thrown by some implementations of Helper.ValueSourcesAdapter.isIncludedInInsertByDefault() and isIncludedInUpdateByDefault()
> ---------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HHH-6499
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6499
> Project: Hibernate Core
> Issue Type: Bug
> Components: metamodel
> Reporter: Gail Badner
> Fix For: 4.0.0.next
>
>
> In PropertyAttributeSourceImpl, implementations of Helper.ValueSourcesAdapter.isIncludedInInsertByDefault() and isIncludedInUpdateByDefault() can throw NullPointerException. This is because XMLPropertyElement.isInsert() and isUpdate() returns Boolean, which can be null.
> In VersionAttributeSourceImpl implementation of Helper.ValueSourcesAdapter.isIncludedInInsertByDefault() can throw NullPointerException. This is because XMLHibernateMapping.XMLVersion.isInsert() returns Boolean, which can be null.
> I see 2 alternatives for fixing this:
> 1) change XMLPropertyElement.isInsert(), XMLPropertyElement.isUpdate(), and XMLHibernateMapping.XMLVersion.isInsert() to return a boolean instead of Boolean, with a default of true;
> 2) change the implementations of Helper.ValueSourcesAdapter.isIncludedInInsertByDefault() and isIncludedInUpdateByDefault() in PropertyAttributeSourceImpl and VersionAttributeSourceImpl to return true when the delegated method returns null.
> Which is more appropriate?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list