@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) protected Object manageMapIfNecessary ( Object value ) { Map map = ( Map ) value ; boolean containsRuntimeRefs = false ; for ( Object e : map . values ( ) ) { if ( e instanceof RuntimeBeanReference ) { containsRuntimeRefs = true ; break ; } } if ( containsRuntimeRefs ) { Map managedMap = new ManagedMap ( ) ; managedMap . putAll ( map ) ; return managedMap ; } return value ; }
Checks whether there are any runtime refs inside a Map and converts it to a ManagedMap if necessary .