nus-yam/ex-repair huggingface dataset:
Program: 77783
Project: 77783
Buggy source:
/** 
 * Sets the scene specified by the given integer. For use in combination with static integers provided by WindowManager for identification of the scenes. If a number is given that is not assigned as number for a scene the mainScene will be set.
 * @param sceneToShow the number of the scene that shall be set.
 */
public void showScene(int sceneToShow){
  if (sceneToShow == SHOW_CUSTOMERSCENE) {
    customerFrameController.refresh();
  }
  if (sceneToShow == SHOW_SHOOTINGSCENE) {
    shootingAdminController.inactivemode();
  }
switch (sceneToShow) {
case END_APPLICATION:
    closeStages();
  break;
case SHOW_SHOOTINGSCENE:
mainStage.setScene(shootingScene);
break;
case SHOW_MINIATURESCENE:
mainStage.setScene(miniaturScene);
break;
case SHOW_CUSTOMERSCENE:
mainStage.setScene(customerScene);
break;
case SHOW_SETTINGSCENE:
mainStage.setScene(settingScene);
break;
case SHOW_RECOVERYSCENE:
mainStage.setScene(recoveryScene);
break;
default :
mainStage.setScene(mainScene);
break;
}
mainStage.setFullScreen(true);
}

Fixed version (ground truth):
/** 
 * Sets the scene specified by the given integer. For use in combination with static integers provided by WindowManager for identification of the scenes. If a number is given that is not assigned as number for a scene the mainScene will be set.
 * @param sceneToShow the number of the scene that shall be set.
 */
public void showScene(int sceneToShow){
switch (sceneToShow) {
case END_APPLICATION:
    closeStages();
  break;
case SHOW_SHOOTINGSCENE:
shootingAdminController.inactivemode();
mainStage.setScene(shootingScene);
break;
case SHOW_MINIATURESCENE:
miniaturFrameController.addNewHBoxes();
mainStage.setScene(miniaturScene);
break;
case SHOW_CUSTOMERSCENE:
customerFrameController.refresh();
mainStage.setScene(customerScene);
break;
case SHOW_SETTINGSCENE:
mainStage.setScene(settingScene);
break;
case SHOW_RECOVERYSCENE:
mainStage.setScene(recoveryScene);
break;
default :
mainStage.setScene(mainScene);
break;
}
mainStage.setFullScreen(true);
}
Program: 77786
Project: 77786
Buggy source:
/** 
 * Saves image in images folder and in database. Also tells the Shot monitor to refresh the image.
 */
@Override public List<CameraThread> createThreads() throws CameraException {
  threadList=new ArrayList<>();
  for (  Camera camera : cameraList) {
    int index=cameraList.indexOf(camera);
    CameraThread cameraThread=new CameraThread();
    cameraThread.setCameraGphoto(cameraGphotoList.get(index));
    cameraThread.setCamera(camera);
    threadList.add(cameraThread);
  }
  return threadList;
}

Fixed version (ground truth):
/** 
 * Saves image in images folder and in database. Also tells the Shot monitor to refresh the image.
 */
@Override public List<CameraThread> createThreads(List<Camera> cameraList) throws CameraException {
  threadList=new ArrayList<>();
  for (  Camera camera : cameraList) {
    int index=cameraList.indexOf(camera);
    CameraThread cameraThread=new CameraThread();
    cameraThread.setCameraGphoto(cameraGphotoList.get(index));
    cameraThread.setCamera(camera);
    threadList.add(cameraThread);
  }
  return threadList;
}
Program: 77788
Project: 77788
Buggy source:
@Override public Profile read(int id) throws PersistenceException {
  LOGGER.debug("String_Node_Str" + id);
  ResultSet rs;
  String sqlString;
  PreparedStatement stmt=null;
  sqlString="String_Node_Str";
  try {
    stmt=this.con.prepareStatement(sqlString);
    stmt.setInt(1,id);
    rs=stmt.executeQuery();
    if (rs.next()) {
      Profile profile=new Profile(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),pairCameraPositionDAO.readAllWithProfileID(id),pairLogoRelativeRectangleDAO.readAllWithProfileID(id),new ArrayList<>(),rs.getBoolean("String_Node_Str"),rs.getBoolean("String_Node_Str"),rs.getBoolean("String_Node_Str"),rs.getBoolean("String_Node_Str"),rs.getString("String_Node_Str"),rs.getBoolean("String_Node_Str"));
      if (profile.getWatermark() == null) {
        profile.setWatermark("String_Node_Str");
      }
      sqlString="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
      stmt=this.con.prepareStatement(sqlString);
      stmt.setInt(1,profile.getId());
      rs=stmt.executeQuery();
      if (rs.next()) {
        profile.getBackgroundCategories().add(backgroundCategoryDAO.read(rs.getInt("String_Node_Str")));
      }
      return profile;
    }
 else {
      LOGGER.debug("String_Node_Str");
      return null;
    }
  }
 catch (  SQLException e) {
    throw new PersistenceException("String_Node_Str" + e);
  }
 finally {
    try {
      if (stmt != null)       stmt.close();
    }
 catch (    SQLException e) {
      throw new PersistenceException("String_Node_Str" + e);
    }
  }
}

