Program: 117879
Project: 117879
Buggy source:
@Override public IProcessor generateJobFiles(IProgressMonitor monitor) throws Exception {
  LastGenerationInfo.getInstance().getUseDynamicMap().clear();
  LastGenerationInfo.getInstance().getUseRulesMap().clear();
  final Map<String,Object> argumentsMap=new HashMap<String,Object>(getArguments());
  argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_APPLY_CONTEXT_TO_CHILDREN,isOptionChoosed(ExportChoice.applyToChildren));
  argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_STATS,isOptionChoosed(ExportChoice.addStatistics));
  argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_TRACS,isOptionChoosed(ExportChoice.addTracs));
  Properties prop=(Properties)exportChoice.get(ExportChoice.properties);
  if (prop != null) {
    Enumeration<Object> keys=prop.keys();
    while (keys.hasMoreElements()) {
      String key=keys.nextElement().toString();
      String value=prop.get(key) == null ? null : prop.get(key).toString();
      argumentsMap.put(key,value);
    }
  }
  boolean needContext=isOptionChoosed(ExportChoice.needContext);
  if (needContext) {
    argumentsMap.put(TalendProcessArgumentConstant.ARG_NEED_CONTEXT,needContext);
    Object context=this.exportChoice.get(ExportChoice.contextName);
    if (context == null) {
      context=this.contextName;
    }
    argumentsMap.put(TalendProcessArgumentConstant.ARG_CONTEXT_NAME,context);
  }
  boolean onlyDefaultContext=isOptionChoosed(ExportChoice.onlyDefautContext);
  if (onlyDefaultContext) {
    argumentsMap.put(TalendProcessArgumentConstant.ARG_ONLY_DEFAUT_CONTEXT,onlyDefaultContext);
  }
  boolean needParamValues=isOptionChoosed(ExportChoice.needParameterValues);
  if (needParamValues) {
    argumentsMap.put(TalendProcessArgumentConstant.ARG_CONTEXT_PARAMS,this.exportChoice.get(ExportChoice.parameterValuesList));
  }
  boolean log4jEnable=isLog4jEnable();
  argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_LOG4J,log4jEnable);
  if (log4jEnable) {
    boolean needLog4jLevel=isOptionChoosed(ExportChoice.needLog4jLevel);
    if (needLog4jLevel) {
      argumentsMap.put(TalendProcessArgumentConstant.ARG_NEED_LOG4J_LEVEL,needLog4jLevel);
      argumentsMap.put(TalendProcessArgumentConstant.ARG_LOG4J_LEVEL,this.exportChoice.get(ExportChoice.log4jLevel));
    }
  }
  int generationOption=(isOptionChoosed(ExportChoice.includeTestSource) || isOptionChoosed(ExportChoice.executeTests)) ? ProcessorUtilities.GENERATE_ALL_CHILDS | ProcessorUtilities.GENERATE_TESTS : ProcessorUtilities.GENERATE_ALL_CHILDS;
  if (isOptionChoosed(ExportChoice.doNotCompileCode)) {
    generationOption=generationOption | ProcessorUtilities.GENERATE_WITHOUT_COMPILING;
  }
  argumentsMap.put(TalendProcessArgumentConstant.ARG_GENERATE_OPTION,generationOption);
  String deployVersion=(String)exportChoice.get(ExportChoice.deployVersion);
  if (deployVersion != null) {
    argumentsMap.put(TalendProcessArgumentConstant.ARG_DEPLOY_VERSION,deployVersion);
  }
  try {
    IProcessor processor=ProcessorUtilities.generateCode(processItem,contextName,version,argumentsMap,monitor);
    return processor;
  }
  finally {
    ProcessorUtilities.resetExportConfig();
  }
}

Fixed version (ground truth):
@Override public IProcessor generateJobFiles(IProgressMonitor monitor) throws Exception {
  LastGenerationInfo.getInstance().getUseDynamicMap().clear();
  LastGenerationInfo.getInstance().getUseRulesMap().clear();
  final Map<String,Object> argumentsMap=new HashMap<String,Object>(getArguments());
  argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_APPLY_CONTEXT_TO_CHILDREN,isOptionChoosed(ExportChoice.applyToChildren));
  argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_STATS,isOptionChoosed(ExportChoice.addStatistics));
  argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_TRACS,isOptionChoosed(ExportChoice.addTracs));
  Properties prop=(Properties)exportChoice.get(ExportChoice.properties);
  if (prop != null) {
    Enumeration<Object> keys=prop.keys();
    while (keys.hasMoreElements()) {
      String key=keys.nextElement().toString();
      String value=prop.get(key) == null ? null : prop.get(key).toString();
      argumentsMap.put(key,value);
    }
  }
  boolean needContext=isOptionChoosed(ExportChoice.needContext);
  if (needContext) {
    argumentsMap.put(TalendProcessArgumentConstant.ARG_NEED_CONTEXT,needContext);
    Object context=this.exportChoice.get(ExportChoice.contextName);
    if (context == null) {
      context=this.contextName;
    }
    argumentsMap.put(TalendProcessArgumentConstant.ARG_CONTEXT_NAME,context);
  }
  boolean onlyDefaultContext=isOptionChoosed(ExportChoice.onlyDefautContext);
  if (onlyDefaultContext) {
    argumentsMap.put(TalendProcessArgumentConstant.ARG_ONLY_DEFAUT_CONTEXT,onlyDefaultContext);
  }
  boolean needParamValues=isOptionChoosed(ExportChoice.needParameterValues);
  if (needParamValues) {
    argumentsMap.put(TalendProcessArgumentConstant.ARG_CONTEXT_PARAMS,this.exportChoice.get(ExportChoice.parameterValuesList));
  }
  boolean log4jEnable=isLog4jEnable();
  argumentsMap.put(TalendProcessArgumentConstant.ARG_ENABLE_LOG4J,log4jEnable);
  if (log4jEnable) {
    boolean needLog4jLevel=isOptionChoosed(ExportChoice.needLog4jLevel);
    if (needLog4jLevel) {
      argumentsMap.put(TalendProcessArgumentConstant.ARG_NEED_LOG4J_LEVEL,needLog4jLevel);
      argumentsMap.put(TalendProcessArgumentConstant.ARG_LOG4J_LEVEL,this.exportChoice.get(ExportChoice.log4jLevel));
    }
  }
  int generationOption=(isOptionChoosed(ExportChoice.includeTestSource) || isOptionChoosed(ExportChoice.executeTests)) ? ProcessorUtilities.GENERATE_ALL_CHILDS | ProcessorUtilities.GENERATE_TESTS : ProcessorUtilities.GENERATE_ALL_CHILDS;
  if (isOptionChoosed(ExportChoice.doNotCompileCode)) {
    generationOption=generationOption | ProcessorUtilities.GENERATE_WITHOUT_COMPILING;
  }
  argumentsMap.put(TalendProcessArgumentConstant.ARG_GENERATE_OPTION,generationOption);
  String deployVersion=(String)exportChoice.get(ExportChoice.deployVersion);
  if (deployVersion != null) {
    argumentsMap.put(TalendProcessArgumentConstant.ARG_DEPLOY_VERSION,deployVersion);
  }
  IProcessor processor=ProcessorUtilities.generateCode(processItem,contextName,version,argumentsMap,monitor);
  return processor;
}