JPASupport equals

Bug #556300 reported by Alexander Strebkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
play framework
Status tracked in 1.0
1.0
Fix Released
Undecided
Unassigned
1.1
Fix Committed
Undecided
Unassigned

Bug Description

Sometimes models being compared have different classes, for example:

this.getClass() is "models.Country"
but other.getClass() is "models.Country_$$_javassist_5"

in such a case this part of JPASupport.equals() method will return false:

        if (!(this.getClass().equals(other.getClass()))) {
            return false;
        }

Found the following blog entry describing similar problem and how to fix it:
http://brandon.fuller.name/archives/2009/03/17/16.37.41/
So above condition should be replaced with something like:

        if (!this.getClass().isAssignableFrom(other.getClass())) {
            return false;
        }

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.