nus-yam/ex-repair huggingface dataset:
Program: 69819
Project: 69819
Buggy source:
public QuestionItem importItem(Identity owner,String filename,File file){
  String dir=getFileStorage().generateDir();
  VFSContainer itemDir=getFileStorage().getContainer(dir);
  VFSLeaf leaf=itemDir.createChildLeaf(filename);
  OutputStream out=leaf.getOutputStream(false);
  InputStream in=null;
  try {
    in=new FileInputStream(file);
    IOUtils.copy(in,out);
  }
 catch (  FileNotFoundException e) {
    log.error("String_Node_Str",e);
  }
catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
 finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
  return CoreSpringFactory.getImpl(QPoolService.class).createAndPersistItem(owner,filename,getFormat(),"String_Node_Str",null,dir,filename,null);
}

Fixed version (ground truth):
public QuestionItem importItem(Identity owner,Locale defaultLocale,String filename,File file){
  String dir=getFileStorage().generateDir();
  VFSContainer itemDir=getFileStorage().getContainer(dir);
  VFSLeaf leaf=itemDir.createChildLeaf(filename);
  OutputStream out=leaf.getOutputStream(false);
  InputStream in=null;
  try {
    in=new FileInputStream(file);
    IOUtils.copy(in,out);
  }
 catch (  FileNotFoundException e) {
    log.error("String_Node_Str",e);
  }
catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
 finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
  String language=defaultLocale.getLanguage();
  return CoreSpringFactory.getImpl(QPoolService.class).createAndPersistItem(owner,filename,getFormat(),language,null,dir,filename,null);
}
Program: 69820
Project: 69820
Buggy source:
@Override public List<QuestionItem> importItems(Identity owner,String filename,File file){
  List<QuestionItem> items=new ArrayList<QuestionItem>();
  QuestionItem item=importItem(owner,filename,file);
  if (item != null) {
    items.add(item);
  }
  return items;
}

Fixed version (ground truth):
@Override public List<QuestionItem> importItems(Identity owner,Locale defaultLocale,String filename,File file){
  List<QuestionItem> items=new ArrayList<QuestionItem>();
  QuestionItem item=importItem(owner,defaultLocale,filename,file);
  if (item != null) {
    items.add(item);
  }
  return items;
}
Program: 69821
Project: 69821
Buggy source:
@Override public List<QuestionItem> importItems(Identity owner,String filename,File file){
  List<QuestionItem> importedItem=null;
  List<QPoolSPI> providers=qpoolModule.getQuestionPoolProviders();
  for (  QPoolSPI provider : providers) {
    if (provider.isCompatible(filename,file)) {
      importedItem=provider.importItems(owner,filename,file);
    }
  }
  return importedItem;
}

Fixed version (ground truth):
@Override public List<QuestionItem> importItems(Identity owner,Locale defaultLocale,String filename,File file){
  List<QuestionItem> importedItem=null;
  List<QPoolSPI> providers=qpoolModule.getQuestionPoolProviders();
  for (  QPoolSPI provider : providers) {
    if (provider.isCompatible(filename,file)) {
      importedItem=provider.importItems(owner,defaultLocale,filename,file);
    }
  }
  return importedItem;
}
Program: 69822
Project: 69822
Buggy source:
@Override protected void formOK(UserRequest ureq){
  String filename=fileEl.getUploadFileName();
  File file=fileEl.getUploadFile();
  qpoolservice.importItems(getIdentity(),filename,file);
  fireEvent(ureq,Event.DONE_EVENT);
}

Fixed version (ground truth):
@Override protected void formOK(UserRequest ureq){
  String filename=fileEl.getUploadFileName();
  File file=fileEl.getUploadFile();
  qpoolservice.importItems(getIdentity(),getLocale(),filename,file);
  fireEvent(ureq,Event.DONE_EVENT);
}
Program: 69823
Project: 69823
Buggy source:
private void doUpdateDetails(UserRequest ureq,QuestionItemView itemView){
  deleteItem.setVisible(itemView.isEditable());
  QuestionItem item=qpoolService.loadItemById(itemView.getKey());
  detailsCtrl.updateItem(item,itemView.isEditable());
  previewCtrl.updateItem(ureq,item);
}

Fixed version (ground truth):
private void doUpdateDetails(UserRequest ureq,QuestionItemView itemView){
  deleteItem.setVisible(itemView.isEditable());
  QuestionItem item=qpoolService.loadItemById(itemView.getKey());
  detailsCtrl.updateItem(item,itemView.isEditable());
  previewCtrl.updateItem(ureq,item);
  selectItem.setEnabled(true);
  deleteItem.setEnabled(true);
}
Program: 69824
Project: 69824
Buggy source:
public QuestionsController(UserRequest ureq,WindowControl wControl,QuestionItemsSource source){
  super(ureq,wControl);
  qpoolService=CoreSpringFactory.getImpl(QPoolService.class);
  listCtrl=new QuestionListController(ureq,wControl,source);
  listenTo(listCtrl);
  detailsCtrl=new QuestionItemSummaryController(ureq,wControl);
  listenTo(detailsCtrl);
  previewCtrl=new QuestionItemPreviewController(ureq,wControl);
  listenTo(previewCtrl);
  mainVC=createVelocityContainer("String_Node_Str");
  mainVC.put("String_Node_Str",listCtrl.getInitialComponent());
  mainVC.put("String_Node_Str",detailsCtrl.getInitialComponent());
  mainVC.put("String_Node_Str",previewCtrl.getInitialComponent());
  deleteItem=LinkFactory.createButton("String_Node_Str",mainVC,this);
  selectItem=LinkFactory.createButton("String_Node_Str",mainVC,this);
  String[] js=new String[]{"String_Node_Str"};
  JSAndCSSComponent jsAndCssComp=new JSAndCSSComponent("String_Node_Str",js,null);
  mainVC.put("String_Node_Str",jsAndCssComp);
  putInitialPanel(mainVC);
}

