Bug in dirty checking of Entities with char[]
---------------------------------------------
Key: HHH-3009
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3009
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.3
Environment: Hibernate 3.2.3 Oracle 10g
Reporter: Michael Plöd
I guess that I found a bug in the dirty checking of properties of type char[]. Every
entity containing a property of type char[] will be treated as a dirty one.
The reason for this is that neither the CharacterArrayType nor the AbstractCharArrayType
override the isDirty Method. This means that the isDirty method of AbstractType will be
used. Unfortunately this method finally calls (through isSame, isEqual)
EqualsHelper.equals(x, y) which would compare the char[] like this:
public static boolean equals(Object x, Object y) {
return x==y || ( x!=null && y!=null && x.equals(y) );
}
This results in every char[] to be treated dirty since char[] can't implement
equals().
In my opinion this behavior is wrong. I think that the AbstractCharArrayType should have
an isDirty method which performs an equals check through Arrays.equals(...).
If needed I can provide a test case and a bug fix for this!
Cheers,
Mike
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira