=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java 2012-04-22 18:21:40 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java 2012-04-23 08:38:35 +0000 @@ -77,18 +77,45 @@ @Override public void save( IdentifiableObject object ) { - if ( objectStoreMap.get( object.getClass() ) != null ) - { - objectStoreMap.get( object.getClass() ).save( object ); + GenericIdentifiableObjectStore store = objectStoreMap.get( object.getClass() ); + + if ( store != null ) + { + store.save( object ); + } + else + { + log.warn( "No IdentifiableObject store found for " + object.getClass() + " (save)." ); } } @Override public void update( IdentifiableObject object ) { - if ( objectStoreMap.get( object.getClass() ) != null ) - { - objectStoreMap.get( object.getClass() ).update( object ); + GenericIdentifiableObjectStore store = objectStoreMap.get( object.getClass() ); + + if ( store != null ) + { + store.update( object ); + } + else + { + log.warn( "No IdentifiableObject store found for " + object.getClass() + " (update)." ); + } + } + + @Override + public void delete( IdentifiableObject object ) + { + GenericIdentifiableObjectStore store = objectStoreMap.get( object.getClass() ); + + if ( store != null ) + { + store.delete( object ); + } + else + { + log.warn( "No IdentifiableObject store found for " + object.getClass() + " (delete)." ); } } @@ -116,7 +143,7 @@ if ( store == null ) { - log.warn( "No IdentifiableObject store found for " + clazz + ", returning null." ); + log.warn( "No IdentifiableObject store found for " + clazz + ", returning null (getByCode)." ); return null; } @@ -132,7 +159,7 @@ if ( store == null ) { - log.warn( "No IdentifiableObject store found for " + clazz + ", returning null." ); + log.warn( "No IdentifiableObject store found for " + clazz + ", returning null (getByName)." ); return null; } @@ -148,7 +175,7 @@ if ( store == null ) { - log.warn( "No IdentifiableObject store found for " + clazz + ", returning empty collection." ); + log.warn( "No IdentifiableObject store found for " + clazz + ", returning empty collection (getAll)." ); return new ArrayList(); } @@ -156,11 +183,6 @@ return (Collection) store.getAll(); } - public void delete( IdentifiableObject object ) - { - objectStoreMap.get( object.getClass() ).delete( object ); - } - @Override @SuppressWarnings( "unchecked" ) public Map getIdMap( Class clazz, IdentifiableProperty property )