protected List convertToBusinessObjectAndWrapInList ( Object o , Extractor [ ] extractors , Timestamp [ ] asOfDates , boolean weak , boolean isLocked ) { if ( ! ( o instanceof List ) ) { if ( o == null ) { return ListFactory . EMPTY_LIST ; } MithraDataObject data = ( MithraDataObject ) o ; this . extractTimestampsFromData ( data , extractors , asOfDates ) ; return ListFactory . create ( this . getBusinessObjectFromData ( data , asOfDates , getNonDatedPkHashCode ( data ) , weak , isLocked ) ) ; } else { List result = ( List ) o ; boolean perData = isExtractorPerData ( extractors , asOfDates ) ; if ( ! perData && MithraCpuBoundThreadPool . isParallelizable ( result . size ( ) ) ) { convertToBusinessObjectsInParallel ( result , asOfDates , weak ) ; } else { for ( int i = 0 ; i < result . size ( ) ; i ++ ) { MithraDataObject data = ( MithraDataObject ) result . get ( i ) ; if ( perData ) this . extractTimestampsFromData ( data , extractors , asOfDates ) ; result . set ( i , this . getBusinessObjectFromData ( data , asOfDates , getNonDatedPkHashCode ( data ) , weak , isLocked ) ) ; } } return result ; } }
if o is a list we do the conversion in place