← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13854: minor fix to hibernate eventlistener

 

------------------------------------------------------------
revno: 13854
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-01-27 12:23:09 +0700
message:
  minor fix to hibernate eventlistener
modified:
  dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateEventListenerWiring.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateEventListenerWiring.java'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateEventListenerWiring.java	2014-01-27 04:59:20 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateEventListenerWiring.java	2014-01-27 05:23:09 +0000
@@ -65,7 +65,7 @@
     private Set<IdentifiableObject> identifiableObjects = new HashSet<IdentifiableObject>();
 
     @PostConstruct
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings( "unchecked" )
     public void registerListeners()
     {
         EventListenerRegistry registry = ((SessionFactoryImpl) sessionFactory).getServiceRegistry()
@@ -105,11 +105,11 @@
                     }
                 }
 
-                if ( Map.class.isInstance( oldValue ) )
+                Map map = (Map) oldValue;
+
+                for ( Object o : map.keySet() )
                 {
-                    Map map = (Map) oldValue;
-
-                    for ( Object o : map.keySet() )
+                    if ( o instanceof IdentifiableObject )
                     {
                         oldCol.add( o );
                     }