Buggy code:
public class NorgastCommonScriptletRPackage extends JRDefaultScriptlet { protected RConnection rconn ; private String fileName ; static Logger log = Logger . getLogger ( "report" ) ; public void setFileName ( String fileName ) { } public String getFileName ( ) { } public void afterReportInit ( ) throws JRScriptletException { } @ SuppressWarnings ( "unchecked" ) private void generateReport ( ) { try { <START_BUG> NorgastCommonScriptletRPackage . log . info ( ( "Start<seq2seq4repair_space>generating<seq2seq4repair_space>R<seq2seq4repair_space>report<seq2seq4repair_space>using<seq2seq4repair_space>" + ( NorgastCommonScriptlet . class . getName ( ) ) ) ) ; <END_BUG> NorgastCommonScriptletRPackage . log . debug ( "Getting<seq2seq4repair_space>connection<seq2seq4repair_space>to<seq2seq4repair_space>R<seq2seq4repair_space>instance..." ) ; rconn = new RConnection ( ) ; NorgastCommonScriptletRPackage . log . debug ( ( "R<seq2seq4repair_space>connection<seq2seq4repair_space>provided:<seq2seq4repair_space>" + ( rconn . toString ( ) ) ) ) ; String loggedInUserFullName = "" ; String loggedInUserAVD_RESH = "" ; String reportName = "" ; String rFunctionCallString = "" ; try { loggedInUserFullName = ( ( String ) ( ( ( JRFillParameter ) ( parametersMap . get ( "LoggedInUserFullName" ) ) ) . getValue ( ) ) ) ; loggedInUserAVD_RESH = ( ( String ) ( ( ( JRFillParameter ) ( parametersMap . get ( "LoggedInUserAVD_RESH" ) ) ) . getValue ( ) ) ) ; reportName = ( ( String ) ( ( ( JRFillParameter ) ( parametersMap . get ( "reportName" ) ) ) . getValue ( ) ) ) ; rFunctionCallString = ( ( String ) ( ( ( JRFillParameter ) ( parametersMap . get ( "rFunctionCallString" ) ) ) . getValue ( ) ) ) ; NorgastCommonScriptletRPackage . log . info ( ( "Report<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>run:<seq2seq4repair_space>" + reportName ) ) ; NorgastCommonScriptletRPackage . log . info ( ( ( ( "Report<seq2seq4repair_space>requested<seq2seq4repair_space>by<seq2seq4repair_space>JRS<seq2seq4repair_space>user<seq2seq4repair_space>" + loggedInUserFullName ) + ",<seq2seq4repair_space>AVD_RESH<seq2seq4repair_space>" ) + loggedInUserAVD_RESH ) ) ; NorgastCommonScriptletRPackage . log . debug ( ( "R<seq2seq4repair_space>function<seq2seq4repair_space>call<seq2seq4repair_space>string:<seq2seq4repair_space>" + rFunctionCallString ) ) ; rconn . voidEval ( ( "reshID=" + loggedInUserAVD_RESH ) ) ; } catch ( Exception e ) { NorgastCommonScriptletRPackage . log . error ( ( "Mandatory<seq2seq4repair_space>parameters<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>report<seq2seq4repair_space>definition<seq2seq4repair_space>calling<seq2seq4repair_space>this<seq2seq4repair_space>scriptlet<seq2seq4repair_space>were<seq2seq4repair_space>not<seq2seq4repair_space>defined:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } String rPackageName ; try { rPackageName = ( ( String ) ( ( ( JRFillParameter ) ( parametersMap . get ( "rPackageName" ) ) ) . getValue ( ) ) ) ; if ( ( rPackageName == null ) || ( rPackageName == "" ) ) { rPackageName = "" ; NorgastCommonScriptletRPackage . log . warn ( "Parameter<seq2seq4repair_space>rPackageName<seq2seq4repair_space>is<seq2seq4repair_space>empty.<seq2seq4repair_space>No<seq2seq4repair_space>R<seq2seq4repair_space>package<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>loaded" ) ; } else { NorgastCommonScriptletRPackage . log . info ( ( "Package<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>loaded<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>R<seq2seq4repair_space>session:<seq2seq4repair_space>" + rPackageName ) ) ; rconn . voidEval ( ( ( "require(" + rPackageName ) + ")" ) ) ; } } catch ( Exception e ) { NorgastCommonScriptletRPackage . log . warn ( ( "No<seq2seq4repair_space>package<seq2seq4repair_space>loaded<seq2seq4repair_space>in<seq2seq4repair_space>R<seq2seq4repair_space>session:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } String varName ; try { NorgastCommonScriptletRPackage . log . debug ( "Getting<seq2seq4repair_space>parameter<seq2seq4repair_space>values" ) ; varName = ( ( String ) ( ( ( JRFillParameter ) ( parametersMap . get ( "varName" ) ) ) . getValue ( ) ) ) ; if ( varName == null ) { varName = "nada" ; } rconn . voidEval ( ( ( ( "valgtVar=" + "'" ) + varName ) + "'" ) ) ; } catch ( Exception e ) { NorgastCommonScriptletRPackage . log . debug ( ( "Parameter<seq2seq4repair_space>varName<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>defined:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } String statMeasureMethod ; try { statMeasureMethod = ( ( String ) ( ( ( JRFillParameter ) ( parametersMap . get ( "statMeasureMethod" ) ) ) . getValue ( ) ) ) ; if ( statMeasureMethod == null ) { statMeasureMethod = "Gjsn" ; } rconn . voidEval ( ( ( ( "valgtMaal=" + "'" ) + ( statMeasureMethod . toString ( ) ) ) + "'" ) ) ; } catch ( Exception e ) { NorgastCommonScriptletRPackage . log . debug ( ( "Parameter<seq2seq4repair_space>statMeasureMethod<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>defined:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } Integer minAge ; try { minAge = ( ( Integer ) ( ( ( JRFillParameter ) ( parametersMap . get ( "minAge" ) ) ) . getValue ( ) ) ) ; if ( minAge == null ) { minAge = 0 ; } rconn . voidEval ( ( "minald=" + ( minAge . toString ( ) ) ) ) ; } catch ( Exception e ) { NorgastCommonScriptletRPackage . log . debug ( ( "Parameter<seq2seq4repair_space>minAge<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>defined:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } Integer maxAge ; try { maxAge = ( ( Integer ) ( ( ( JRFillParameter ) ( parametersMap . get ( "maxAge" ) ) ) . getValue ( ) ) ) ; if ( maxAge == null ) { maxAge = 130 ; } rconn . voidEval ( ( "maxald=" + ( maxAge . toString ( ) ) ) ) ; } catch ( Exception e ) { NorgastCommonScriptletRPackage . log . debug ( ( "Parameter<seq2seq4repair_space>maxAge<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>defined:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } SimpleDateFormat rFormat = new SimpleDateFormat ( "yyyy-MM-dd" ) ; Date beginDate ; try { beginDate = ( ( Date ) ( ( ( JRFillParameter ) ( parametersMap . get ( "beginDate" ) ) ) . getValue ( ) ) ) ; if ( beginDate == null ) { beginDate = new SimpleDateFormat ( "yyyy-MM-dd" ) . parse ( "2010-01-01" ) ; } StringBuilder beginDateString = new StringBuilder ( rFormat . format ( beginDate ) ) ; rconn . voidEval ( ( ( ( "datoFra=" + "'" ) + beginDateString ) + "'" ) ) ; } catch ( Exception e ) { NorgastCommonScriptletRPackage . log . debug ( ( "Parameter<seq2seq4repair_space>beginDate<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>defined:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } Date endDate ; try { endDate = ( ( Date ) ( ( ( JRFillParameter ) ( parametersMap . get ( "endDate" ) ) ) . getValue ( ) ) ) ; if ( endDate == null ) { endDate = new Date ( ) ; }

Fix:
NorgastCommonScriptletRPackage . log . info ( ( "Start<seq2seq4repair_space>generating<seq2seq4repair_space>R<seq2seq4repair_space>report<seq2seq4repair_space>using<seq2seq4repair_space>" + ( NorgastCommonScriptletRPackage . class . getName ( ) ) ) ) ;