Fixed version (ground truth):
public QuestionsController(UserRequest ureq,WindowControl wControl,QuestionItemsSource source){
  super(ureq,wControl);
  qpoolService=CoreSpringFactory.getImpl(QPoolService.class);
  listCtrl=new QuestionListController(ureq,wControl,source);
  listenTo(listCtrl);
  detailsCtrl=new QuestionItemSummaryController(ureq,wControl);
  listenTo(detailsCtrl);
  previewCtrl=new QuestionItemPreviewController(ureq,wControl);
  listenTo(previewCtrl);
  mainVC=createVelocityContainer("String_Node_Str");
  mainVC.put("String_Node_Str",listCtrl.getInitialComponent());
  mainVC.put("String_Node_Str",detailsCtrl.getInitialComponent());
  mainVC.put("String_Node_Str",previewCtrl.getInitialComponent());
  deleteItem=LinkFactory.createButton("String_Node_Str",mainVC,this);
  deleteItem.setEnabled(false);
  selectItem=LinkFactory.createButton("String_Node_Str",mainVC,this);
  selectItem.setEnabled(false);
  String[] js=new String[]{"String_Node_Str"};
  JSAndCSSComponent jsAndCssComp=new JSAndCSSComponent("String_Node_Str",js,null);
  mainVC.put("String_Node_Str",jsAndCssComp);
  putInitialPanel(mainVC);
}
Program: 69825
Project: 69825
Buggy source:
@Test public void testImport_QTI12_metadata() throws IOException, URISyntaxException {
  URL itemUrl=QTIExportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,itemFile.getName(),itemFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  List<QuestionItem> items=proc.process();
  Assert.assertNotNull(items);
  dbInstance.commitAndCloseSession();
  QTIExportProcessor exportProc=new QTIExportProcessor(qpoolFileStorage);
  List<QuestionItemFull> fullItems=questionItemDao.loadByIds(Collections.singletonList(items.get(0).getKey()));
  exportProc.assembleTest(fullItems);
}

Fixed version (ground truth):
@Test public void testImport_QTI12_metadata() throws IOException, URISyntaxException {
  URL itemUrl=QTIExportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,Locale.ENGLISH,itemFile.getName(),itemFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  List<QuestionItem> items=proc.process();
  Assert.assertNotNull(items);
  dbInstance.commitAndCloseSession();
  QTIExportProcessor exportProc=new QTIExportProcessor(qpoolFileStorage);
  List<QuestionItemFull> fullItems=questionItemDao.loadByIds(Collections.singletonList(items.get(0).getKey()));
  exportProc.assembleTest(fullItems);
}
Program: 69827
Project: 69827
Buggy source:
/** 
 * This test check every methods of the import process in details
 * @throws IOException
 * @throws URISyntaxException
 */
