changes for gbif/abcd import from webservice
[taxeditor.git] / eu.etaxonomy.taxeditor.cdmlib / src / main / java / eu / etaxonomy / taxeditor / remoting / cache / CacheLoader.java
index c99ce01b646bc73feed2bcbf36485ad9210d103b..7faec2c9ad514e24af5684aa2d54eeb4d02e7ba9 100644 (file)
@@ -71,8 +71,8 @@ public class CacheLoader {
         } else if (obj instanceof Collection) {
             return (T) load((Collection<T>)obj, recursive, update);
         } else if(obj instanceof Pager) {
-             load(((Pager)obj).getRecords(), recursive, update);
-             return obj;
+               load(((Pager)obj).getRecords(), recursive, update);
+            return obj;
         } else if(obj instanceof MergeResult) {
             return (T) load((MergeResult<CdmBase>)obj, recursive, update);
         }
@@ -153,7 +153,7 @@ public class CacheLoader {
         return map;
     }
 
-    public <T extends Object> Collection<T> load(Collection<T> collection, boolean recursive, boolean update){
+    public <T extends Object> Collection<T> load(Collection<T> collection,  boolean recursive, boolean update){
 
         Collection<T> loadedCollection;
         if(isRecursiveEnabled && recursive) {
@@ -355,7 +355,7 @@ public class CacheLoader {
                     CdmBase cachedCdmEntityInSubGraph = cdmCacher.getFromCache(cdmEntityInSubGraph);
 
                     if(cachedCdmEntityInSubGraph != null) {
-                        if(cachedCdmEntityInSubGraph != cdmEntityInSubGraph) {
+                        if(!cachedCdmEntityInSubGraph.equals(cdmEntityInSubGraph)) {
                             // exception : is the case where
                             // the field has been already initialised, cached and
                             // is not the same as the one in the cache, in which case we set the value