Buggy code:
public class DateFormatEvaluator extends Evaluator { public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss" ; Map < DateFormatEvaluator . DateFormatCacheKey , SimpleDateFormat > cache = new WeakHashMap < DateFormatEvaluator . DateFormatCacheKey , SimpleDateFormat > ( ) ; Map < String , Locale > availableLocales = new HashMap < String , Locale > ( ) ; class DateFormatCacheKey { DateFormatCacheKey ( Locale l , String df ) { } Locale locale ; String dateFormat ; } public DateFormatEvaluator ( ) { } @ Override public String evaluate ( String expression , Context context ) { List < Object > l = parseParams ( expression , context . getVariableResolver ( ) ) ; if ( ( ( l . size ( ) ) < 2 ) || ( ( l . size ( ) ) > 3 ) ) { throw new DataImportHandlerException ( DataImportHandlerException . SEVERE , "'formatDate()'<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>two<seq2seq4repair_space>or<seq2seq4repair_space>three<seq2seq4repair_space>parameters<seq2seq4repair_space>" ) ; } Object o = l . get ( 0 ) ; Object format = l . get ( 1 ) ; if ( format instanceof VariableWrapper ) { VariableWrapper wrapper = ( ( VariableWrapper ) ( format ) ) ; o = wrapper . resolve ( ) ; format = o . toString ( ) ; } Locale locale = Locale . ROOT ; if ( ( l . size ( ) ) == 3 ) { Object localeObj = l . get ( 2 ) ; String localeStr = null ; if ( localeObj instanceof VariableWrapper ) { VariableWrapper wrapper = ( ( VariableWrapper ) ( localeObj ) ) ; o = wrapper . resolve ( ) ; localeStr = o . toString ( ) ; } else { localeStr = localeObj . toString ( ) ; } <START_BUG> availableLocales . get ( localeStr ) ; <END_BUG> if ( locale == null ) { throw new DataImportHandlerException ( DataImportHandlerException . SEVERE , ( "Unsupported<seq2seq4repair_space>locale:<seq2seq4repair_space>" + localeStr ) ) ; } } String dateFmt = format . toString ( ) ; DateFormatEvaluator . DateFormatCacheKey dfck = new DateFormatEvaluator . DateFormatCacheKey ( locale , dateFmt ) ; SimpleDateFormat sdf = cache . get ( dfck ) ; if ( sdf == null ) { sdf = new SimpleDateFormat ( dateFmt , locale ) ; cache . put ( dfck , sdf ) ; } Date date = null ; if ( o instanceof VariableWrapper ) { VariableWrapper variableWrapper = ( ( VariableWrapper ) ( o ) ) ; Object variableval = variableWrapper . resolve ( ) ; if ( variableval instanceof Date ) { date = ( ( Date ) ( variableval ) ) ; } else { String s = variableval . toString ( ) ; try { dfck = new DateFormatEvaluator . DateFormatCacheKey ( locale , DateFormatEvaluator . DEFAULT_DATE_FORMAT ) ; sdf = cache . get ( dfck ) ; if ( sdf == null ) { sdf = new SimpleDateFormat ( dfck . dateFormat , dfck . locale ) ; cache . put ( dfck , sdf ) ; } date = new SimpleDateFormat ( DateFormatEvaluator . DEFAULT_DATE_FORMAT , locale ) . parse ( s ) ; } catch ( ParseException exp ) { DataImportHandlerException . wrapAndThrow ( DataImportHandlerException . SEVERE , exp , "Invalid<seq2seq4repair_space>expression<seq2seq4repair_space>for<seq2seq4repair_space>date" ) ; } } } else { String datemathfmt = o . toString ( ) ; datemathfmt = datemathfmt . replaceAll ( "NOW" , "" ) ; try { date = DateFormatEvaluator . getDateMathParser ( locale ) . parseMath ( datemathfmt ) ; } catch ( ParseException e ) { DataImportHandlerException . wrapAndThrow ( DataImportHandlerException . SEVERE , e , "Invalid<seq2seq4repair_space>expression<seq2seq4repair_space>for<seq2seq4repair_space>date" ) ; } } return sdf . format ( date ) ; } static DateMathParser getDateMathParser ( Locale l ) { } }

Fix:
locale = availableLocales . get ( localeStr ) ;