← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16383: update to spring 4.0.6

 

------------------------------------------------------------
revno: 16383
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-08-12 10:35:17 +0700
message:
  update to spring 4.0.6
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java
  dhis-2/pom.xml


--
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-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	2014-07-01 13:50:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java	2014-08-12 03:35:17 +0000
@@ -56,14 +56,14 @@
     private static final Log log = LogFactory.getLog( DefaultIdentifiableObjectManager.class );
 
     @Autowired
-    private Set<GenericIdentifiableObjectStore<IdentifiableObject>> identifiableObjectStores;
+    private Set<GenericIdentifiableObjectStore<? extends IdentifiableObject>> identifiableObjectStores;
 
     @Autowired
-    private Set<GenericNameableObjectStore<NameableObject>> nameableObjectStores;
-
-    private Map<Class<IdentifiableObject>, GenericIdentifiableObjectStore<IdentifiableObject>> identifiableObjectStoreMap;
-
-    private Map<Class<NameableObject>, GenericNameableObjectStore<NameableObject>> nameableObjectStoreMap;
+    private Set<GenericNameableObjectStore<? extends NameableObject>> nameableObjectStores;
+
+    private Map<Class<? extends IdentifiableObject>, GenericIdentifiableObjectStore<? extends IdentifiableObject>> identifiableObjectStoreMap;
+
+    private Map<Class<? extends NameableObject>, GenericNameableObjectStore<? extends NameableObject>> nameableObjectStoreMap;
 
     //--------------------------------------------------------------------------
     // IdentifiableObjectManager implementation
@@ -120,7 +120,7 @@
     @SuppressWarnings("unchecked")
     public <T extends IdentifiableObject> T get( String uid )
     {
-        for ( GenericIdentifiableObjectStore<IdentifiableObject> store : identifiableObjectStores )
+        for ( GenericIdentifiableObjectStore<? extends IdentifiableObject> store : identifiableObjectStores )
         {
             T object = (T) store.getByUid( uid );
 
@@ -509,7 +509,7 @@
     @Override
     public IdentifiableObject getObject( String uid, String simpleClassName )
     {
-        for ( GenericIdentifiableObjectStore<IdentifiableObject> objectStore : identifiableObjectStores )
+        for ( GenericIdentifiableObjectStore<? extends IdentifiableObject> objectStore : identifiableObjectStores )
         {
             if ( simpleClassName.equals( objectStore.getClazz().getSimpleName() ) )
             {
@@ -523,7 +523,7 @@
     @Override
     public IdentifiableObject getObject( int id, String simpleClassName )
     {
-        for ( GenericIdentifiableObjectStore<IdentifiableObject> objectStore : identifiableObjectStores )
+        for ( GenericIdentifiableObjectStore<? extends IdentifiableObject> objectStore : identifiableObjectStores )
         {
             if ( simpleClassName.equals( objectStore.getClazz().getSimpleName() ) )
             {
@@ -580,7 +580,7 @@
     {
         initMaps();
 
-        GenericIdentifiableObjectStore<IdentifiableObject> store = identifiableObjectStoreMap.get( clazz );
+        GenericIdentifiableObjectStore<? extends IdentifiableObject> store = identifiableObjectStoreMap.get( clazz );
 
         if ( store == null )
         {
@@ -592,14 +592,14 @@
             }
         }
 
-        return store;
+        return (GenericIdentifiableObjectStore<IdentifiableObject>) store;
     }
 
     private <T extends NameableObject> GenericNameableObjectStore<NameableObject> getNameableObjectStore( Class<T> clazz )
     {
         initMaps();
 
-        GenericNameableObjectStore<NameableObject> store = nameableObjectStoreMap.get( clazz );
+        GenericNameableObjectStore<? extends NameableObject> store = nameableObjectStoreMap.get( clazz );
 
         if ( store == null )
         {
@@ -611,7 +611,7 @@
             }
         }
 
-        return store;
+        return (GenericNameableObjectStore<NameableObject>) store;
     }
 
     private void initMaps()
@@ -621,16 +621,16 @@
             return; // Already initialized
         }
 
-        identifiableObjectStoreMap = new HashMap<Class<IdentifiableObject>, GenericIdentifiableObjectStore<IdentifiableObject>>();
+        identifiableObjectStoreMap = new HashMap<>();
 
-        for ( GenericIdentifiableObjectStore<IdentifiableObject> store : identifiableObjectStores )
+        for ( GenericIdentifiableObjectStore<? extends IdentifiableObject> store : identifiableObjectStores )
         {
             identifiableObjectStoreMap.put( store.getClazz(), store );
         }
 
-        nameableObjectStoreMap = new HashMap<Class<NameableObject>, GenericNameableObjectStore<NameableObject>>();
+        nameableObjectStoreMap = new HashMap<>();
 
-        for ( GenericNameableObjectStore<NameableObject> store : nameableObjectStores )
+        for ( GenericNameableObjectStore<? extends NameableObject> store : nameableObjectStores )
         {
             nameableObjectStoreMap.put( store.getClazz(), store );
         }

=== modified file 'dhis-2/pom.xml'
--- dhis-2/pom.xml	2014-07-30 09:06:45 +0000
+++ dhis-2/pom.xml	2014-08-12 03:35:17 +0000
@@ -1024,7 +1024,7 @@
   <properties>
     <rootDir></rootDir>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <spring.version>3.2.10.RELEASE</spring.version>
+    <spring.version>4.0.6.RELEASE</spring.version>
     <spring.security.version>3.2.4.RELEASE</spring.security.version>
     <hibernate.version>4.2.0.Final</hibernate.version>
     <hibernate-validator.version>4.3.1.Final</hibernate-validator.version>