Fixed version (ground truth):
@Override public Profile read(int id) throws PersistenceException {
  LOGGER.debug("String_Node_Str" + id);
  ResultSet rs;
  String sqlString;
  PreparedStatement stmt=null;
  sqlString="String_Node_Str";
  try {
    stmt=this.con.prepareStatement(sqlString);
    stmt.setInt(1,id);
    rs=stmt.executeQuery();
    if (rs.next()) {
      Profile profile=new Profile(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),pairCameraPositionDAO.readAllWithProfileID(id),pairLogoRelativeRectangleDAO.readAllWithProfileID(id),new ArrayList<>(),rs.getBoolean("String_Node_Str"),rs.getBoolean("String_Node_Str"),rs.getBoolean("String_Node_Str"),rs.getBoolean("String_Node_Str"),rs.getString("String_Node_Str"),rs.getBoolean("String_Node_Str"));
      if (profile.getWatermark() == null) {
        profile.setWatermark("String_Node_Str");
      }
      sqlString="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
      stmt=this.con.prepareStatement(sqlString);
      stmt.setInt(1,profile.getId());
      rs=stmt.executeQuery();
      while (rs.next()) {
        profile.getBackgroundCategories().add(backgroundCategoryDAO.read(rs.getInt("String_Node_Str")));
      }
      return profile;
    }
 else {
      LOGGER.debug("String_Node_Str");
      return null;
    }
  }
 catch (  SQLException e) {
    throw new PersistenceException("String_Node_Str" + e);
  }
 finally {
    try {
      if (stmt != null)       stmt.close();
    }
 catch (    SQLException e) {
      throw new PersistenceException("String_Node_Str" + e);
    }
  }
}
Program: 77789
Project: 77789
Buggy source:
@Autowired public ProfileServiceImpl(ProfileDAO profileDAO,PositionDAO positionDAO,LogoDAO logoDAO,CameraDAO cameraDAO,ShootingService shootingService,CameraService cameraService) throws ServiceException {
  this.profileDAO=profileDAO;
  this.positionDAO=positionDAO;
  this.logoDAO=logoDAO;
  this.cameraDAO=cameraDAO;
  this.shootingService=shootingService;
  this.cameraService=cameraService;
  this.setActiveProfile(1);
  try {
    profileList.addAll(profileDAO.readAll());
    positionList.addAll(positionDAO.readAll());
    logoList.addAll(logoDAO.readAll());
    cameraList.addAll(cameraDAO.readActive());
  }
 catch (  PersistenceException e) {
    throw new ServiceException("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
@Autowired public ProfileServiceImpl(ProfileDAO profileDAO,PositionDAO positionDAO,LogoDAO logoDAO,CameraDAO cameraDAO,ShootingService shootingService,CameraService cameraService,BackgroundService backgroundService) throws ServiceException {
  this.profileDAO=profileDAO;
  this.positionDAO=positionDAO;
  this.logoDAO=logoDAO;
  this.cameraDAO=cameraDAO;
  this.shootingService=shootingService;
  this.cameraService=cameraService;
  this.backgroundService=backgroundService;
  this.setActiveProfile(1);
  try {
    profileList.addAll(profileDAO.readAll());
    positionList.addAll(positionDAO.readAll());
    logoList.addAll(logoDAO.readAll());
    cameraList.addAll(cameraDAO.readActive());
  }
 catch (  PersistenceException e) {
    throw new ServiceException("String_Node_Str" + e);
  }
}
Program: 77791
Project: 77791
Buggy source:
@Override public void stop() throws Exception {
  LOGGER.info("String_Node_Str");
  DBHandler dbHandler=applicationContext.getBean(DBHandler.class);
  if (dbHandler != null) {
    dbHandler.closeConnection();
  }
  ImageProcessingManager imageProcessingManager=applicationContext.getBean(ImageProcessingManager.class);
  imageProcessingManager.stopImageProcessing();
  if (this.applicationContext != null && applicationContext.isRunning()) {
    this.applicationContext.close();
  }
  super.stop();
}

Fixed version (ground truth):
@Override public void stop() throws Exception {
  LOGGER.info("String_Node_Str");
  ImageProcessingManager imageProcessingManager=applicationContext.getBean(ImageProcessingManager.class);
  imageProcessingManager.stopImageProcessing();
  DBHandler dbHandler=applicationContext.getBean(DBHandler.class);
  if (dbHandler != null) {
    dbHandler.closeConnection();
  }
  if (this.applicationContext != null && applicationContext.isRunning()) {
    this.applicationContext.close();
  }
  super.stop();
}
Program: 77792
Project: 77792
Buggy source:
private void capturePreview(){
  final CameraFile cf;
  try {
    cf=cameraGphoto.capturePreview();
  }
 catch (  CameraException e) {
    LOGGER.error("String_Node_Str",e);
    setStop(true);
    return;
  }
  if (cf == null) {
    LOGGER.error("String_Node_Str");
    return;
  }
  String imagePath=tempStorage + "String_Node_Str" + +camera.getId()+ "String_Node_Str";
  try {
    cf.save(new File(imagePath).getAbsolutePath());
  }
 catch (  CameraException e) {
    LOGGER.error("String_Node_Str",imagePath,e);
    setStop(true);
  }
 finally {
    CameraUtils.closeQuietly(cf);
  }
  try {
    imageProcessor.processPreview(imagePath);
  }
 catch (  ServiceException e) {
    if (!shouldStop) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void capturePreview(){
  final CameraFile cf;
  try {
    cf=cameraGphoto.capturePreview();
  }
 catch (  CameraException e) {
    LOGGER.error("String_Node_Str",e);
    setStop(true);
    return;
  }
  if (cf == null) {
    LOGGER.error("String_Node_Str");
    return;
  }
  String imagePath=tempStoragePath + "String_Node_Str" + +camera.getId()+ "String_Node_Str";
  try {
    cf.save(new File(imagePath).getAbsolutePath());
  }
 catch (  CameraException e) {
    LOGGER.error("String_Node_Str",imagePath,e);
    setStop(true);
  }
 finally {
    CameraUtils.closeQuietly(cf);
  }
  try {
    imageProcessor.processPreview(imagePath);
  }
 catch (  ServiceException|NullPointerException e) {
    if (!shouldStop) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}
Program: 77793
Project: 77793
Buggy source:
@Override public void run(){
  createTempDir();
  while (!shouldStop) {
    if (takeImage) {
      if (countdown != 0) {
        shotFrameController.showCountdown(countdown);
        while (!shotFrameController.isExpired()) {
          capturePreview();
        }
      }
      captureImage();
      takeImage=false;
    }
 else {
      capturePreview();
    }
    if (shouldStop) {
      try {
        cameraGphoto.close();
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
      LOGGER.debug("String_Node_Str",camera);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!checkInitialized()) {
    LOGGER.error("String_Node_Str");
    shouldStop=true;
  }
  while (!shouldStop) {
    if (takeImage) {
      if (countdown != 0) {
        shotFrameController.showCountdown(countdown);
        while (!shotFrameController.isExpired()) {
          capturePreview();
        }
      }
      captureImage();
      takeImage=false;
    }
 else {
      capturePreview();
    }
    if (shouldStop) {
      try {
        cameraGphoto.close();
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
      LOGGER.debug("String_Node_Str",camera);
    }
  }
}
Program: 77794
Project: 77794
Buggy source:
/** 
 * deleting created mini preview images in filesystem
 * @param imgPath imagepath to delete
 */
public void deletePreviews(String imgPath){
  LOGGER.debug("String_Node_Str" + imgPath);
  String[] parts=imgPath.split("String_Node_Str");
  String imgFilterName=parts[parts.length - 1].replace("String_Node_Str","String_Node_Str");
  File previewFile=new File(activeShooting.getStorageDir() + imgFilterName);
  if (previewFile.isFile())   previewFile.delete();
}

Fixed version (ground truth):
/** 
 * deleting created mini preview images in filesystem
 * @param imgPath imagepath to delete
 */
public void deletePreviews(String imgPath){
  LOGGER.debug("String_Node_Str" + imgPath);
  String[] parts=imgPath.split("String_Node_Str");
  String imgFilterName=parts[parts.length - 1].replace("String_Node_Str","String_Node_Str");
  File previewFile=new File(tempStorageDir + imgFilterName);
  if (previewFile.isFile())   previewFile.delete();
}
Program: 77795
Project: 77795
Buggy source:
@Autowired public FullScreenImageController(WindowManager windowManager,ShootingService shootingService,FilterService filterService,ImageService imageService,ImagePrinter imagePrinter,ImageHandler imageHandler,RefreshManager refreshManager) throws ServiceException {
  this.filterService=filterService;
  this.imageService=imageService;
  this.shootingService=shootingService;
  this.windowManager=windowManager;
  this.imagePrinter=imagePrinter;
  this.refreshManager=refreshManager;
  this.imageHandler=imageHandler;
  this.activeShooting=shootingService.searchIsActive();
}

Fixed version (ground truth):
@Autowired public FullScreenImageController(WindowManager windowManager,ShootingService shootingService,FilterService filterService,ImageService imageService,ImagePrinter imagePrinter,ImageHandler imageHandler,RefreshManager refreshManager,TempStorageHandler tempStorageHandler) throws ServiceException {
  this.filterService=filterService;
  this.imageService=imageService;
  this.shootingService=shootingService;
  this.windowManager=windowManager;
  this.imagePrinter=imagePrinter;
  this.refreshManager=refreshManager;
  this.imageHandler=imageHandler;
  this.tempStorageDir=tempStorageHandler.getTempStoragePath();
}
Program: 77796
Project: 77796
Buggy source:
/** 
 * saves the filtered image in database...
 */
@FXML public void saveFilteredImg(){
  if (cropping) {
    onCheckPressed();
  }
 else {
    LOGGER.debug("String_Node_Str" + filteredImgPath);
    try {
      activeFilterImageView.setFitHeight(80);
      activeFilterImageView.setPreserveRatio(false);
      saveFilteredButton.setVisible(false);
      String[] parts=ivfullscreenImage.getId().split("String_Node_Str");
      String imgFilterName=parts[parts.length - 1].replace("String_Node_Str","String_Node_Str" + activeFilterImageView.getId() + "String_Node_Str");
      String destPath=activeShooting.getStorageDir() + imgFilterName;
      imageHandler.saveImage(filterService.filter(activeFilterImageView.getId(),ivfullscreenImage.getId()),destPath);
      activeFilterImageView=null;
      at.ac.tuwien.sepm.ws16.qse01.entities.Image newImage=imageService.create(new at.ac.tuwien.sepm.ws16.qse01.entities.Image(destPath,activeShooting.getId()));
      if ((currentIndex + 1) >= imageList.size()) {
        imageList.add(newImage);
        refreshManager.notifyMiniatureFrameOfAdd(newImage,-1);
      }
 else {
        imageList.add(currentIndex + 1,newImage);
        refreshManager.notifyMiniatureFrameOfAdd(newImage,currentIndex + 1);
      }
      currentIndex=currentIndex + 1;
      button4.setVisible(true);
      LOGGER.debug("String_Node_Str");
    }
 catch (    ImageHandlingException|ServiceException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
/** 
 * saves the filtered image in database...
 */
@FXML public void saveFilteredImg(){
  if (cropping) {
    onCheckPressed();
  }
 else {
    LOGGER.debug("String_Node_Str" + filteredImgPath);
    try {
      activeFilterImageView.setFitHeight(80);
      activeFilterImageView.setPreserveRatio(false);
      saveFilteredButton.setVisible(false);
      String[] parts=ivfullscreenImage.getId().split("String_Node_Str");
      String imgFilterName=parts[parts.length - 1].replace("String_Node_Str","String_Node_Str" + activeFilterImageView.getId() + "String_Node_Str");
      String destPath=shootingService.searchIsActive().getStorageDir() + imgFilterName;
      imageHandler.saveImage(filterService.filter(activeFilterImageView.getId(),ivfullscreenImage.getId()),destPath);
      activeFilterImageView=null;
      int shootingID=shootingService.searchIsActive().getId();
      at.ac.tuwien.sepm.ws16.qse01.entities.Image newImage=imageService.create(new at.ac.tuwien.sepm.ws16.qse01.entities.Image(destPath,shootingID));
      if ((currentIndex + 1) >= imageList.size()) {
        imageList.add(newImage);
        refreshManager.notifyMiniatureFrameOfAdd(newImage,-1);
      }
 else {
        imageList.add(currentIndex + 1,newImage);
        refreshManager.notifyMiniatureFrameOfAdd(newImage,currentIndex + 1);
      }
      currentIndex=currentIndex + 1;
      button4.setVisible(true);
      LOGGER.debug("String_Node_Str");
    }
 catch (    ImageHandlingException|ServiceException e) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}
Program: 77798
Project: 77798
Buggy source:
@Autowired public ImageProcessingManagerImpl(CameraHandler cameraHandler,ShotFrameManager shotFrameManager,RefreshManager refreshManager,ShootingService shootingService,ProfileService profileService,ImageService imageService,RemoteService remoteService,OpenCVLoader openCVLoader){
  this.cameraHandler=cameraHandler;
  this.shotFrameManager=shotFrameManager;
  this.refreshManager=refreshManager;
  this.shootingService=shootingService;
  this.profileService=profileService;
  this.imageService=imageService;
  this.remoteService=remoteService;
  this.openCVLoader=openCVLoader;
}

Fixed version (ground truth):
@Autowired public ImageProcessingManagerImpl(CameraHandler cameraHandler,ShotFrameManager shotFrameManager,RefreshManager refreshManager,ShootingService shootingService,ProfileService profileService,ImageService imageService,RemoteService remoteService,OpenCVLoader openCVLoader,TempStorageHandler tempStorageHandler){
  this.cameraHandler=cameraHandler;
  this.shotFrameManager=shotFrameManager;
  this.refreshManager=refreshManager;
  this.shootingService=shootingService;
  this.profileService=profileService;
  this.imageService=imageService;
  this.remoteService=remoteService;
  this.openCVLoader=openCVLoader;
  this.tempStorageHandler=tempStorageHandler;
}
Program: 77799
Project: 77799
Buggy source:
@Override public String resize(String imgPath,int width,int height){
  LOGGER.debug("String_Node_Str" + imgPath);
  Mat source=Imgcodecs.imread(imgPath,Imgcodecs.CV_LOAD_IMAGE_COLOR);
  Mat resizeimage=new Mat();
  Size sz=new Size(width,height);
  Imgproc.resize(source,resizeimage,sz);
  source.release();
  String[] parts=imgPath.split("String_Node_Str");
  String imgFilterName=parts[parts.length - 1].replace("String_Node_Str","String_Node_Str");
  Imgcodecs.imwrite(storageDir + imgFilterName,resizeimage);
  resizeimage.release();
  return storageDir + imgFilterName;
}

Fixed version (ground truth):
@Override public String resize(String imgPath,int width,int height) throws ServiceException {
  LOGGER.debug("String_Node_Str" + imgPath);
  Mat source=Imgcodecs.imread(imgPath,Imgcodecs.CV_LOAD_IMAGE_COLOR);
  Mat resizeimage=new Mat();
  Size sz=new Size(width,height);
  Imgproc.resize(source,resizeimage,sz);
  source.release();
  String[] parts=imgPath.split("String_Node_Str");
  String imgFilterName=parts[parts.length - 1].replace("String_Node_Str","String_Node_Str");
  Imgcodecs.imwrite(storageDir + imgFilterName,resizeimage);
  resizeimage.release();
  return storageDir + imgFilterName;
}
Program: 77800
Project: 77800
Buggy source:
@Autowired public FilterServiceImpl(ShootingService shootingService,OpenCVLoader openCVLoader,ImageHandler imageHandler) throws ServiceException {
  filterList=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  activeShooting=shootingService.searchIsActive();
  try {
    openCVLoader.loadLibrary();
  }
 catch (  LibraryLoadingException e) {
    LOGGER.error("String_Node_Str",e);
    throw new ServiceException("String_Node_Str",e);
  }
  this.imageHandler=imageHandler;
  storageDir=activeShooting.getStorageDir() + "String_Node_Str";
}

Fixed version (ground truth):
@Autowired public FilterServiceImpl(OpenCVLoader openCVLoader,ImageHandler imageHandler,TempStorageHandler tempStorageHandler) throws ServiceException {
  filterList=Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  try {
    openCVLoader.loadLibrary();
  }
 catch (  LibraryLoadingException e) {
    LOGGER.error("String_Node_Str",e);
    throw new ServiceException("String_Node_Str",e);
  }
  storageDir=tempStorageHandler.getTempStoragePath();
  this.imageHandler=imageHandler;
}
Program: 77801
Project: 77801
Buggy source:
@Override public void stop() throws Exception {
  LOGGER.info("String_Node_Str");
  ImageProcessingManager imageProcessingManager=applicationContext.getBean(ImageProcessingManager.class);
  imageProcessingManager.stopImageProcessing();
  DBHandler dbHandler=applicationContext.getBean(DBHandler.class);
  if (dbHandler != null) {
    dbHandler.closeConnection();
  }
  if (this.applicationContext != null && applicationContext.isRunning()) {
    this.applicationContext.close();
  }
  super.stop();
}

Fixed version (ground truth):
@Override public void stop() throws Exception {
  LOGGER.info("String_Node_Str");
  ImageProcessingManager imageProcessingManager=applicationContext.getBean(ImageProcessingManager.class);
  imageProcessingManager.stopImageProcessing();
  CameraHandler cameraHandler=applicationContext.getBean(CameraHandler.class);
  cameraHandler.closeCameras();
  DBHandler dbHandler=applicationContext.getBean(DBHandler.class);
  if (dbHandler != null) {
    dbHandler.closeConnection();
  }
  if (this.applicationContext != null && applicationContext.isRunning()) {
    this.applicationContext.close();
  }
  super.stop();
}
Program: 77802
Project: 77802
Buggy source:
/** 
 * Sets the countdown flag in the CameraThread
 * @param camera camera that shall be configured
 * @param countdown number of seconds a countdown should be displayed
 */
public void setCountdown(Camera camera,int countdown);

Fixed version (ground truth):
/** 
 * Sets the countdown flag in the CameraThread
 * @param camera camera that shall be configured
 * @param countdown number of seconds a countdown should be displayed
 */
void setCountdown(Camera camera,int countdown);
Program: 77803
Project: 77803
Buggy source:
/** 
 * Sets the serieShot flag in the CameraThread
 * @param camera camera that shall be configured
 * @param serieShot whether multiple shots should be taken or not
 */
public void setSerieShot(Camera camera,boolean serieShot);

Fixed version (ground truth):
/** 
 * Sets the serieShot flag in the CameraThread
 * @param camera camera that shall be configured
 * @param serieShot whether multiple shots should be taken or not
 */
void setSerieShot(Camera camera,boolean serieShot);
Program: 77805
Project: 77805
Buggy source:
@Override public void run(){
  if (!checkInitialized()) {
    LOGGER.error("String_Node_Str");
    shouldStop=true;
  }
  while (!shouldStop) {
    if (takeImage) {
      if (countdown != 0) {
        shotFrameController.showCountdown(countdown);
        while (!shotFrameController.isExpired()) {
          capturePreview();
        }
      }
      captureImage();
      takeImage=false;
    }
 else {
      capturePreview();
    }
    if (shouldStop) {
      try {
        cameraGphoto.close();
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
      LOGGER.debug("String_Node_Str",camera);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!checkInitialized()) {
    LOGGER.error("String_Node_Str");
    shouldStop=true;
  }
  while (!shouldStop) {
    if (takeImage) {
      if (countdown != 0) {
        shotFrameController.showCountdown(countdown);
        while (!shotFrameController.isExpired()) {
          capturePreview();
        }
      }
      captureImage();
      takeImage=false;
    }
 else {
      capturePreview();
    }
  }
  LOGGER.debug("String_Node_Str",camera);
}
Program: 77806
Project: 77806
Buggy source:
/** 
 * Shooting ends to do so the service methode endShooting gets called and main frame gets called catches ServiceException caused by Service methodes
 */
@FXML public void onStopShootingPressed(){
  try {
    profileService.resetActiveProfileNonPersistentAttributes();
    shootingService.endShooting();
    inactivemode();
    imageProcessingManager.stopImageProcessing();
    windowManager.showScene(WindowManager.SHOW_MAINSCENE);
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
    showInformationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Shooting ends to do so the service methode endShooting gets called and main frame gets called catches ServiceException caused by Service methodes
 */
@FXML public void onStopShootingPressed(){
  try {
    imageProcessingManager.stopImageProcessing();
    profileService.resetActiveProfileNonPersistentAttributes();
    shootingService.endShooting();
    inactivemode();
    windowManager.showScene(WindowManager.SHOW_MAINSCENE);
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
    showInformationDialog("String_Node_Str");
  }
}
Program: 77807
Project: 77807
Buggy source:
@Autowired public ImageProcessingManagerImpl(CameraHandler cameraHandler,ShotFrameManager shotFrameManager,RefreshManager refreshManager,ShootingService shootingService,ProfileService profileService,ImageService imageService,RemoteService remoteService,OpenCVLoader openCVLoader,TempStorageHandler tempStorageHandler){
  this.cameraHandler=cameraHandler;
  this.shotFrameManager=shotFrameManager;
  this.refreshManager=refreshManager;
  this.shootingService=shootingService;
  this.profileService=profileService;
  this.imageService=imageService;
  this.remoteService=remoteService;
  this.openCVLoader=openCVLoader;
  this.tempStorageHandler=tempStorageHandler;
}

Fixed version (ground truth):
@Autowired public ImageProcessingManagerImpl(CameraHandler cameraHandler,ShotFrameManager shotFrameManager,RefreshManager refreshManager,ShootingService shootingService,ProfileService profileService,ImageService imageService,OpenCVLoader openCVLoader,TempStorageHandler tempStorageHandler){
  this.cameraHandler=cameraHandler;
  this.shotFrameManager=shotFrameManager;
  this.refreshManager=refreshManager;
  this.shootingService=shootingService;
  this.profileService=profileService;
  this.imageService=imageService;
  this.openCVLoader=openCVLoader;
  this.tempStorageHandler=tempStorageHandler;
}
Program: 77808
Project: 77808
Buggy source:
private Map<Position,ShotFrameController> initShotFrameManager(List<Camera> cameraList) throws ServiceException {
  List<Position> positionList=new ArrayList<>();
  for (  Camera c : cameraList) {
    Position p=profileService.getPositionOfCameraOfProfile(c);
    if (p != null) {
      LOGGER.debug("String_Node_Str");
      positionList.add(p);
    }
 else {
      LOGGER.info("String_Node_Str" + c.getId());
      cameraHandler.removeCameraFromList(c);
    }
  }
  int positionNumber=profileService.getAllPairCameraPositionOfProfile().size();
  if (positionList.size() != positionNumber) {
    LOGGER.info("String_Node_Str" + positionList.size() + "String_Node_Str"+ positionNumber);
    throw new ServiceException("String_Node_Str");
  }
  LOGGER.info("String_Node_Str" + positionList.size() + "String_Node_Str"+ positionNumber);
  if (positionList.isEmpty()) {
    LOGGER.debug("String_Node_Str");
    return null;
  }
  Map<Position,ShotFrameController> positionShotFrameMap=shotFrameManager.init(positionList);
  if (positionShotFrameMap == null || positionShotFrameMap.isEmpty()) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str");
  }
  return positionShotFrameMap;
}

Fixed version (ground truth):
private Map<Position,ShotFrameController> initShotFrameManager(List<Camera> cameraList) throws ServiceException {
  List<Position> positionList=new ArrayList<>();
  for (int i=0; i < cameraList.size(); i++) {
    Camera c=cameraList.get(i);
    Position p=profileService.getPositionOfCameraOfProfile(c);
    if (p != null) {
      LOGGER.debug("String_Node_Str");
      positionList.add(p);
    }
 else {
      LOGGER.info("String_Node_Str",c);
      cameraHandler.removeCameraFromList(c);
    }
  }
  int positionNumber=profileService.getAllPairCameraPositionOfProfile().size();
  if (positionList.size() != positionNumber) {
    LOGGER.info("String_Node_Str" + positionList.size() + "String_Node_Str"+ positionNumber);
    throw new ServiceException("String_Node_Str");
  }
  LOGGER.info("String_Node_Str" + positionList.size() + "String_Node_Str"+ positionNumber);
  if (positionList.isEmpty()) {
    LOGGER.debug("String_Node_Str");
    return null;
  }
  Map<Position,ShotFrameController> positionShotFrameMap=shotFrameManager.init(positionList);
  if (positionShotFrameMap == null || positionShotFrameMap.isEmpty()) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str");
  }
  return positionShotFrameMap;
}
Program: 77809
Project: 77809
Buggy source:
@Override public TableCell<Profile.PairCameraPosition,Boolean> call(TableColumn<Profile.PairCameraPosition,Boolean> p){
  return new CamPosCheckbox(kamPosList,pservice,kamList,selectedProfile,"String_Node_Str",windowManager.getStage());
}

Fixed version (ground truth):
@Override public TableCell<Profile.PairCameraPosition,Boolean> call(TableColumn<Profile.PairCameraPosition,Boolean> p){
  return new CamPosCheckbox(kamPosList,pservice,selectedProfile,"String_Node_Str",windowManager.getStage());
}
Program: 77810
Project: 77810
Buggy source:
public void refreshTableKameraPosition(List<Profile.PairCameraPosition> camposList,ObservableList<Position> posList,ObservableList<Profile> selectedID){
  LOGGER.debug("String_Node_Str" + posList.size() + posList.toString());
  selectedProfile=selectedID;
  this.posList.clear();
  this.posList.addAll(posList);
  this.kamPosList.clear();
  this.kamPosList.addAll(camposList);
  tableKamPos.setItems(this.kamPosList);
}

Fixed version (ground truth):
public void refreshTableKameraPosition(List<Profile.PairCameraPosition> camposList,ObservableList<Position> posList,ObservableList<Profile> selectedID){
  LOGGER.debug("String_Node_Str" + posList.size() + posList.toString());
  kamPosController=this;
  selectedProfile=selectedID;
  this.posList.clear();
  this.posList.addAll(posList);
  this.kamPosList.clear();
  this.kamPosList.addAll(camposList);
  tableKamPos.setItems(this.kamPosList);
}
Program: 77811
Project: 77811
Buggy source:
@Override public void handle(TableColumn.CellEditEvent<Profile.PairCameraPosition,String> t){
  try {
    Profile.PairCameraPosition p=((Profile.PairCameraPosition)t.getTableView().getItems().get(t.getTablePosition().getRow()));
    if (t.getNewValue().compareTo("String_Node_Str") != 0) {
      kamPosList.remove(p);
      p.getCamera().setLable(t.getNewValue());
      cameraService.editCamera(p.getCamera());
      kamPosList.add(t.getTablePosition().getRow(),p);
    }
 else {
      refreshTablePosition(pservice.getAllPositionsOfProfile(pservice.get(selectedProfile.get(0).getId())));
    }
  }
 catch (  ServiceException e) {
    try {
      refreshTableProfiles(pservice.getAllProfiles());
    }
 catch (    ServiceException e1) {
      LOGGER.error("String_Node_Str",e1);
    }
  }
}

Fixed version (ground truth):
@Override public void handle(TableColumn.CellEditEvent<Profile.PairCameraPosition,String> t){
  try {
    Profile.PairCameraPosition p=((Profile.PairCameraPosition)t.getTableView().getItems().get(t.getTablePosition().getRow()));
    if (t.getNewValue().compareTo("String_Node_Str") != 0) {
      kamPosList.remove(p);
      p.getCamera().setLable(t.getNewValue());
      cameraService.editCamera(p.getCamera());
      kamPosList.add(t.getTablePosition().getRow(),p);
      tableKamPos.getSelectionModel().select(t.getTablePosition().getRow());
    }
 else {
      refreshTablePosition(pservice.getAllPositionsOfProfile(pservice.get(selectedProfile.get(0).getId())));
    }
  }
 catch (  ServiceException e) {
    try {
      refreshTableProfiles(pservice.getAllProfiles());
    }
 catch (    ServiceException e1) {
      LOGGER.error("String_Node_Str",e1);
    }
  }
}
Program: 77815
Project: 77815
Buggy source:
@Override public List<Profile.PairCameraPosition> getAllPairCamerasWithPositionByProfile(int profileID) throws ServiceException {
  List<Profile.PairCameraPosition> allCameras=getAllPairCameraPositionOfProfile(profileID);
  for (  Camera c : cameraService.getAllCameras()) {
    boolean exist=false;
    for (    Profile.PairCameraPosition p : allCameras) {
      if (c.getId() == p.getCamera().getId())       exist=true;
    }
    if (!exist)     allCameras.add(new Profile.PairCameraPosition(profileID,c,null,false));
  }
  return allCameras;
}

Fixed version (ground truth):
@Override public List<Profile.PairCameraPosition> getAllPairCamerasWithPositionByProfile(int profileID) throws ServiceException {
  List<Profile.PairCameraPosition> allCameras=getAllPairCameraPositionOfProfile(profileID);
  for (  Camera c : cameraService.getAllCameras()) {
    boolean exist=false;
    for (    Profile.PairCameraPosition p : allCameras) {
      if (c.getId() == p.getCamera().getId())       exist=true;
    }
    if (!exist)     allCameras.add(new Profile.PairCameraPosition(profileID,c,null,false));
  }
  Collections.sort(allCameras,new Comparator<Profile.PairCameraPosition>(){
    @Override public int compare(    Profile.PairCameraPosition pair1,    Profile.PairCameraPosition pair2){
      return pair1.getCamera().getLable().compareTo(pair2.getCamera().getLable());
    }
  }
);
  return allCameras;
}
Program: 77816
Project: 77816
Buggy source:
/** 
 * Lets an AdminUserService instance check if the values given in the adminname- and password-TextField correspond to a saved admin-user.
 */
@FXML public void checkLogin(){
  String adminName=adminField.getText();
  String password=passwordField.getText();
  try {
    boolean correctLogin=adminUserService.checkLogin(adminName,password);
    if (correctLogin) {
      if (firstLogin) {
        Shooting activeShooting=shootingService.searchIsActive();
        if (activeShooting.getActive()) {
          firstLogin=false;
          windowManager.showScene(WindowManager.SHOW_RECOVERYSCENE);
        }
 else {
          windowManager.showScene(WindowManager.SHOW_MAINSCENE);
        }
      }
 else {
        firstLogin=false;
        windowManager.showScene(loginRedirectorModel.getNextScene());
      }
      resetValues();
    }
 else {
      wrongCredentialsLabel.setVisible(true);
    }
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Lets an AdminUserService instance check if the values given in the adminname- and password-TextField correspond to a saved admin-user.
 */
@FXML public void checkLogin(){
  String adminName=adminField.getText();
  String password=passwordField.getText();
  try {
    boolean correctLogin=adminUserService.checkLogin(adminName,password);
    if (correctLogin) {
      if (firstLogin) {
        Shooting activeShooting=shootingService.searchIsActive();
        if (activeShooting.getActive()) {
          firstLogin=false;
          windowManager.showScene(WindowManager.SHOW_RECOVERYSCENE);
        }
 else {
          firstLogin=false;
          windowManager.showScene(WindowManager.SHOW_MAINSCENE);
        }
      }
 else {
        firstLogin=false;
        windowManager.showScene(loginRedirectorModel.getNextScene());
      }
      resetValues();
    }
 else {
      wrongCredentialsLabel.setVisible(true);
    }
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 77817
Project: 77817
Buggy source:
private void capturePreview(){
  final CameraFile cf;
  try {
    cf=cameraGphoto.capturePreview();
  }
 catch (  CameraException e) {
    LOGGER.error("String_Node_Str",e);
    setStop(true);
    return;
  }
  if (cf == null) {
    LOGGER.error("String_Node_Str");
    return;
  }
  String imagePath=tempStorage + "String_Node_Str" + +camera.getId()+ "String_Node_Str";
  try {
    cf.save(new File(imagePath).getAbsolutePath());
  }
 catch (  CameraException e) {
    LOGGER.error("String_Node_Str",imagePath,e);
    setStop(true);
  }
 finally {
    CameraUtils.closeQuietly(cf);
  }
  try {
    imageProcessor.processPreview(imagePath);
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
private void capturePreview(){
  final CameraFile cf;
  try {
    cf=cameraGphoto.capturePreview();
  }
 catch (  CameraException e) {
    LOGGER.error("String_Node_Str",e);
    setStop(true);
    return;
  }
  if (cf == null) {
    LOGGER.error("String_Node_Str");
    return;
  }
  String imagePath=tempStorage + "String_Node_Str" + +camera.getId()+ "String_Node_Str";
  try {
    cf.save(new File(imagePath).getAbsolutePath());
  }
 catch (  CameraException e) {
    LOGGER.error("String_Node_Str",imagePath,e);
    setStop(true);
  }
 finally {
    CameraUtils.closeQuietly(cf);
  }
  try {
    imageProcessor.processPreview(imagePath);
  }
 catch (  ServiceException e) {
    if (!shouldStop) {
      LOGGER.error("String_Node_Str",e);
    }
  }
}
Program: 77819
Project: 77819
Buggy source:
@Override public void processPreview(String imgPath) throws ServiceException {
  Camera camera=profileService.getCameraOfPositionOfProfile(position);
  pairCameraPosition=profileService.getPairCameraPosition(camera);
  LOGGER.debug("String_Node_Str",position);
  BufferedImage preview;
  boolean isGreenscreen=pairCameraPosition.isGreenScreenReady();
  boolean isFilter=!"String_Node_Str".equals(pairCameraPosition.getFilterName());
  if (isGreenscreen) {
    Background background=pairCameraPosition.getBackground();
    preview=openImageThrowException(imgPath);
    if (background == null) {
      LOGGER.debug("String_Node_Str",position);
    }
 else {
      preview=greenscreenService.applyGreenscreen(preview,background);
      LOGGER.debug("String_Node_Str",background,position);
    }
  }
 else   if (isFilter) {
    String filterName=pairCameraPosition.getFilterName();
    preview=filterService.filter(filterName,imgPath);
    LOGGER.debug("String_Node_Str",filterName,position);
  }
 else {
    preview=openImageThrowException(imgPath);
    LOGGER.debug("String_Node_Str",position);
  }
  shotFrameController.refreshShot(preview);
}

Fixed version (ground truth):
@Override public void processPreview(String imgPath) throws ServiceException {
  Camera camera=profileService.getCameraOfPositionOfProfile(position);
  pairCameraPosition=profileService.getPairCameraPosition(camera);
  LOGGER.debug("String_Node_Str",position);
  BufferedImage preview;
  String filterName=pairCameraPosition.getFilterName();
  boolean isGreenscreen=pairCameraPosition.isGreenScreenReady();
  boolean isFilter=!"String_Node_Str".equals(filterName) && !"String_Node_Str".equals(filterName);
  if (isGreenscreen) {
    Background background=pairCameraPosition.getBackground();
    preview=openImageThrowException(imgPath);
    if (background == null) {
      LOGGER.debug("String_Node_Str",position);
    }
 else {
      preview=greenscreenService.applyGreenscreen(preview,background);
      LOGGER.debug("String_Node_Str",background,position);
    }
  }
 else   if (isFilter) {
    preview=filterService.filter(filterName,imgPath);
    LOGGER.debug("String_Node_Str",filterName,position);
  }
 else {
    preview=openImageThrowException(imgPath);
    LOGGER.debug("String_Node_Str",position);
  }
  shotFrameController.refreshShot(preview);
}
Program: 77820
Project: 77820
Buggy source:
@Override public void processShot(Image image) throws ServiceException {
  String imgPath=image.getImagepath();
  Camera camera=profileService.getCameraOfPositionOfProfile(position);
  pairCameraPosition=profileService.getPairCameraPosition(camera);
  LOGGER.debug("String_Node_Str",position);
  BufferedImage shot;
  boolean isGreenscreen=pairCameraPosition.isGreenScreenReady();
  boolean isFilter=!"String_Node_Str".equals(pairCameraPosition.getFilterName());
  if (isGreenscreen) {
    Background background=pairCameraPosition.getBackground();
    shot=openImageThrowException(imgPath);
    if (background == null) {
      LOGGER.debug("String_Node_Str",position);
    }
 else {
      shot=greenscreenService.applyGreenscreen(shot,background);
      LOGGER.debug("String_Node_Str",background,position);
    }
  }
 else   if (isFilter) {
    shot=saveUnfilterdImageAndApplyFilter(imgPath);
  }
 else {
    shot=openImageThrowException(imgPath);
  }
  logoWatermarkService.addLogosToImage(shot);
  shotFrameController.refreshShot(shot);
  Image filteredImage=null;
  if (isFilter) {
    filteredImage=persistFilteredImage(imgPath,shot);
  }
 else {
    saveImageThrowException(shot,imgPath);
    LOGGER.debug("String_Node_Str");
  }
  refreshManager.refreshFrames(image);
  if (isFilter) {
    refreshManager.refreshFrames(filteredImage);
  }
}

Fixed version (ground truth):
@Override public void processShot(Image image) throws ServiceException {
  String imgPath=image.getImagepath();
  Camera camera=profileService.getCameraOfPositionOfProfile(position);
  pairCameraPosition=profileService.getPairCameraPosition(camera);
  LOGGER.debug("String_Node_Str",position);
  BufferedImage shot;
  String filterName=pairCameraPosition.getFilterName();
  boolean isGreenscreen=pairCameraPosition.isGreenScreenReady();
  boolean isFilter=!"String_Node_Str".equals(filterName) && !"String_Node_Str".equals(filterName);
  if (isGreenscreen) {
    Background background=pairCameraPosition.getBackground();
    shot=openImageThrowException(imgPath);
    if (background == null) {
      LOGGER.debug("String_Node_Str",position);
    }
 else {
      shot=greenscreenService.applyGreenscreen(shot,background);
      LOGGER.debug("String_Node_Str",background,position);
    }
  }
 else   if (isFilter) {
    shot=saveUnfilterdImageAndApplyFilter(imgPath);
  }
 else {
    shot=openImageThrowException(imgPath);
  }
  logoWatermarkService.addLogosToImage(shot);
  shotFrameController.refreshShot(shot);
  Image filteredImage=null;
  if (isFilter) {
    filteredImage=persistFilteredImage(imgPath,shot);
  }
 else {
    saveImageThrowException(shot,imgPath);
    LOGGER.debug("String_Node_Str");
  }
  refreshManager.refreshFrames(image);
  if (isFilter) {
    refreshManager.refreshFrames(filteredImage);
  }
  LOGGER.info("String_Node_Str",image);
}
Program: 77822
Project: 77822
Buggy source:
public Map<Position,ShotFrameController> init(List<Position> positionList){
  Set<Position> oldPositions=positonShotFrameMap.keySet();
  int numberOfPosition=1;
  numberOfPosition+=positionList.size();
  int x=200;
  for (int i=1; i < numberOfPosition; i++) {
    Position position=positionList.get(i - 1);
    if (!oldPositions.contains(position)) {
      Stage stage=new Stage();
      stage.setTitle("String_Node_Str" + position.getName());
      try {
        FXMLLoader loader=new FXMLLoader(getClass().getResource("String_Node_Str"));
        Parent root=loader.load();
        ShotFrameController shotFrameController=loader.getController();
        shotFrameController.initShotFrame(position.getId());
        positonShotFrameMap.put(position,shotFrameController);
        stage.setScene(new Scene(root,400,400));
      }
 catch (      IOException e) {
        LOGGER.debug("String_Node_Str" + e.getMessage());
      }
      stage.setFullScreen(false);
      stage.setX(x);
      stage.show();
      shotStages.add(stage);
      x+=200;
    }
  }
  return positonShotFrameMap;
}

Fixed version (ground truth):
public Map<Position,ShotFrameController> init(List<Position> positionList){
  Set<Position> oldPositions=positonShotFrameMap.keySet();
  int numberOfPosition=1;
  numberOfPosition+=positionList.size();
  int x=200;
  for (int i=1; i < numberOfPosition; i++) {
    Position position=positionList.get(i - 1);
    if (!oldPositions.contains(position)) {
      Stage stage=new Stage();
      stage.setTitle("String_Node_Str" + position.getName());
      try {
        FXMLLoader loader=new FXMLLoader(getClass().getResource("String_Node_Str"));
        Parent root=loader.load();
        ShotFrameController shotFrameController=loader.getController();
        shotFrameController.initShotFrame(position.getId(),stage);
        positonShotFrameMap.put(position,shotFrameController);
        stage.setScene(new Scene(root,400,400));
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
      stage.setFullScreen(false);
      stage.setX(x);
      stage.show();
      shotStages.add(stage);
      x+=200;
    }
  }
  return positonShotFrameMap;
}
Program: 77825
Project: 77825
Buggy source:
public void init(Stage stage) throws ServiceException {
  this.stage=stage;
  scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
  scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
  double screenWidth=Screen.getPrimary().getBounds().getWidth();
  double screenHeight=Screen.getPrimary().getBounds().getHeight();
  tile.setMinWidth(screenWidth);
  tile.setMinHeight(screenHeight - 60);
  tile.setPadding(new Insets(20,20,20,20));
  tile.setHgap(20);
  tile.setVgap(20);
  if (shootingService.searchIsActive().getActive()) {
    LOGGER.debug("String_Node_Str" + shootingService.searchIsActive().getId());
    listOfImages=imageService.getAllImages(shootingService.searchIsActive().getId());
  }
 else {
    listOfImages=new ArrayList<>();
    return;
  }
  for (  final at.ac.tuwien.sepm.ws16.qse01.entities.Image img : listOfImages) {
    prepareHBox(img,-1);
  }
}

Fixed version (ground truth):
public void init(Stage stage){
  this.stage=stage;
  scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
  scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED);
  double screenWidth=Screen.getPrimary().getBounds().getWidth();
  double screenHeight=Screen.getPrimary().getBounds().getHeight();
  tile.getChildren().clear();
  tile.setMinWidth(screenWidth);
  tile.setMinHeight(screenHeight - 60);
  tile.setPadding(new Insets(20,20,20,20));
  tile.setHgap(20);
  tile.setVgap(20);
  try {
    if (shootingService.searchIsActive().getActive()) {
      LOGGER.info("String_Node_Str" + shootingService.searchIsActive().getId());
      listOfImages=imageService.getAllImages(shootingService.searchIsActive().getId());
    }
 else {
      listOfImages=new ArrayList<>();
      return;
    }
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
  for (  final at.ac.tuwien.sepm.ws16.qse01.entities.Image img : listOfImages) {
    prepareHBox(img,-1);
  }
}
Program: 77826
Project: 77826
Buggy source:
public void initShotFrame(int cameraID){
  this.frameID=cameraID;
}

Fixed version (ground truth):
public void initShotFrame(int cameraID,Stage primaryStage){
  this.frameID=cameraID;
  this.primaryStage=primaryStage;
}
Program: 77827
Project: 77827
Buggy source:
/** 
 * on time image pressed
 */
public void onTimerPressed(){
  unmark();
  profile.getPairCameraPositions().get(index).setShotType(Profile.PairCameraPosition.SHOT_TYPE_TIMED);
  ontime.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(3))));
  currentMode=2;
}

Fixed version (ground truth):
/** 
 * on time image pressed
 */
public void onTimerPressed(){
  try {
    unmark();
    profileservice.getActiveProfile().getPairCameraPositions().get(index).setShotType(Profile.PairCameraPosition.SHOT_TYPE_TIMED);
    ontime.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(3))));
    currentMode=2;
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}