Buggy code:
catch ( Exception e ) { DisplayStatisticsServlet . log . info ( ( ( "Error<seq2seq4repair_space>parsing<seq2seq4repair_space>the<seq2seq4repair_space>geographical<seq2seq4repair_space>order<seq2seq4repair_space>value<seq2seq4repair_space>\"" + orderGeo ) + "\"" ) ) ; } String ipRanges = request . getParameter ( "ipRanges" ) ; String author = request . getParameter ( "author" ) ; if ( "csv" . equals ( format ) ) { String section = request . getParameter ( "section" ) ; StatisticsBean exportBean = getExportBean ( context , section , dso , author , startDate , endDate , ipRanges , maxRows , orderColumn ) ; if ( exportBean == null ) { return ; } try { String [ ] [ ] matrix = exportBean . getMatrix ( ) ; response . setContentType ( "text//csv);<seq2seq4repair_space>charset=UTF-8" ) ; String filename = "placeholder" ; if ( handle != null ) { filename = ( ( ( handle . replaceAll ( "//" , "-" ) ) + "-" ) + ( exportBean . getName ( ) . toLowerCase ( ) . replaceAll ( "<seq2seq4repair_space>" , "-" ) ) ) + ".csv" ; } else { filename = ( exportBean . getName ( ) . toLowerCase ( ) . replaceAll ( "<seq2seq4repair_space>" , "-" ) ) + ".csv" ; } response . setHeader ( "Content-Disposition" , ( "attachment;<seq2seq4repair_space>filename=" + filename ) ) ; PrintWriter out = response . getWriter ( ) ; for ( int i = 0 ; i < ( matrix . length ) ; i ++ ) { String row = ( ( exportBean . getRowLabels ( ) . get ( i ) ) + ( DisplayStatisticsServlet . CSV_SEPARATOR ) ) + ( StringUtils . join ( matrix [ i ] , DisplayStatisticsServlet . CSV_SEPARATOR ) ) ; out . println ( row ) ; } out . flush ( ) ; out . close ( ) ; return ; } catch ( Exception e ) { DisplayStatisticsServlet . log . error ( "Error<seq2seq4repair_space>exporting<seq2seq4repair_space>to<seq2seq4repair_space>csv" , e ) ; } JSPManager . showInternalError ( request , response ) ; return ; } StatisticsBean statsVisits = null ; StatisticsBean statsMonthlyVisits = null ; StatisticsBean statsCountryVisits = null ; StatisticsBean statsTopAuthors = null ; StatisticsBean statsTopDownloads = null ; StatisticsBean statsTopItems = null ; StatisticsBean statsTopCollections = null ; StatisticsBean statsReferralSources = null ; StatisticsBean statsNewByCollection = null ; StatisticsBean statsNewByType = null ; StatisticsBean statsItemCount = null ; statsVisits = getVisits ( context , dso , startDate , endDate , ipRanges , author ) ; statsMonthlyVisits = getMonthlyVisits ( context , dso , startDate , endDate , ipRanges , author ) ; statsCountryVisits = getCountryVisits ( context , dso , startDate , endDate , ipRanges , author , maxRows , orderColumn ) ; if ( ( StringUtils . isEmpty ( author ) ) && ( ! ( ( dso != null ) && ( ( dso . getType ( ) ) == ( Constants . ITEM ) ) ) ) ) { statsTopAuthors = getTopAuthors ( context , dso , startDate , endDate , ipRanges , maxRows , orderColumn ) ; } statsTopDownloads = getTopDownloadsStatisticsBean ( context , dso , startDate , endDate , ipRanges , author ) ; if ( ! ( ( dso != null ) && ( ( dso . getType ( ) ) == ( Constants . ITEM ) ) ) ) { statsTopItems = getTopItemsStatisticsBean ( context , dso , startDate , endDate , ipRanges , author , maxRows , orderColumn ) ; } if ( ( ( StringUtils . isEmpty ( author ) ) && ( ! ( ( dso != null ) && ( ( dso . getType ( ) ) == ( Constants . ITEM ) ) ) ) ) && ( ! ( ( dso != null ) && ( ( dso . getType ( ) ) == ( Constants . COLLECTION ) ) ) ) ) { statsTopCollections = getTopCollectionsStatisticsBean ( context , dso , startDate , endDate , ipRanges , maxRows , orderColumn ) ; } statsReferralSources = getReferralSources ( context , dso , startDate , endDate , ipRanges , author ) ; <START_BUG> if ( ( ( dso == null ) || ( ( dso . getType ( ) ) == ( Constants . COMMUNITY ) ) ) || ( ( dso . getType ( ) ) == ( Constants . COLLECTION ) ) ) { <END_BUG> statsNewByCollection = getNewItemsByCollection ( context , dso , startDate , endDate ) ; statsNewByType = getNewItemsByType ( context , dso , startDate , endDate ) ; statsItemCount = getItemCounts ( context , dso , endDate ) ; } request . setAttribute ( "handle" , handle ) ; if ( dso != null ) { request . setAttribute ( "title" , dso . getName ( ) ) ; } else if ( ( author != null ) && ( ! ( "" . equals ( author ) ) ) ) { request . setAttribute ( "title" , author ) ; } else { request . setAttribute ( "title" , "Whole<seq2seq4repair_space>of<seq2seq4repair_space>Repository" ) ; } request . setAttribute ( "statsVisits" , statsVisits ) ; request . setAttribute ( "statsMonthlyVisits" , statsMonthlyVisits ) ; request . setAttribute ( "statsCountryVisits" , statsCountryVisits ) ; request . setAttribute ( "statsTopAuthors" , statsTopAuthors ) ; request . setAttribute ( "statsTopDownloads" , statsTopDownloads ) ; request . setAttribute ( "statsTopItems" , statsTopItems ) ; request . setAttribute ( "statsTopCollections" , statsTopCollections ) ; request . setAttribute ( "statsReferralSources" , statsReferralSources ) ; request . setAttribute ( "statsNewByCollection" , statsNewByCollection ) ; request . setAttribute ( "statsNewByType" , statsNewByType ) ; request . setAttribute ( "statsItemCount" , statsItemCount ) ; request . setAttribute ( "isItem" , isItem ) ; JSPManager . showJSP ( request , response , "display-statistics.jsp" ) ; } private StatisticsBean getExportBean ( Context context , String section , DSpaceObject dso , String author , Date startDate , Date endDate , String ipRanges , int maxRows , int orderColumn ) { }

Fix:
if ( ( author == null ) && ( ( ( dso == null ) || ( ( dso . getType ( ) ) == ( Constants . COMMUNITY ) ) ) || ( ( dso . getType ( ) ) == ( Constants . COLLECTION ) ) ) ) {