@Test public void testImport_OpenOLATTest_extractItems() throws IOException, URISyntaxException {
  URL testUrl=QTIImportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(testUrl);
  File testFile=new File(testUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,testFile.getName(),testFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  DocInfos docInfos=proc.getDocInfos();
  Assert.assertNotNull(docInfos);
  Assert.assertNotNull(docInfos.getFilename());
  Assert.assertNotNull(docInfos.getDocument());
  Assert.assertEquals("String_Node_Str",docInfos.getFilename());
  List<ItemInfos> itemElements=proc.getItemList(docInfos);
  Assert.assertNotNull(itemElements);
  Assert.assertEquals(4,itemElements.size());
}

Fixed version (ground truth):
/** 
 * This test check every methods of the import process in details
 * @throws IOException
 * @throws URISyntaxException
 */
@Test public void testImport_OpenOLATTest_extractItems() throws IOException, URISyntaxException {
  URL testUrl=QTIImportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(testUrl);
  File testFile=new File(testUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,Locale.ENGLISH,testFile.getName(),testFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  DocInfos docInfos=proc.getDocInfos();
  Assert.assertNotNull(docInfos);
  Assert.assertNotNull(docInfos.getFilename());
  Assert.assertNotNull(docInfos.getDocument());
  Assert.assertEquals("String_Node_Str",docInfos.getFilename());
  List<ItemInfos> itemElements=proc.getItemList(docInfos);
  Assert.assertNotNull(itemElements);
  Assert.assertEquals(4,itemElements.size());
}
Program: 69829
Project: 69829
Buggy source:
@Test public void testImport_FIB() throws IOException, URISyntaxException {
  URL itemUrl=QTIImportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,itemFile.getName(),itemFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  List<QuestionItem> items=proc.process();
  Assert.assertNotNull(items);
  Assert.assertEquals(1,items.size());
  dbInstance.commitAndCloseSession();
  QuestionItem reloadItem=questionItemDao.loadById(items.get(0).getKey());
  Assert.assertNotNull(reloadItem);
  Assert.assertNotNull(reloadItem.getCreationDate());
  Assert.assertNotNull(reloadItem.getLastModified());
  Assert.assertEquals(QuestionStatus.draft,reloadItem.getQuestionStatus());
  Assert.assertEquals(QTIConstants.QTI_12_FORMAT,reloadItem.getFormat());
  Assert.assertEquals("String_Node_Str",reloadItem.getTitle());
  Assert.assertEquals("String_Node_Str",reloadItem.getDescription());
  Assert.assertEquals(QuestionType.FIB.name(),reloadItem.getType().getType());
}

Fixed version (ground truth):
@Test public void testImport_FIB() throws IOException, URISyntaxException {
  URL itemUrl=QTIImportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,Locale.ENGLISH,itemFile.getName(),itemFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  List<QuestionItem> items=proc.process();
  Assert.assertNotNull(items);
  Assert.assertEquals(1,items.size());
  dbInstance.commitAndCloseSession();
  QuestionItem reloadItem=questionItemDao.loadById(items.get(0).getKey());
  Assert.assertNotNull(reloadItem);
  Assert.assertNotNull(reloadItem.getCreationDate());
  Assert.assertNotNull(reloadItem.getLastModified());
  Assert.assertEquals(QuestionStatus.draft,reloadItem.getQuestionStatus());
  Assert.assertEquals(QTIConstants.QTI_12_FORMAT,reloadItem.getFormat());
  Assert.assertEquals("String_Node_Str",reloadItem.getTitle());
  Assert.assertEquals("String_Node_Str",reloadItem.getDescription());
  Assert.assertEquals(QuestionType.FIB.name(),reloadItem.getType().getType());
}
Program: 69832
Project: 69832
Buggy source:
@Test public void testImport_QTI12_metadata() throws IOException, URISyntaxException {
  URL itemUrl=QTIImportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,itemFile.getName(),itemFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  List<QuestionItem> items=proc.process();
  Assert.assertNotNull(items);
  Assert.assertEquals(1,items.size());
  dbInstance.commitAndCloseSession();
  QuestionItem item=items.get(0);
  Assert.assertEquals("String_Node_Str",item.getTitle());
  QEducationalContext level=item.getEducationalContext();
  Assert.assertNotNull(level);
  Assert.assertEquals("String_Node_Str",level.getLevel());
  Assert.assertEquals("String_Node_Str",item.getEditor());
}

Fixed version (ground truth):
@Test public void testImport_QTI12_metadata() throws IOException, URISyntaxException {
  URL itemUrl=QTIImportProcessorTest.class.getResource("String_Node_Str");
  Assert.assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  QTIImportProcessor proc=new QTIImportProcessor(owner,Locale.ENGLISH,itemFile.getName(),itemFile,questionItemDao,qItemTypeDao,qEduContextDao,qpoolFileStorage);
  List<QuestionItem> items=proc.process();
  Assert.assertNotNull(items);
  Assert.assertEquals(1,items.size());
  dbInstance.commitAndCloseSession();
  QuestionItem item=items.get(0);
  Assert.assertEquals("String_Node_Str",item.getTitle());
  QEducationalContext level=item.getEducationalContext();
  Assert.assertNotNull(level);
  Assert.assertEquals("String_Node_Str",level.getLevel());
  Assert.assertEquals("String_Node_Str",item.getEditor());
}
Program: 69833
Project: 69833
Buggy source:
@Test public void importItem_qti12_assessment() throws IOException, URISyntaxException {
  Identity owner=JunitTestHelper.createAndPersistIdentityAsUser("String_Node_Str" + UUID.randomUUID().toString());
  dbInstance.commit();
  URL itemUrl=QuestionPoolServiceTest.class.getResource("String_Node_Str");
  assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  qpoolService.importItems(owner,"String_Node_Str",itemFile);
}

Fixed version (ground truth):
@Test public void importItem_qti12_assessment() throws IOException, URISyntaxException {
  Identity owner=JunitTestHelper.createAndPersistIdentityAsUser("String_Node_Str" + UUID.randomUUID().toString());
  dbInstance.commit();
  URL itemUrl=QuestionPoolServiceTest.class.getResource("String_Node_Str");
  assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  qpoolService.importItems(owner,Locale.ENGLISH,"String_Node_Str",itemFile);
}
Program: 69834
Project: 69834
Buggy source:
@Test public void importItem_qti12_item() throws IOException, URISyntaxException {
  Identity owner=JunitTestHelper.createAndPersistIdentityAsUser("String_Node_Str" + UUID.randomUUID().toString());
  dbInstance.commit();
  URL itemUrl=QuestionPoolServiceTest.class.getResource("String_Node_Str");
  assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  qpoolService.importItems(owner,"String_Node_Str",itemFile);
}

Fixed version (ground truth):
@Test public void importItem_qti12_item() throws IOException, URISyntaxException {
  Identity owner=JunitTestHelper.createAndPersistIdentityAsUser("String_Node_Str" + UUID.randomUUID().toString());
  dbInstance.commit();
  URL itemUrl=QuestionPoolServiceTest.class.getResource("String_Node_Str");
  assertNotNull(itemUrl);
  File itemFile=new File(itemUrl.toURI());
  qpoolService.importItems(owner,Locale.ENGLISH,"String_Node_Str",itemFile);
}
Program: 69835
Project: 69835
Buggy source:
/** 
 * Register a cacheable mapper by giving a mapper path ID. When setting the same ID every time for the same usage context, the browser can use the last modified date to cache the resources. The mapper ID will be use as MD5 hash to make it URL save and shorter. In debug mode, all special characters are replaced with the '_' character. <p> Whenever possible use this method to improve the user experience. <p>
 * @param cacheableMapperID the ID of the mapper.
 * @param mapper
 * @return the path e.g. /olat/c/my.mapper.path without / at the end
 */
public String register(UserSession session,String mapperId,Mapper mapper);

Fixed version (ground truth):
/** 
 * Register a cacheable mapper by giving a mapper path ID. When setting the same ID every time for the same usage context, the browser can use the last modified date to cache the resources. The mapper ID will be use as MD5 hash to make it URL save and shorter. In debug mode, all special characters are replaced with the '_' character. <p> Whenever possible use this method to improve the user experience. <p>
 * @param cacheableMapperID the ID of the mapper.
 * @param mapper
 * @return the path e.g. /olat/c/my.mapper.path without / at the end
 */
public String register(String mapperId,Mapper mapper);
Program: 69836
Project: 69836
Buggy source:
/** 
 * Cacheable mapper, not session dependant
 */
@Override public String register(UserSession session,String mapperId,Mapper mapper){
  String encryptedMapId=Encoder.encrypt(mapperId);
  boolean alreadyLoaded=mapperIdToMapper.containsKey(encryptedMapId);
  if (mapper instanceof Serializable) {
    if (alreadyLoaded) {
      if (!mapperDao.updateConfiguration(encryptedMapId,(Serializable)mapper)) {
        mapperDao.persistMapper(null,encryptedMapId,(Serializable)mapper);
      }
    }
 else {
      PersistedMapper persistedMapper=mapperDao.loadByMapperId(encryptedMapId);
      if (persistedMapper == null) {
        mapperDao.persistMapper(null,encryptedMapId,(Serializable)mapper);
      }
 else {
        mapperDao.updateConfiguration(encryptedMapId,(Serializable)mapper);
      }
    }
  }
  mapperIdToMapper.put(encryptedMapId,mapper);
  mapperToMapperId.put(mapper,encryptedMapId);
  if (session.getSessionInfo() == null) {
    return WebappHelper.getServletContextPath() + DispatcherAction.PATH_MAPPED + encryptedMapId;
  }
  return WebappHelper.getServletContextPath() + DispatcherAction.PATH_MAPPED + encryptedMapId;
}

Fixed version (ground truth):
/** 
 * Cacheable mapper, not session dependant
 */
@Override public String register(String mapperId,Mapper mapper){
  String encryptedMapId=Encoder.encrypt(mapperId);
  boolean alreadyLoaded=mapperIdToMapper.containsKey(encryptedMapId);
  if (mapper instanceof Serializable) {
    if (alreadyLoaded) {
      if (!mapperDao.updateConfiguration(encryptedMapId,(Serializable)mapper)) {
        mapperDao.persistMapper(null,encryptedMapId,(Serializable)mapper);
      }
    }
 else {
      PersistedMapper persistedMapper=mapperDao.loadByMapperId(encryptedMapId);
      if (persistedMapper == null) {
        mapperDao.persistMapper(null,encryptedMapId,(Serializable)mapper);
      }
 else {
        mapperDao.updateConfiguration(encryptedMapId,(Serializable)mapper);
      }
    }
  }
  mapperIdToMapper.put(encryptedMapId,mapper);
  mapperToMapperId.put(mapper,encryptedMapId);
  return WebappHelper.getServletContextPath() + DispatcherAction.PATH_MAPPED + encryptedMapId;
}
Program: 69838
Project: 69838
Buggy source:
/** 
 * @param cssBaseContainer
 * @param uSess
 */
private void registerMapper(final VFSContainer cssBaseContainer,UserSession uSess){
  String mapperID=VFSManager.getRealPath(cssBaseContainer);
  if (mapperID == null) {
    mapperBaseURI=CoreSpringFactory.getImpl(MapperService.class).register(uSess,cssUriMapper);
  }
 else {
    mapperID=this.getClass().getSimpleName() + "String_Node_Str" + mapperID+ System.currentTimeMillis();
    mapperBaseURI=CoreSpringFactory.getImpl(MapperService.class).register(uSess,mapperID,cssUriMapper);
  }
}

Fixed version (ground truth):
/** 
 * @param cssBaseContainer
 * @param uSess
 */
private void registerMapper(final VFSContainer cssBaseContainer,UserSession uSess){
  String mapperID=VFSManager.getRealPath(cssBaseContainer);
  if (mapperID == null) {
    mapperBaseURI=CoreSpringFactory.getImpl(MapperService.class).register(uSess,cssUriMapper);
  }
 else {
    mapperID=this.getClass().getSimpleName() + "String_Node_Str" + mapperID+ System.currentTimeMillis();
    mapperBaseURI=CoreSpringFactory.getImpl(MapperService.class).register(mapperID,cssUriMapper);
  }
}
Program: 69840
Project: 69840
Buggy source:
/** 
 * convenience method: registers a cacheable mapper which will be automatically deregistered upon dispose of the controller
 * @param cacheableMapperID the mapper ID that is used in the url to identify this mapper. Should be something that is derived from the context or resource that is delivered by the mapper
 * @param m the mapper that delivers the resources
 * @return The mapper base URL
 */
protected String registerCacheableMapper(UserRequest ureq,String cacheableMapperID,Mapper m){
  if (mappers == null) {
    mappers=new ArrayList<Mapper>(2);
  }
  String mapperBaseURL;
  if (cacheableMapperID == null) {
    mapperBaseURL=CoreSpringFactory.getImpl(MapperService.class).register(ureq.getUserSession(),m);
  }
 else {
    mapperBaseURL=CoreSpringFactory.getImpl(MapperService.class).register(ureq.getUserSession(),cacheableMapperID,m);
  }
  mappers.add(m);
  return mapperBaseURL;
}

Fixed version (ground truth):
/** 
 * convenience method: registers a cacheable mapper which will be automatically deregistered upon dispose of the controller
 * @param cacheableMapperID the mapper ID that is used in the url to identify this mapper. Should be something that is derived from the context or resource that is delivered by the mapper
 * @param m the mapper that delivers the resources
 * @return The mapper base URL
 */
protected String registerCacheableMapper(UserRequest ureq,String cacheableMapperID,Mapper m){
  if (mappers == null) {
    mappers=new ArrayList<Mapper>(2);
  }
  String mapperBaseURL;
  if (cacheableMapperID == null) {
    mapperBaseURL=CoreSpringFactory.getImpl(MapperService.class).register(ureq.getUserSession(),m);
  }
 else {
    mapperBaseURL=CoreSpringFactory.getImpl(MapperService.class).register(cacheableMapperID,m);
  }
  mappers.add(m);
  return mapperBaseURL;
}
Program: 69841
Project: 69841
Buggy source:
/** 
 * @param event
 */
void fireEvent(final Event event){
  GenericEventListener[] liArr;
synchronized (listeners) {
    List<GenericEventListener> li=new ArrayList<GenericEventListener>(listeners.keySet());
    liArr=new GenericEventListener[li.size()];
    liArr=li.toArray(liArr);
  }
  for (int i=0; i < liArr.length; i++) {
    try {
      final GenericEventListener listener=liArr[i];
      if (listener instanceof Controller) {
        Controller dCtrl=(Controller)listener;
        if (!dCtrl.isDisposed()) {
          ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(new Runnable(){
            public void run(){
              listener.event(event);
            }
          }
,UserActivityLoggerImpl.newLoggerForEventBus(dCtrl));
        }
      }
 else {
        if (log.isDebug()) {
          log.debug("String_Node_Str" + listener);
        }
        ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(new Runnable(){
          public void run(){
            listener.event(event);
          }
        }
,ThreadLocalUserActivityLoggerInstaller.createEmptyUserActivityLogger());
      }
    }
 catch (    RuntimeException e) {
      log.error("String_Node_Str" + liArr[i],e);
      removeListener(liArr[i]);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param event
 */
void fireEvent(final Event event){
  GenericEventListener[] liArr;
synchronized (listeners) {
    List<GenericEventListener> li=new ArrayList<GenericEventListener>(listeners.keySet());
    liArr=new GenericEventListener[li.size()];
    liArr=li.toArray(liArr);
  }
  for (int i=0; i < liArr.length; i++) {
    try {
      final GenericEventListener listener=liArr[i];
      if (listener instanceof Controller) {
        Controller dCtrl=(Controller)listener;
        if (!dCtrl.isDisposed()) {
          ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(new Runnable(){
            public void run(){
              listener.event(event);
            }
          }
,UserActivityLoggerImpl.newLoggerForEventBus(dCtrl));
        }
      }
 else {
        if (log.isDebug()) {
          log.debug("String_Node_Str" + listener);
        }
        ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(new Runnable(){
          public void run(){
            listener.event(event);
          }
        }
,ThreadLocalUserActivityLoggerInstaller.createEmptyUserActivityLogger());
      }
    }
 catch (    RuntimeException e) {
      log.error("String_Node_Str" + liArr[i],e);
    }
  }
}
Program: 69842
Project: 69842
Buggy source:
public Workbook log(OLATResourceable ores,Locale locale){
  Translator translator=Util.createPackageTranslator(ChatController.class,locale);
  Workbook wb=new HSSFWorkbook();
  String tableExportTitle=translator.translate("String_Node_Str");
  Sheet exportSheet=wb.createSheet(tableExportTitle);
  Row headerRow=exportSheet.createRow(0);
  CellStyle headerCellStyle=getHeaderCellStyle(wb);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",0);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",1);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",2);
  List<InstantMessage> messages=imDao.getMessages(ores,null,0,-1);
  int count=1;
  for (  InstantMessage message : messages) {
    Row dataRow=exportSheet.createRow(count);
    addCell(dataRow,message.getFromNickName(),0);
    addCell(dataRow,message.getCreationDate(),1);
    addCell(dataRow,message.getBody(),2);
  }
  return wb;
}

Fixed version (ground truth):
public Workbook log(OLATResourceable ores,Locale locale){
  Translator translator=Util.createPackageTranslator(ChatController.class,locale);
  Workbook wb=new HSSFWorkbook();
  String tableExportTitle=translator.translate("String_Node_Str");
  Sheet exportSheet=wb.createSheet(tableExportTitle);
  Row headerRow=exportSheet.createRow(0);
  CellStyle headerCellStyle=getHeaderCellStyle(wb);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",0);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",1);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",2);
  List<InstantMessage> messages=imDao.getMessages(ores,null,0,-1);
  int count=1;
  for (  InstantMessage message : messages) {
    Row dataRow=exportSheet.createRow(count++);
    addCell(dataRow,message.getFromNickName(),0);
    addCell(dataRow,message.getCreationDate(),1);
    addCell(dataRow,message.getBody(),2);
  }
  return wb;
}
Program: 69843
Project: 69843
Buggy source:
public List<RosterEntryView> getRosterView(OLATResourceable ores,int firstResult,int maxResults){
  TypedQuery<RosterEntryView> query=dbInstance.getCurrentEntityManager().createNamedQuery("String_Node_Str",RosterEntryView.class).setParameter("String_Node_Str",ores.getResourceableId()).setParameter("String_Node_Str",ores.getResourceableTypeName()).setFirstResult(firstResult).setHint("String_Node_Str",Boolean.TRUE);
  if (maxResults > 0) {
    query.setMaxResults(maxResults);
  }
  return query.getResultList();
}

Fixed version (ground truth):
public List<RosterEntryView> getRosterView(OLATResourceable ores,int firstResult,int maxResults){
  TypedQuery<RosterEntryView> query=dbInstance.getCurrentEntityManager().createNamedQuery("String_Node_Str",RosterEntryView.class).setParameter("String_Node_Str",ores.getResourceableId()).setParameter("String_Node_Str",ores.getResourceableTypeName()).setFirstResult(firstResult);
  if (maxResults > 0) {
    query.setMaxResults(maxResults);
  }
  return query.getResultList();
}
Program: 69844
Project: 69844
Buggy source:
/** 
 * gets called if either a new message or a presence change from one of the buddies happens or an Assessment starts or ends
 * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
 */
public void event(Event event){
  if (event instanceof InstantMessagingEvent) {
    processInstantMessageEvent((InstantMessagingEvent)event);
  }
 else   if (event instanceof AssessmentEvent) {
    processAssessmentEvent((AssessmentEvent)event);
  }
 else   if (event instanceof OpenInstantMessageEvent) {
    processOpenInstantMessageEvent((OpenInstantMessageEvent)event);
  }
 else   if (event instanceof CloseInstantMessagingEvent) {
    processCloseInstantMessageEvent();
  }
}

Fixed version (ground truth):
/** 
 * gets called if either a new message or a presence change from one of the buddies happens or an Assessment starts or ends
 * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
 */
public void event(Event event){
  if (event instanceof InstantMessagingEvent) {
    processInstantMessageEvent((InstantMessagingEvent)event);
  }
 else   if (event instanceof AssessmentEvent) {
    processAssessmentEvent((AssessmentEvent)event);
  }
 else   if (event instanceof OpenInstantMessageEvent) {
    processOpenInstantMessageEvent((OpenInstantMessageEvent)event);
  }
 else   if (event instanceof CloseInstantMessagingEvent) {
    processCloseInstantMessageEvent();
  }
 else   if (Window.BEFORE_INLINE_RENDERING.equals(event)) {
    if (++stateUpdateCounter % 25 == 0) {
      updateBuddyStats();
    }
  }
}
Program: 69846
Project: 69846
Buggy source:
private String generateNickname(){
  String prefix=anonymPrefix[(int)(Math.random() * anonymPrefix.length)];
  String name=prefix + "String_Node_Str" + (int)(Math.random() * getIdentity().getKey());
  return name;
}

Fixed version (ground truth):
private String generateNickname(){
  String prefix=anonymPrefix[(int)(Math.random() * (anonymPrefix.length - 1))];
  String name=prefix + "String_Node_Str" + (int)(Math.random() * getIdentity().getKey());
  return name;
}
Program: 69847
Project: 69847
Buggy source:
/** 
 * if the wiki need to serve images you have to set the image mapper uri first! The mapper creates an user session based mapper for the media files which can be requested by calling @see getImageBaseUri()
 * @param ureq
 * @param wikiContainer
 */
public void setImageMapperUri(UserRequest ureq,final VFSContainer wikiContainer){
  Mapper contentMapper=new Mapper(){
    public MediaResource handle(    String relPath,    HttpServletRequest request){
      VFSItem vfsItem=wikiContainer.resolve(relPath);
      MediaResource mr;
      if (vfsItem == null || !(vfsItem instanceof VFSLeaf))       mr=new NotFoundMediaResource(relPath);
 else       mr=new VFSMediaResource((VFSLeaf)vfsItem);
      return mr;
    }
  }
;
  String mapperPath;
  String mapperID=VFSManager.getRealPath(wikiContainer);
  if (mapperID == null) {
    mapperPath=CoreSpringFactory.getImpl(MapperService.class).register(ureq.getUserSession(),contentMapper);
  }
 else {
    mapperID=this.getClass().getSimpleName() + "String_Node_Str" + mapperID;
    mapperPath=CoreSpringFactory.getImpl(MapperService.class).register(ureq.getUserSession(),mapperID,contentMapper);
  }
  imageBaseUri=mapperPath + "String_Node_Str" + WikiContainer.MEDIA_FOLDER_NAME+ "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * if the wiki need to serve images you have to set the image mapper uri first! The mapper creates an user session based mapper for the media files which can be requested by calling @see getImageBaseUri()
 * @param ureq
 * @param wikiContainer
 */
public void setImageMapperUri(UserRequest ureq,final VFSContainer wikiContainer){
  Mapper contentMapper=new Mapper(){
    public MediaResource handle(    String relPath,    HttpServletRequest request){
      VFSItem vfsItem=wikiContainer.resolve(relPath);
      MediaResource mr;
      if (vfsItem == null || !(vfsItem instanceof VFSLeaf))       mr=new NotFoundMediaResource(relPath);
 else       mr=new VFSMediaResource((VFSLeaf)vfsItem);
      return mr;
    }
  }
;
  String mapperPath;
  String mapperID=VFSManager.getRealPath(wikiContainer);
  if (mapperID == null) {
    mapperPath=CoreSpringFactory.getImpl(MapperService.class).register(ureq.getUserSession(),contentMapper);
  }
 else {
    mapperID=this.getClass().getSimpleName() + "String_Node_Str" + mapperID;
    mapperPath=CoreSpringFactory.getImpl(MapperService.class).register(mapperID,contentMapper);
  }
  imageBaseUri=mapperPath + "String_Node_Str" + WikiContainer.MEDIA_FOLDER_NAME+ "String_Node_Str";
}
Program: 69849
Project: 69849
Buggy source:
/** 
 * Call this to rollback current changes.
 */
@Override public void rollback(){
  if (isLogDebugEnabled())   logDebug("String_Node_Str",null);
  try {
    TransactionStatus status=txManager.getTransaction(null);
    txManager.rollback(status);
  }
 catch (  Exception ex) {
    logWarn("String_Node_Str",ex);
    throw new DBRuntimeException("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Call this to rollback current changes.
 */
@Override public void rollback(){
  if (isLogDebugEnabled())   logDebug("String_Node_Str",null);
  try {
    TransactionStatus status=txManager.getTransaction(null);
    txManager.rollback(status);
    EntityTransaction trx=getCurrentEntityManager().getTransaction();
    if (trx != null) {
      trx.rollback();
    }
  }
 catch (  Exception ex) {
    logWarn("String_Node_Str",ex);
    throw new DBRuntimeException("String_Node_Str",ex);
  }
}
Program: 69850
Project: 69850
Buggy source:
private void addCell(Row dataRow,Date val,int position){
  Cell cell=dataRow.createCell(position);
  cell.setCellValue(val);
}

Fixed version (ground truth):
private void addCell(Row dataRow,Date val,int position,Formatter formatter){
  Cell cell=dataRow.createCell(position);
  cell.setCellValue(formatter.formatDateAndTime(val));
}
Program: 69851
Project: 69851
Buggy source:
public Workbook log(OLATResourceable ores,Locale locale){
  Translator translator=Util.createPackageTranslator(ChatController.class,locale);
  Workbook wb=new HSSFWorkbook();
  String tableExportTitle=translator.translate("String_Node_Str");
  Sheet exportSheet=wb.createSheet(tableExportTitle);
  Row headerRow=exportSheet.createRow(0);
  CellStyle headerCellStyle=getHeaderCellStyle(wb);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",0);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",1);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",2);
  List<InstantMessage> messages=imDao.getMessages(ores,null,0,-1);
  int count=1;
  for (  InstantMessage message : messages) {
    Row dataRow=exportSheet.createRow(count++);
    addCell(dataRow,message.getFromNickName(),0);
    addCell(dataRow,message.getCreationDate(),1);
    addCell(dataRow,message.getBody(),2);
  }
  return wb;
}

Fixed version (ground truth):
public Workbook log(OLATResourceable ores,Locale locale){
  Translator translator=Util.createPackageTranslator(ChatController.class,locale);
  Workbook wb=new HSSFWorkbook();
  String tableExportTitle=translator.translate("String_Node_Str");
  Sheet exportSheet=wb.createSheet(tableExportTitle);
  Formatter formatter=Formatter.getInstance(locale);
  Row headerRow=exportSheet.createRow(0);
  CellStyle headerCellStyle=getHeaderCellStyle(wb);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",0);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",1);
  addHeader(headerRow,headerCellStyle,"String_Node_Str",2);
  List<InstantMessage> messages=imDao.getMessages(ores,null,0,-1);
  int count=1;
  for (  InstantMessage message : messages) {
    Row dataRow=exportSheet.createRow(count++);
    addCell(dataRow,message.getFromNickName(),0);
    addCell(dataRow,message.getCreationDate(),1,formatter);
    addCell(dataRow,message.getBody(),2);
  }
  return wb;
}
Program: 69852
Project: 69852
Buggy source:
/** 
 * Close the chats windows
 */
protected void closeAllChats(){
  List<Long> chatKeys=new ArrayList<Long>(chats.keySet());
  for (  Long chatKey : chatKeys) {
    Component p=container.getComponent(chatKey.toString());
    if (p != null) {
      container.remove(p);
    }
    ChatController ctrl=chats.get(chatKey);
    if (ctrl != null) {
      ctrl.closeChat();
    }
  }
  chats.clear();
}

Fixed version (ground truth):
/** 
 * Close the chats windows
 */
protected void closeAllChats(){
  List<Long> chatKeys=new ArrayList<Long>(chats.keySet());
  for (  Long chatKey : chatKeys) {
    closeChat(chatKey);
  }
  chats.clear();
}
Program: 69853
Project: 69853
Buggy source:
private String getStatusCss(Buddy buddy){
  StringBuilder sb=new StringBuilder(32);
  sb.append("String_Node_Str").append(buddy.getStatus()).append("String_Node_Str");
  if (buddy.isVip()) {
    sb.append("String_Node_Str");
  }
  return sb.toString();
}

Fixed version (ground truth):
private String getStatusCss(Buddy buddy){
  StringBuilder sb=new StringBuilder(32);
  if (imModule.isOnlineStatusEnabled()) {
    sb.append("String_Node_Str").append(buddy.getStatus()).append("String_Node_Str");
  }
 else {
    sb.append("String_Node_Str");
  }
  if (buddy.isVip()) {
    sb.append("String_Node_Str");
  }
  return sb.toString();
}
Program: 69854
Project: 69854
Buggy source:
@Override protected void event(UserRequest ureq,Component source,Event event){
  if (source == toggleOffline) {
    if (viewMode == ViewMode.onlineUsers) {
      toggleOffline.setCustomDisplayText(translate("String_Node_Str"));
      toggleOffline.setCustomEnabledLinkCSS("String_Node_Str");
      loadRoster(ViewMode.offlineUsers);
    }
 else {
      toggleOffline.setCustomDisplayText(translate("String_Node_Str"));
      toggleOffline.setCustomEnabledLinkCSS("String_Node_Str");
      loadRoster(ViewMode.onlineUsers);
    }
  }
 else   if (source instanceof Link) {
    Link link=(Link)source;
    if ("String_Node_Str".equals(link.getCommand())) {
      Buddy buddy=(Buddy)link.getUserObject();
      fireEvent(ureq,new OpenInstantMessageEvent(ureq,buddy));
    }
  }
}

Fixed version (ground truth):
@Override protected void event(UserRequest ureq,Component source,Event event){
  if (source == toggleOffline) {
    if (viewMode == ViewMode.onlineUsers) {
      toggleOffline.setCustomDisplayText(translate("String_Node_Str"));
      toggleOffline.setCustomEnabledLinkCSS("String_Node_Str");
      loadRoster(ViewMode.offlineUsers);
    }
 else {
      toggleOffline.setCustomDisplayText(translate("String_Node_Str"));
      toggleOffline.setCustomEnabledLinkCSS("String_Node_Str");
      loadRoster(ViewMode.onlineUsers);
    }
  }
 else   if (source == toggleGroup) {
    if (viewGroups) {
      toggleGroup.setCustomDisplayText(translate("String_Node_Str"));
      toggleGroup.setCustomEnabledLinkCSS("String_Node_Str");
      buddiesListContent.contextPut("String_Node_Str",Boolean.FALSE);
      viewGroups=false;
    }
 else {
      toggleGroup.setCustomDisplayText(translate("String_Node_Str"));
      toggleGroup.setCustomEnabledLinkCSS("String_Node_Str");
      buddiesListContent.contextPut("String_Node_Str",Boolean.TRUE);
      viewGroups=true;
    }
  }
 else   if (source instanceof Link) {
    Link link=(Link)source;
    if ("String_Node_Str".equals(link.getCommand())) {
      Buddy buddy=(Buddy)link.getUserObject();
      fireEvent(ureq,new OpenInstantMessageEvent(ureq,buddy));
    }
  }
}
Program: 69855
Project: 69855
Buggy source:
public IMBuddyListController(UserRequest ureq,WindowControl wControl){
  super(ureq,wControl);
  imModule=CoreSpringFactory.getImpl(InstantMessagingModule.class);
  imService=CoreSpringFactory.getImpl(InstantMessagingService.class);
  mainVC=createVelocityContainer("String_Node_Str");
  buddiesListContent=createVelocityContainer("String_Node_Str");
  if (imModule.isOnlineStatusEnabled()) {
    toggleOffline=LinkFactory.createCustomLink("String_Node_Str","String_Node_Str","String_Node_Str",Link.NONTRANSLATED,mainVC,this);
    toggleOffline.setCustomDisplayText(translate("String_Node_Str"));
    toggleOffline.setCustomEnabledLinkCSS("String_Node_Str");
    viewMode=ViewMode.onlineUsers;
  }
 else {
    viewMode=ViewMode.offlineUsers;
  }
  buddyList=new Roster(getIdentity().getKey());
  mainVC.contextPut("String_Node_Str",buddyList);
  buddiesListContent.contextPut("String_Node_Str",buddyList);
  loadRoster(viewMode);
  mainVC.put("String_Node_Str",buddiesListContent);
  putInitialPanel(mainVC);
}

Fixed version (ground truth):
public IMBuddyListController(UserRequest ureq,WindowControl wControl){
  super(ureq,wControl);
  imModule=CoreSpringFactory.getImpl(InstantMessagingModule.class);
  imService=CoreSpringFactory.getImpl(InstantMessagingService.class);
  mainVC=createVelocityContainer("String_Node_Str");
  buddiesListContent=createVelocityContainer("String_Node_Str");
  if (imModule.isOnlineStatusEnabled()) {
    toggleOffline=LinkFactory.createCustomLink("String_Node_Str","String_Node_Str","String_Node_Str",Link.NONTRANSLATED,mainVC,this);
    toggleOffline.setCustomDisplayText(translate("String_Node_Str"));
    toggleOffline.setCustomEnabledLinkCSS("String_Node_Str");
    viewMode=ViewMode.onlineUsers;
  }
 else {
    viewMode=ViewMode.offlineUsers;
  }
  toggleGroup=LinkFactory.createCustomLink("String_Node_Str","String_Node_Str","String_Node_Str",Link.NONTRANSLATED,mainVC,this);
  toggleGroup.setCustomDisplayText(translate("String_Node_Str"));
  toggleGroup.setCustomEnabledLinkCSS("String_Node_Str");
  buddyList=new Roster(getIdentity().getKey());
  mainVC.contextPut("String_Node_Str",buddyList);
  buddiesListContent.contextPut("String_Node_Str",buddyList);
  buddiesListContent.contextPut("String_Node_Str",Boolean.TRUE);
  loadRoster(viewMode);
  mainVC.put("String_Node_Str",buddiesListContent);
  putInitialPanel(mainVC);
}
Program: 69856
Project: 69856
Buggy source:
private void forgeBuddyLink(BuddyGroup group,Buddy buddy){
  String linkId="String_Node_Str" + group.getGroupKey() + "String_Node_Str"+ buddy.getIdentityKey();
  if (buddiesListContent.getComponent(linkId) == null) {
    Link buddyLink=LinkFactory.createCustomLink(linkId,"String_Node_Str","String_Node_Str",Link.NONTRANSLATED,buddiesListContent,this);
    buddyLink.setCustomDisplayText(buddy.getName());
    String css=(imModule.isOnlineStatusEnabled() ? getStatusCss(buddy) : "String_Node_Str");
    buddyLink.setCustomEnabledLinkCSS(css);
    buddyLink.setUserObject(buddy);
  }
}

Fixed version (ground truth):
private void forgeBuddyLink(BuddyGroup group,Buddy buddy){
  String linkId="String_Node_Str" + group.getGroupKey() + "String_Node_Str"+ buddy.getIdentityKey();
  if (buddiesListContent.getComponent(linkId) == null) {
    Link buddyLink=LinkFactory.createCustomLink(linkId,"String_Node_Str","String_Node_Str",Link.NONTRANSLATED,buddiesListContent,this);
    buddyLink.setCustomDisplayText(buddy.getName());
    String css=getStatusCss(buddy);
    buddyLink.setCustomEnabledLinkCSS(css);
    buddyLink.setUserObject(buddy);
  }
  String linkIdAlt="String_Node_Str" + buddy.getIdentityKey();
  if (buddiesListContent.getComponent(linkIdAlt) == null) {
    Link buddyLink=LinkFactory.createCustomLink(linkIdAlt,"String_Node_Str","String_Node_Str",Link.NONTRANSLATED,buddiesListContent,this);
    buddyLink.setCustomDisplayText(buddy.getName());
    String css=getStatusCss(buddy);
    buddyLink.setCustomEnabledLinkCSS(css);
    buddyLink.setUserObject(buddy);
  }
}
Program: 69857
Project: 69857
Buggy source:
/** 
 * gets called if either a new message or a presence change from one of the buddies happens or an Assessment starts or ends
 * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
 */
public void event(Event event){
  if (event instanceof InstantMessagingEvent) {
    processInstantMessageEvent((InstantMessagingEvent)event);
  }
 else   if (event instanceof AssessmentEvent) {
    processAssessmentEvent((AssessmentEvent)event);
  }
 else   if (event instanceof OpenInstantMessageEvent) {
    processOpenInstantMessageEvent((OpenInstantMessageEvent)event);
  }
 else   if (event instanceof CloseInstantMessagingEvent) {
    processCloseInstantMessageEvent();
  }
 else   if (Window.BEFORE_INLINE_RENDERING.equals(event)) {
    if (++stateUpdateCounter % 25 == 0) {
      updateBuddyStats();
    }
  }
}

Fixed version (ground truth):
/** 
 * gets called if either a new message or a presence change from one of the buddies happens or an Assessment starts or ends
 * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
 */
public void event(Event event){
  if (event instanceof InstantMessagingEvent) {
    processInstantMessageEvent((InstantMessagingEvent)event);
  }
 else   if (event instanceof AssessmentEvent) {
    processAssessmentEvent((AssessmentEvent)event);
  }
 else   if (event instanceof OpenInstantMessageEvent) {
    processOpenInstantMessageEvent((OpenInstantMessageEvent)event);
  }
 else   if (event instanceof CloseInstantMessagingEvent) {
    processCloseInstantMessageEvent((CloseInstantMessagingEvent)event);
  }
 else   if (Window.BEFORE_INLINE_RENDERING.equals(event)) {
    if (++stateUpdateCounter % 25 == 0) {
      updateBuddyStats();
    }
  }
}
Program: 69858
Project: 69858
Buggy source:
private void processCloseInstantMessageEvent(){
  if (statusChangerPanelCtr != null) {
    statusChangerPanelCtr.executeCloseCommand();
    removeAsListenerAndDispose(statusChangerPanelCtr);
    statusPanel.setContent(null);
  }
  if (rosterPanelCtr != null) {
    rosterPanelCtr.executeCloseCommand();
    removeAsListenerAndDispose(rosterPanelCtr);
    rosterPanel.setContent(null);
  }
  if (chatMgrCtrl != null) {
    chatMgrCtrl.closeAllChats();
  }
}

Fixed version (ground truth):
private void processCloseInstantMessageEvent(CloseInstantMessagingEvent event){
  if (event.getOres() == null) {
    close();
  }
 else {
    closeChat(event.getOres());
  }
}
Program: 69859
Project: 69859
Buggy source:
/** 
 * Removes the given <code>Item</code> from the <code>Feed</code>. Its content will be deleted.
 * @param item
 * @param feed
 */
public abstract void remove(Item item,Feed feed);

Fixed version (ground truth):
/** 
 * Removes the given <code>Item</code> from the <code>Feed</code>. Its content will be deleted.
 * @param item
 * @param feed
 */
public abstract Feed remove(Item item,Feed feed);
Program: 69860
Project: 69860
Buggy source:
/** 
 * Adds the given <code>Item</code> to the <code>Feed</code>.
 * @param item
 * @param feed
 */
public abstract void addItem(Item item,FileElement file,Feed feed);

Fixed version (ground truth):
/** 
 * Adds the given <code>Item</code> to the <code>Feed</code>.
 * @param item
 * @param feed
 */
public abstract Feed addItem(Item item,FileElement file,Feed feed);
Program: 69861
Project: 69861
Buggy source:
/** 
 * @param modifiedItem
 * @param feed
 */
public abstract void updateItem(Item modifiedItem,FileElement file,Feed feed);

Fixed version (ground truth):
/** 
 * @param modifiedItem
 * @param feed
 */
public abstract Feed updateItem(Item modifiedItem,FileElement file,Feed feed);
Program: 69862
Project: 69862
Buggy source:
/** 
 * @see org.olat.modules.webFeed.managers.FeedManager#updateItem(org.olat.modules.webFeed.models.Item,org.olat.core.gui.components.form.flexible.elements.FileElement,org.olat.modules.webFeed.models.Feed)
 */
@Override public void updateItem(final Item item,final FileElement file,final Feed feed){
  if (feed.isInternal()) {
    coordinator.getSyncer().doInSync(feed,new SyncerCallback<Object>(){
      @SuppressWarnings("String_Node_Str") public VFSLeaf execute(){
        Feed reloadedFeed=getFeed(feed,false);
        if (reloadedFeed.getItemIds().contains(item.getGuid())) {
          if (file != null) {
            setEnclosure(file,item,reloadedFeed);
          }
          updateItemFileWithoutDoInSync(item,reloadedFeed);
          update(feed,false);
        }
 else {
        }
        return null;
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * @see org.olat.modules.webFeed.managers.FeedManager#updateItem(org.olat.modules.webFeed.models.Item,org.olat.core.gui.components.form.flexible.elements.FileElement,org.olat.modules.webFeed.models.Feed)
 */
@Override public Feed updateItem(final Item item,final FileElement file,final Feed feed){
  if (feed.isInternal()) {
    return coordinator.getSyncer().doInSync(feed,new SyncerCallback<Feed>(){
      @SuppressWarnings("String_Node_Str") public Feed execute(){
        Feed reloadedFeed=getFeed(feed,false);
        if (reloadedFeed.getItemIds().contains(item.getGuid())) {
          if (file != null) {
            setEnclosure(file,item,reloadedFeed);
          }
          updateItemFileWithoutDoInSync(item,reloadedFeed);
          update(feed,false);
        }
 else {
        }
        return reloadedFeed;
      }
    }
);
  }
  return null;
}