[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1488) ArrayIndexOOB exception: org.hibernate.event.def.DefaultFlushEntityEventListener:checkNaturalId(), line 79
Claus Nielsen (JIRA)
noreply at atlassian.com
Mon Oct 23 09:55:08 EDT 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1488?page=comments#action_24941 ]
Claus Nielsen commented on HHH-1488:
------------------------------------
Yes, hopefully it will.
I have the same problem with 3.2cr4.
> 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
> Type: Bug
> Components: core
> 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