|
[
Permalink
| « Hide
]
Max Rydahl Andersen added a comment - 07/Apr/06 01:55 AM
higher priority - need to apply to proper 3.2 branch too.
Patch that implements that
You don't strictly really need the null check either. The instanceof operator handles null. i.e. the following will work just fine.
if(o instanceof FastClass) { return this.type.equals(((FastClass)o).type); } return false; // if o is null, we'll return false greg: no, null instanceof X is always true.
scratch that - i negated one time to many ;)
instanceof X will return false if X is null.
I tried modifying org.hibernate.test.bytecode.BytecodeSuite (really org.hibernate.test.bytecode.javassist.ReflectionOptimizerTest.suite()) to recreate this bug but couldn't trigger FastClass.equals.
I know that equals wasn't called because the call to Thread.dumpStack that I added didn't show up in the output. Yes, I'm removing the call to dumpstack. ;) I ran ./build.sh junitreport with and without the patch. The patch doesn't cause impact the success or failures of any current tests. Its not clear to me if the FastClass.exist is exposed to client code, but lets apply the fix anyway.
Fix checked into trunk revision 10993. Fix also checked into Branch_3_2 revision 10998.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||