[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-1488) ArrayIndexOOB exception: org.hibernate.event.def.DefaultFlushEntityEventListener:checkNaturalId(), line 79
Gail Badner (JIRA)
noreply at atlassian.com
Fri Aug 24 14:24:57 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gail Badner resolved HHH-1488.
------------------------------
Resolution: Duplicate
Closing as a duplicate of HHH-1569.
> ArrayIndexOOB exception: org.hibernate.event.def.DefaultFlushEntityEventListener:checkNaturalId(), line 79
> ----------------------------------------------------------------------------------------------------------
>
> Key: HHH-1488
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1488
> Project: Hibernate3
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: Windows, Sun 1.5 JDK, Hibernate 3.1.2, Oracle 9i
> Reporter: Dave Nebinger
>
> The checkNaturalId() method has a bug. Basically it's using "loaded[prop]" in the isEqual() method call but it should be using "loaded[i]".
> The value for prop is the index into the array of properties for the entity where the natural key is. The value for i is the index in the loaded[] array that is being checked. In my case I've got a single natural key so loaded[0] equals the natural key value, but it is located at position 1 in the properties[15] array.
> The full line, "if ( !types[prop].isEqual( current[prop], loaded[prop], entityMode ) ) {" throws ArrayIndexOOB exception since prop is 1 but only loaded[0] (i) is valid.
> The fix is quite simple, just change the line to read: "if ( !types[prop].isEqual( current[prop], loaded[i], entityMode ) ) {"
--
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