Program: 117994
Project: 117994
Buggy source:
protected StringBuffer getProfileArgs(){
  StringBuffer profileBuffer=new StringBuffer();
  profileBuffer.append(TalendMavenConstants.PREFIX_PROFILE);
  profileBuffer.append(SPACE);
  addArg(profileBuffer,true,true,TalendMavenConstants.PROFILE_DEFAULT_SETTING);
  addArg(profileBuffer,isOptionChoosed(ExportChoice.needSourceCode),TalendMavenConstants.PROFILE_INCLUDE_JAVA_SOURCES);
  boolean isBinaries=isOptionChoosed(ExportChoice.binaries);
  addArg(profileBuffer,!isBinaries,TalendMavenConstants.PROFILE_INCLUDE_MAVEN_RESOURCES);
  if (needDQSurvivorshipRules()) {
    addArg(profileBuffer,true,TalendMavenConstants.PROFILE_INCLUDE_SURVIVORSHIP_RULES);
  }
  addArg(profileBuffer,isOptionChoosed(ExportChoice.needJobItem) || itemDependencies,TalendMavenConstants.PROFILE_INCLUDE_ITEMS);
  addArg(profileBuffer,isOptionChoosed(ExportChoice.includeLibs),TalendMavenConstants.PROFILE_INCLUDE_LIBS);
  addArg(profileBuffer,isBinaries,TalendMavenConstants.PROFILE_INCLUDE_BINARIES);
  addArg(profileBuffer,isLog4jEnable() && isBinaries,TalendMavenConstants.PROFILE_INCLUDE_RUNNING_LOG4J);
  addArg(profileBuffer,isLog4jEnable() && !isBinaries,TalendMavenConstants.PROFILE_INCLUDE_LOG4J);
  addArg(profileBuffer,isBinaries && isOptionChoosed(ExportChoice.needContext),TalendMavenConstants.PROFILE_INCLUDE_CONTEXTS,ProcessUtils.jarNeedsToContainsContext());
  addArg(profileBuffer,isOptionChoosed(ExportChoice.includeTestSource),TalendMavenConstants.PROFILE_INCLUDE_TEST_SOURCES);
  addArg(profileBuffer,isOptionChoosed(ExportChoice.executeTests),TalendMavenConstants.PROFILE_INCLUDE_TEST_REPORTS);
  addArg(profileBuffer,needXmlMappings(),TalendMavenConstants.PROFILE_INCLUDE_XMLMAPPINGS);
  addArg(profileBuffer,needXmlMappings() && isBinaries,TalendMavenConstants.PROFILE_INCLUDE_RUNNING_XMLMAPPINGS);
  if (needXmlMappings()) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
      ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
      coreService.synchronizeMapptingXML();
      coreService.syncLog4jSettings();
    }
  }
  boolean isAssemblyNeeded=exportChoice.get(ExportChoice.needAssembly) == null || isOptionChoosed(ExportChoice.needAssembly);
  addArg(profileBuffer,isAssemblyNeeded,TalendMavenConstants.PROFILE_PACKAGING_AND_ASSEMBLY);
  if (needRules()) {
    addArg(profileBuffer,true,TalendMavenConstants.PROFILE_INCLUDE_RULES);
  }
  if (needPigUDFs()) {
    addArg(profileBuffer,isBinaries,TalendMavenConstants.PROFILE_INCLUDE_PIGUDFS_BINARIES);
    addArg(profileBuffer,!isBinaries,TalendMavenConstants.PROFILE_INCLUDE_PIGUDFS_JAVA_SOURCES);
  }
  return profileBuffer;
}

Fixed version (ground truth):
protected StringBuffer getProfileArgs(){
  StringBuffer profileBuffer=new StringBuffer();
  profileBuffer.append(TalendMavenConstants.PREFIX_PROFILE);
  profileBuffer.append(SPACE);
  addArg(profileBuffer,true,true,TalendMavenConstants.PROFILE_DEFAULT_SETTING);
  addArg(profileBuffer,isOptionChoosed(ExportChoice.needSourceCode),TalendMavenConstants.PROFILE_INCLUDE_JAVA_SOURCES);
  boolean isBinaries=isOptionChoosed(ExportChoice.binaries);
  addArg(profileBuffer,!isBinaries,TalendMavenConstants.PROFILE_INCLUDE_MAVEN_RESOURCES);
  if (needDQSurvivorshipRules()) {
    addArg(profileBuffer,true,TalendMavenConstants.PROFILE_INCLUDE_SURVIVORSHIP_RULES);
  }
  addArg(profileBuffer,isOptionChoosed(ExportChoice.needJobItem) || itemDependencies,TalendMavenConstants.PROFILE_INCLUDE_ITEMS);
  addArg(profileBuffer,isOptionChoosed(ExportChoice.includeLibs),TalendMavenConstants.PROFILE_INCLUDE_LIBS);
  addArg(profileBuffer,isBinaries,TalendMavenConstants.PROFILE_INCLUDE_BINARIES);
  addArg(profileBuffer,isLog4jEnable() && isBinaries,TalendMavenConstants.PROFILE_INCLUDE_RUNNING_LOG4J);
  addArg(profileBuffer,isLog4jEnable() && !isBinaries,TalendMavenConstants.PROFILE_INCLUDE_LOG4J);
  addArg(profileBuffer,isBinaries && isOptionChoosed(ExportChoice.needContext),TalendMavenConstants.PROFILE_INCLUDE_CONTEXTS,ProcessUtils.jarNeedsToContainContext());
  addArg(profileBuffer,isOptionChoosed(ExportChoice.includeTestSource),TalendMavenConstants.PROFILE_INCLUDE_TEST_SOURCES);
  addArg(profileBuffer,isOptionChoosed(ExportChoice.executeTests),TalendMavenConstants.PROFILE_INCLUDE_TEST_REPORTS);
  addArg(profileBuffer,needXmlMappings(),TalendMavenConstants.PROFILE_INCLUDE_XMLMAPPINGS);
  addArg(profileBuffer,needXmlMappings() && isBinaries,TalendMavenConstants.PROFILE_INCLUDE_RUNNING_XMLMAPPINGS);
  if (needXmlMappings()) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
      ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
      coreService.synchronizeMapptingXML();
      coreService.syncLog4jSettings();
    }
  }
  boolean isAssemblyNeeded=exportChoice.get(ExportChoice.needAssembly) == null || isOptionChoosed(ExportChoice.needAssembly);
  addArg(profileBuffer,isAssemblyNeeded,TalendMavenConstants.PROFILE_PACKAGING_AND_ASSEMBLY);
  if (needRules()) {
    addArg(profileBuffer,true,TalendMavenConstants.PROFILE_INCLUDE_RULES);
  }
  if (needPigUDFs()) {
    addArg(profileBuffer,isBinaries,TalendMavenConstants.PROFILE_INCLUDE_PIGUDFS_BINARIES);
    addArg(profileBuffer,!isBinaries,TalendMavenConstants.PROFILE_INCLUDE_PIGUDFS_JAVA_SOURCES);
  }
  return profileBuffer;
}