Source:
public synchronized int generate( final MasterReport report, final int acceptedPage, final OutputStream outputStream, final int yieldRate ) throws ReportProcessingException, IOException, ContentIOException { if ( acceptedPage < 0 ) { return generateNonCaching( report, acceptedPage, outputStream, yieldRate ); } try { String key = report.getContentCacheKey(); if ( key == null ) { key = createKey( report ); } final IReportContent cachedContent = getCachedContent( key ); if ( cachedContent == null ) { logger.warn( "No cached content found for key: " + key ); final IReportContent freshCache = regenerateCache( report, yieldRate, key, acceptedPage ); final byte[] pageData = freshCache.getPageData( acceptedPage ); outputStream.write( pageData ); outputStream.flush(); return freshCache.getPageCount(); } final byte[] page = cachedContent.getPageData( acceptedPage ); if ( page != null && page.length > 0 ) { logger.warn( "Using cached report data for " + key ); final ReportProgressListener listener = ReportListenerThreadHolder.getListener(); if ( listener != null ) { final ReportProgressEvent event = new ReportProgressEvent( "Cache", ReportProgressEvent.GENERATING_CONTENT, 0, 0, acceptedPage + 1, cachedContent.getPageCount(), 0, 0 ); listener.reportProcessingUpdate( event ); listener.reportProcessingFinished( event ); } outputStream.write( page ); outputStream.flush(); return cachedContent.getPageCount(); } final IReportContent data = regenerateCache( report, yieldRate, key, acceptedPage ); outputStream.write( data.getPageData( acceptedPage ) ); outputStream.flush(); return data.getPageCount(); } catch ( final CacheKeyException e ) { return generateNonCaching( report, acceptedPage, outputStream, yieldRate ); } }

Target:
public synchronized int generate( final MasterReport report, final int acceptedPage, final OutputStream outputStream, final int yieldRate ) throws ReportProcessingException, IOException, ContentIOException { if ( acceptedPage < 0 ) { return generateNonCaching( report, acceptedPage, outputStream, yieldRate ); } try { String key = report.getContentCacheKey(); if ( key == null ) { key = createKey( report ); } final IReportContent cachedContent = getCachedContent( key ); if ( cachedContent == null ) { logger.warn( "No cached content found for key: " + key ); final IReportContent freshCache = regenerateCache( report, yieldRate, key, acceptedPage ); final byte[] pageData = freshCache.getPageData( acceptedPage ); outputStream.write( pageData ); outputStream.flush(); return freshCache.getPageCount(); } final byte[] page = cachedContent.getPageData( acceptedPage ); if ( page != null && page.length > 0 ) { logger.warn( "Using cached report data for " + key ); final ReportProgressListener listener = ReportListenerThreadHolder.getListener(); if ( listener != null ) { final ReportProgressEvent event = new ReportProgressEvent( this, ReportProgressEvent.GENERATING_CONTENT, 0, 0, acceptedPage + 1, cachedContent.getPageCount(), 0, 0 ); listener.reportProcessingUpdate( event ); listener.reportProcessingFinished( event ); } outputStream.write( page ); outputStream.flush(); return cachedContent.getPageCount(); } final IReportContent data = regenerateCache( report, yieldRate, key, acceptedPage ); outputStream.write( data.getPageData( acceptedPage ) ); outputStream.flush(); return data.getPageCount(); } catch ( final CacheKeyException e ) { return generateNonCaching( report, acceptedPage, outputStream, yieldRate ); } }