question: protected void mergeCache ( List < OBJECT > objects ) { synchronized ( this ) { if ( this . objectList != null ) { objects = new ArrayList < > ( objects ) ; for ( int i = 0 ; i < objects . size ( ) ; i ++ ) { OBJECT newObject = objects . get ( i ) ; String newObjectName = getObjectName ( newObject ) ; for ( int k = 0 ; k < objectList . size ( ) ; k ++ ) { OBJECT oldObject = objectList . get ( k ) ; String oldObjectName = getObjectName ( oldObject ) ; if ( newObjectName . equals ( oldObjectName ) ) { objects . set ( i , oldObject ) ; break ; } } } } } setCache ( objects ) ; }
target:  Merges new cache with existing. If objects with the same name were already cached - leave them in cache (because they might be referenced somewhere).