[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2542) NullPointerException in TypeFactory.replaceAssociations for ComponentType
Steve Ebersole (JIRA)
noreply at atlassian.com
Wed Apr 4 12:45:04 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_26632 ]
Steve Ebersole commented on HHH-2542:
-------------------------------------
need a test case reproducing this
> NullPointerException in TypeFactory.replaceAssociations for ComponentType
> -------------------------------------------------------------------------
>
> Key: HHH-2542
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2542
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.2.3
> Reporter: Reto Urfer
>
> The following code block will throw a NullPointerException when targetComponentValues should be determines and target[i] contains a NULL value.
> else if ( types[i].isComponentType() ) {
> // need to extract the component values and check for subtype replacements...
> AbstractComponentType componentType = ( AbstractComponentType ) types[i];
> Type[] subtypes = componentType.getSubtypes();
> Object[] origComponentValues = original[i] == null ? new Object[subtypes.length] : componentType.getPropertyValues( original[i], session );
> Object[] targetComponentValues = componentType.getPropertyValues( target[i], session );
> replaceAssociations( origComponentValues, targetComponentValues, subtypes, session, null, copyCache, foreignKeyDirection );
> This problem can be fixed the same way as it is prevented when origComponentValues are determined (see following line)
> Object[] targetComponentValues = target[i] == null ? new Object[subtypes.length] : componentType.getPropertyValues( target[i], session );
> copied[i] = target[i];
> }
> The problem did not exist in Version 3.2.2
--
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