JPASupport.edit() doesn't handle fileds in super class

Bug #467923 reported by true_cp
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

play version: 1.0

play.db.jpa.JPASupport.edit() doesn't handle fileds in super class:

Original Code:
line 66:
            for (Field field : o.getClass().getDeclaredFields()) {
                ......
            }

Fixed Code:
line 66:
            Set<Field> fields = new HashSet<Field>();
            Class clazz = o.getClass();
            while (!clazz.equals(Model.class)) {
                Collections.addAll(fields, clazz.getDeclaredFields());
                clazz = clazz.getSuperclass();
            }

            // relations
            for (Field field : fields) {
                ......
            }

Changed in play:
status: New → Confirmed
Changed in play:
status: Confirmed → Fix Committed
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.