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: