nus-yam/ex-repair huggingface dataset:
Program: 77957
Project: 77957
Buggy source:
@Override public Image crop(Image original,int x1,int x2,int y1,int y2) throws ServiceException {
  try {
    BufferedImage bufOriginal=ImageIO.read(new File(original.getImagepath()));
    BufferedImage bufCropped=bufOriginal.getSubimage(x1,y1,x2 - x1,y2 - y1);
    Image img=new Image(-1,original.getImagepath().substring(0,original.getImagepath().length() - 4) + "String_Node_Str",original.getShootingid(),original.getDate());
    return imageDAO.createAndSave(img,bufCropped);
  }
 catch (  IOException e) {
    LOGGER.debug("String_Node_Str" + e);
    throw new ServiceException(e.getMessage());
  }
catch (  PersistenceException e) {
    LOGGER.debug("String_Node_Str" + e);
    throw new ServiceException(e.getMessage());
  }
}

Fixed version (ground truth):
@Override public Image crop(Image original,int x1,int x2,int y1,int y2,int maxX,int maxY) throws ServiceException {
  try {
    BufferedImage bufOriginal=ImageIO.read(new File(original.getImagepath()));
    int width=bufOriginal.getWidth();
    int height=bufOriginal.getHeight();
    double ratioX=width / (double)maxX;
    double ratioY=height / (double)maxY;
    int newX1=(int)(x1 * ratioX);
    int newX2=(int)(x2 * ratioX);
    int newY1=(int)(y1 * ratioY);
    int newY2=(int)(y2 * ratioY);
    BufferedImage bufCropped=bufOriginal.getSubimage(newX1,newY1,newX2 - newX1,newY2 - newY1);
    Image img=new Image(-1,original.getImagepath().substring(0,original.getImagepath().length() - 4) + "String_Node_Str",original.getShootingid(),original.getDate());
    return imageDAO.createAndSave(img,bufCropped);
  }
 catch (  IOException e) {
    LOGGER.debug("String_Node_Str" + e);
    throw new ServiceException(e.getMessage());
  }
catch (  PersistenceException e) {
    LOGGER.debug("String_Node_Str" + e);
    throw new ServiceException(e.getMessage());
  }
}
Program: 77958
Project: 77958
Buggy source:
@Override public TableCell<Profile.PairLogoRelativeRectangle,Boolean> call(TableColumn<Profile.PairLogoRelativeRectangle,Boolean> p){
  return new LogoButtonCell(logoList,pservice,windowManager.getStage(),selectedProfile.getId());
}

Fixed version (ground truth):
@Override public TableCell<Profile.PairLogoRelativeRectangle,Boolean> call(TableColumn<Profile.PairLogoRelativeRectangle,Boolean> p){
  return new LogoButtonCell(logoList,pservice,windowManager.getStage(),selectedProfileID);
}
Program: 77960
Project: 77960
Buggy source:
@Override public TableCell<Position,Boolean> call(TableColumn<Position,Boolean> p){
  return new PositionButtonCell(posList,kamPosList,selectedProfile.getId(),pservice,windowManager.getStage());
}

Fixed version (ground truth):
@Override public TableCell<Position,Boolean> call(TableColumn<Position,Boolean> p){
  System.out.println("String_Node_Str" + selectedProfileID);
  return new PositionButtonCell(posList,kamPosList,selectedProfileID,pservice,windowManager.getStage());
}
Program: 77961
Project: 77961
Buggy source:
public PositionFrameController(){
  super();
}

Fixed version (ground truth):
@Autowired public PositionFrameController(ProfileService pservice,LogoWatermarkService logoService,BackgroundService bservice,WindowManager windowmanager) throws ServiceException {
  super(pservice,logoService,bservice,windowmanager);
  System.out.println("String_Node_Str");
}
Program: 77963
Project: 77963
Buggy source:
public ProfileFrameController(){
  super();
}

Fixed version (ground truth):
@Autowired public ProfileFrameController(ProfileService pservice,LogoWatermarkService logoService,BackgroundService bservice,WindowManager windowmanager) throws ServiceException {
  super(pservice,logoService,bservice,windowmanager);
}
Program: 77965
Project: 77965
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),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");
      }
      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");
      }
      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: 77966
Project: 77966
Buggy source:
/** 
 * Constructor with unknown id will set id to Integer.MIN_VALUE and persistence layer has to provide a valid id
 * @param name - no empty profile name
 */
public Profile(String name){
  this(Integer.MIN_VALUE,name,new ArrayList<PairCameraPosition>(),new ArrayList<PairLogoRelativeRectangle>(),false,false,false,false,"String_Node_Str",false);
}

Fixed version (ground truth):
/** 
 * Constructor with unknown id will set id to Integer.MIN_VALUE and persistence layer has to provide a valid id
 * @param name - no empty profile name
 */
public Profile(String name){
  this(Integer.MIN_VALUE,name,new ArrayList<>(),new ArrayList<>(),new ArrayList<>(),false,false,false,false,"String_Node_Str",false);
}
Program: 77967
Project: 77967
Buggy source:
public void setFilterName(String filteName){
  this.filterName=filterName;
}

Fixed version (ground truth):
public void setFilterName(String filterName){
  this.filterName=filterName;
}
Program: 77969
Project: 77969
Buggy source:
/** 
 * on time image pressed
 */
public void ontimerPressed(){
  unmark();
  ontime.setStyle("String_Node_Str");
  currentMode[index]=2;
}

Fixed version (ground truth):
/** 
 * on time image pressed
 */
public void ontimerPressed(){
  unmark();
  ontime.setStyle("String_Node_Str");
  singel.setStyle("String_Node_Str");
  currentMode=2;
  kameraFilterService.setcurrent(index,currentMode);
}
Program: 77970
Project: 77970
Buggy source:
/** 
 * on single image pressed
 */
public void onsingelPressed(){
  unmark();
  singel.setStyle("String_Node_Str");
  currentMode[index]=0;
}

Fixed version (ground truth):
/** 
 * on single image pressed
 */
public void onsingelPressed(){
  unmark();
  singel.setStyle("String_Node_Str");
  currentMode=0;
  kameraFilterService.setcurrent(index,currentMode);
}
Program: 77971
Project: 77971
Buggy source:
@Autowired public KameraFilterController(FilterService filterService,ProfileService profileService,WindowManager wm,ImageService imageService,ShootingService shootingService){
  this.profileservice=profileService;
  this.wm=wm;
  this.imageService=imageService;
  this.shootingService=shootingService;
  this.filterService=filterService;
  try {
    profile=profileService.get(shootingService.searchIsActive().getProfileid());
    currentMode=new Integer[profile.getPairCameraPositions().size()];
  }
 catch (  ServiceException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Autowired public KameraFilterController(KameraFilterService kameraFilterService,FilterService filterService,ProfileService profileService,WindowManager wm,ImageService imageService,ShootingService shootingService){
  this.profileservice=profileService;
  this.wm=wm;
  this.imageService=imageService;
  this.shootingService=shootingService;
  this.filterService=filterService;
  this.kameraFilterService=kameraFilterService;
}
Program: 77972
Project: 77972
Buggy source:
/** 
 * on serien pictures pressed
 */
public void onserienPressed(){
  unmark();
  serien.setStyle("String_Node_Str");
  currentMode[index]=1;
}

Fixed version (ground truth):
/** 
 * on serien pictures pressed
 */
public void onserienPressed(){
  unmark();
  serien.setStyle("String_Node_Str");
  currentMode=1;
  kameraFilterService.setcurrent(index,currentMode);
}
Program: 77974
Project: 77974
Buggy source:
private void unmark(){
  try {
    int i=currentMode[index];
switch (i) {
case 0:
      singel.setStyle("String_Node_Str");
    break;
case 1:
  serien.setStyle("String_Node_Str");
break;
case 2:
ontime.setStyle("String_Node_Str");
singel.setStyle("String_Node_Str");
break;
}
}
 catch (NullPointerException n) {
LOGGER.error("String_Node_Str",n);
}
}

Fixed version (ground truth):
private void unmark(){
  try {
    int i=currentMode;
switch (i) {
case 0:
      singel.setStyle("String_Node_Str");
    break;
case 1:
  serien.setStyle("String_Node_Str");
break;
case 2:
ontime.setStyle("String_Node_Str");
singel.setStyle("String_Node_Str");
break;
}
}
 catch (NullPointerException n) {
LOGGER.error("String_Node_Str",n);
}
}
Program: 77975
Project: 77975
Buggy source:
/** 
 * gives currentMode
 * @return current mode (on time, single, serien)
 */
public int getCurrentMode(){
  return currentMode[index];
}

Fixed version (ground truth):
/** 
 * gives currentMode
 * @return current mode (on time, single, serien)
 */
public int getCurrentMode(){
  return currentMode;
}
Program: 77977
Project: 77977
Buggy source:
@Autowired public KameraFilterController(FilterService filterService,ProfileService profileService,WindowManager wm,ImageService imageService,ShootingService shootingService){
  this.profileservice=profileService;
  this.wm=wm;
  this.imageService=imageService;
  this.shootingService=shootingService;
  this.filterService=filterService;
}

Fixed version (ground truth):
@Autowired public KameraFilterController(FilterService filterService,ProfileService profileService,WindowManager wm,ImageService imageService,ShootingService shootingService){
  this.profileservice=profileService;
  this.wm=wm;
  this.imageService=imageService;
  this.shootingService=shootingService;
  this.filterService=filterService;
  try {
    profile=profileService.get(shootingService.searchIsActive().getProfileid());
    currentMode=new Integer[profile.getPairCameraPositions().size()];
  }
 catch (  ServiceException e) {
    e.printStackTrace();
  }
}
Program: 77979
Project: 77979
Buggy source:
private void unmark(){
  try {
switch (currentMode[index]) {
case 0:
      singel.setStyle("String_Node_Str");
    break;
case 1:
  serien.setStyle("String_Node_Str");
break;
case 2:
ontime.setStyle("String_Node_Str");
singel.setStyle("String_Node_Str");
break;
}
}
 catch (NullPointerException n) {
LOGGER.error("String_Node_Str",n);
}
}

Fixed version (ground truth):
private void unmark(){
  try {
    int i=currentMode[index];
switch (i) {
case 0:
      singel.setStyle("String_Node_Str");
    break;
case 1:
  serien.setStyle("String_Node_Str");
break;
case 2:
ontime.setStyle("String_Node_Str");
singel.setStyle("String_Node_Str");
break;
}
}
 catch (NullPointerException n) {
LOGGER.error("String_Node_Str",n);
}
}
Program: 77980
Project: 77980
Buggy source:
/** 
 * Insert test data into the database
 * @throws FileNotFoundException if the create-script is not found in the specified folder.
 * @throws SQLException if an error occurs while running the script on the database.
 */
private void insertData() throws FileNotFoundException, SQLException {
  try {
    String sqlFolder=this.getClass().getResource(fileSep + "String_Node_Str" + fileSep).getPath();
    ResultSet rs=RunScript.execute(connection,new FileReader(sqlFolder + "String_Node_Str"));
    if (rs != null)     rs.close();
  }
 catch (  FileNotFoundException|SQLException e) {
    LOGGER.error("String_Node_Str",e);
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Insert test data into the database
 * @throws FileNotFoundException if the create-script is not found in the specified folder.
 * @throws SQLException if an error occurs while running the script on the database.
 */
private void insertData() throws FileNotFoundException, SQLException {
  try {
    String insertPath=this.getClass().getResource("String_Node_Str").getPath();
    ResultSet rs=RunScript.execute(connection,new FileReader(insertPath));
    if (rs != null)     rs.close();
  }
 catch (  FileNotFoundException|SQLException e) {
    LOGGER.error("String_Node_Str",e);
    throw e;
  }
}
Program: 77982
Project: 77982
Buggy source:
/** 
 * Runs the create.sql-script on the database.
 * @throws FileNotFoundException if the create-script is not found in the specified folder.
 * @throws SQLException if an error occurs while running the script on the database.
 */
private void firstStartup() throws FileNotFoundException, SQLException, PersistenceException {
  try {
    String sqlFolder=this.getClass().getResource(fileSep + "String_Node_Str" + fileSep).getPath();
    ResultSet rs=RunScript.execute(connection,new FileReader(sqlFolder + "String_Node_Str"));
    if (rs != null)     rs.close();
    if (!testState)     rs=RunScript.execute(connection,new FileReader(sqlFolder + "String_Node_Str"));
    if (rs != null)     rs.close();
  }
 catch (  FileNotFoundException|SQLException e) {
    LOGGER.error("String_Node_Str",e);
    throw e;
  }
  if (!testState) {
    insertData();
    setUpDefaultImgs();
    LOGGER.info("String_Node_Str");
  }
  LOGGER.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Runs the create.sql-script on the database.
 * @throws FileNotFoundException if the create-script is not found in the specified folder.
 * @throws SQLException if an error occurs while running the script on the database.
 */
private void firstStartup() throws FileNotFoundException, SQLException, PersistenceException {
  try {
    String createPath=this.getClass().getResource("String_Node_Str").getPath();
    String initPath=this.getClass().getResource("String_Node_Str").getPath();
    ResultSet rs=RunScript.execute(connection,new FileReader(createPath));
    if (rs != null)     rs.close();
    if (!testState)     rs=RunScript.execute(connection,new FileReader(initPath));
    if (rs != null)     rs.close();
  }
 catch (  FileNotFoundException|SQLException e) {
    LOGGER.error("String_Node_Str",e);
    throw e;
  }
  if (!testState) {
    insertData();
    setUpDefaultImgs();
    LOGGER.info("String_Node_Str");
  }
  LOGGER.info("String_Node_Str");
}
Program: 77985
Project: 77985
Buggy source:
public void deletePreviews(String imgPath){
  String[] parts=imgPath.split("String_Node_Str");
  String imgFilterName=parts[parts.length - 1].replace("String_Node_Str","String_Node_Str");
  if (new File(activeShooting.getStorageDir() + imgFilterName).isFile())   new File(activeShooting.getStorageDir() + imgFilterName).delete();
}

Fixed version (ground truth):
/** 
 * deleting created mini preview images in filesystem
 * @param imgPath imagepath to delete
 */
public void deletePreviews(String imgPath){
  LOGGER.info("String_Node_Str" + imgPath);
  String[] parts=imgPath.split("String_Node_Str");
  String imgFilterName=parts[parts.length - 1].replace("String_Node_Str","String_Node_Str");
  if (new File(activeShooting.getStorageDir() + imgFilterName).isFile())   new File(activeShooting.getStorageDir() + imgFilterName).delete();
}
Program: 77986
Project: 77986
Buggy source:
/** 
 * saves the filtered image in database...
 */
@FXML public void saveFilteredImg(){
  try {
    LOGGER.info("String_Node_Str");
    activeFilterImageView.setFitHeight(80);
    activeFilterImageView.setPreserveRatio(false);
    activeFilterImageView=null;
    saveFilteredButton.setVisible(false);
    ivfullscreenImage.setId(filteredImgPath);
    at.ac.tuwien.sepm.ws16.qse01.entities.Image newImage=imageService.create(new at.ac.tuwien.sepm.ws16.qse01.entities.Image(filteredImgPath,activeShooting.getId()));
    refreshManager.notifyMiniatureFrameOfAdd(newImage);
    if ((currentIndex + 1) >= imageList.size())     imageList.add(newImage);
 else {
      imageList.add(currentIndex + 1,newImage);
      currentIndex=currentIndex + 1;
    }
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * saves the filtered image in database...
 */
@FXML public void saveFilteredImg(){
  LOGGER.info("String_Node_Str" + filteredImgPath);
  try {
    activeFilterImageView.setFitHeight(80);
    activeFilterImageView.setPreserveRatio(false);
    saveFilteredButton.setVisible(false);
    File outputfile=null;
    System.out.println("String_Node_Str" + activeShooting.getStorageDir());
    try {
      BufferedImage bi=filterService.filter(activeFilterImageView.getId(),ivfullscreenImage.getId());
      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");
      outputfile=new File(activeShooting.getStorageDir() + "String_Node_Str" + imgFilterName);
      ImageIO.write(bi,"String_Node_Str",outputfile);
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str",e);
    }
    activeFilterImageView=null;
    at.ac.tuwien.sepm.ws16.qse01.entities.Image newImage=imageService.create(new at.ac.tuwien.sepm.ws16.qse01.entities.Image(outputfile.getAbsolutePath(),activeShooting.getId()));
    refreshManager.notifyMiniatureFrameOfAdd(newImage);
    if ((currentIndex + 1) >= imageList.size())     imageList.add(newImage);
 else {
      imageList.add(currentIndex + 1,newImage);
    }
    currentIndex=currentIndex + 1;
    button4.setVisible(true);
    LOGGER.info("String_Node_Str");
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
  }
}
Program: 77989
Project: 77989
Buggy source:
/** 
 * changes given image with GAUSSIAN filter
 * @param imgPath the path of image to filter
 * @return BufferedImage filtered image
 * @throws ServiceException if an error occurs then it throws a ServiceException
 */
public BufferedImage filterGaussian(String imgPath){
  LOGGER.info("String_Node_Str" + imgPath);
  Mat source=Imgcodecs.imread(imgPath,Imgcodecs.CV_LOAD_IMAGE_COLOR);
  Mat destination=new Mat(source.rows(),source.cols(),source.type());
  Imgproc.GaussianBlur(source,destination,new Size(15,15),0);
  return getBufferedImage(destination);
}

Fixed version (ground truth):
/** 
 * changes given image with GAUSSIAN filter
 * @param imgPath the path of image to filter
 * @return BufferedImage filtered image
 * @throws ServiceException if an error occurs then it throws a ServiceException
 */
public BufferedImage filterGaussian(String imgPath){
  LOGGER.info("String_Node_Str" + imgPath);
  Mat source=Imgcodecs.imread(imgPath,Imgcodecs.CV_LOAD_IMAGE_COLOR);
  Mat destination=new Mat(source.rows(),source.cols(),source.type());
  Imgproc.GaussianBlur(source,destination,new Size(25,25),0);
  return getBufferedImage(destination);
}
Program: 77990
Project: 77990
Buggy source:
/** 
 * checks if storage directory of active shooting exists. If it doesnt exist, then it will create a storage directory.
 * @throws ServiceException if an error occurs then it throws a ServiceException
 */
public void checkStorageDir() throws ServiceException {
  if (new File(activeShooting.getStorageDir()).isDirectory())   storageDir=activeShooting.getStorageDir() + "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * checks if storage directory of active shooting exists. If it doesnt exist, then it will create a storage directory.
 * @throws ServiceException if an error occurs then it throws a ServiceException
 */
public void checkStorageDir() throws ServiceException {
  if (new File(activeShooting.getStorageDir()).isDirectory())   storageDir=activeShooting.getStorageDir() + "String_Node_Str";
 else   throw new ServiceException("String_Node_Str" + activeShooting.getStorageDir());
}
Program: 77991
Project: 77991
Buggy source:
/** 
 * converts given mat object to buffered image
 * @param m - a mat object to convert buffered image
 * @return BufferedImage converted buffered image
 */
public BufferedImage getBufferedImage(Mat m){
  int type=BufferedImage.TYPE_BYTE_GRAY;
  if (m.channels() > 1) {
    type=BufferedImage.TYPE_3BYTE_BGR;
  }
  BufferedImage image=new BufferedImage(m.cols(),m.rows(),type);
  m.get(0,0,((DataBufferByte)image.getRaster().getDataBuffer()).getData());
  return image;
}

Fixed version (ground truth):
/** 
 * converts given mat object to buffered image
 * @param m - a mat object to convert buffered image
 * @return BufferedImage converted buffered image
 */
public BufferedImage getBufferedImage(Mat m){
  int type=BufferedImage.TYPE_BYTE_GRAY;
  if (m.channels() > 1) {
    type=BufferedImage.TYPE_3BYTE_BGR;
  }
  bufferedImage=new BufferedImage(m.cols(),m.rows(),type);
  m.get(0,0,((DataBufferByte)bufferedImage.getRaster().getDataBuffer()).getData());
  m.release();
  return bufferedImage;
}
Program: 77992
Project: 77992
Buggy source:
/** 
 * changes given image with COLORSPACE filter
 * @param imgPath the path of image to filter
 * @return BufferedImage filtered image
 * @throws ServiceException if an error occurs then it throws a ServiceException
 */
public BufferedImage filterColorSpace(String imgPath){
  LOGGER.info("String_Node_Str" + imgPath);
  try {
    File input=new File(imgPath);
    BufferedImage image=ImageIO.read(input);
    byte[] data=((DataBufferByte)image.getRaster().getDataBuffer()).getData();
    Mat mat=new Mat(image.getHeight(),image.getWidth(),CvType.CV_8UC3);
    mat.put(0,0,data);
    Mat mat1=new Mat(image.getHeight(),image.getWidth(),CvType.CV_8UC3);
    Imgproc.cvtColor(mat,mat1,Imgproc.COLOR_RGB2HSV);
    byte[] data1=new byte[mat1.rows() * mat1.cols() * (int)(mat1.elemSize())];
    mat1.get(0,0,data1);
    BufferedImage image1=new BufferedImage(mat1.cols(),mat1.rows(),5);
    image1.getRaster().setDataElements(0,0,mat1.cols(),mat1.rows(),data1);
    return image1;
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * changes given image with COLORSPACE filter
 * @param imgPath the path of image to filter
 * @return BufferedImage filtered image
 * @throws ServiceException if an error occurs then it throws a ServiceException
 */
public BufferedImage filterColorSpace(String imgPath){
  LOGGER.info("String_Node_Str" + imgPath);
  try {
    File input=new File(imgPath);
    BufferedImage image=ImageIO.read(input);
    byte[] data=((DataBufferByte)image.getRaster().getDataBuffer()).getData();
    Mat mat=new Mat(image.getHeight(),image.getWidth(),CvType.CV_8UC3);
    mat.put(0,0,data);
    Mat mat1=new Mat(image.getHeight(),image.getWidth(),CvType.CV_8UC3);
    Imgproc.cvtColor(mat,mat1,Imgproc.COLOR_RGB2HSV);
    byte[] data1=new byte[mat1.rows() * mat1.cols() * (int)(mat1.elemSize())];
    mat1.get(0,0,data1);
    bufferedImage=new BufferedImage(mat1.cols(),mat1.rows(),5);
    bufferedImage.getRaster().setDataElements(0,0,mat1.cols(),mat1.rows(),data1);
    return bufferedImage;
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
  }
  return null;
}
Program: 77993
Project: 77993
Buggy source:
/** 
 * changes given image with GRAYSCALE filter
 * @param imgPath the path of image to filter
 * @return BufferedImage filtered image
 * @throws ServiceException if an error occurs then it throws a ServiceException
 */
public BufferedImage filterGrayScale(String imgPath){
  LOGGER.info("String_Node_Str" + imgPath);
  try {
    File input=new File(imgPath);
    BufferedImage image=ImageIO.read(input);
    byte[] data=((DataBufferByte)image.getRaster().getDataBuffer()).getData();
    Mat mat=new Mat(image.getHeight(),image.getWidth(),CvType.CV_8UC3);
    mat.put(0,0,data);
    Mat mat1=new Mat(image.getHeight(),image.getWidth(),CvType.CV_8UC1);
    Imgproc.cvtColor(mat,mat1,Imgproc.COLOR_RGB2GRAY);
    byte[] data1=new byte[mat1.rows() * mat1.cols() * (int)(mat1.elemSize())];
    mat1.get(0,0,data1);
    BufferedImage image1=new BufferedImage(mat1.cols(),mat1.rows(),BufferedImage.TYPE_BYTE_GRAY);
    image1.getRaster().setDataElements(0,0,mat1.cols(),mat1.rows(),data1);
    return image1;
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * changes given image with GRAYSCALE filter
 * @param imgPath the path of image to filter
 * @return BufferedImage filtered image
 * @throws ServiceException if an error occurs then it throws a ServiceException
 */
public BufferedImage filterGrayScale(String imgPath){
  LOGGER.info("String_Node_Str" + imgPath);
  try {
    File input=new File(imgPath);
    BufferedImage image=ImageIO.read(input);
    byte[] data=((DataBufferByte)image.getRaster().getDataBuffer()).getData();
    Mat mat=new Mat(image.getHeight(),image.getWidth(),CvType.CV_8UC3);
    mat.put(0,0,data);
    Mat mat1=new Mat(image.getHeight(),image.getWidth(),CvType.CV_8UC1);
    Imgproc.cvtColor(mat,mat1,Imgproc.COLOR_RGB2GRAY);
    byte[] data1=new byte[mat1.rows() * mat1.cols() * (int)(mat1.elemSize())];
    mat1.get(0,0,data1);
    bufferedImage=new BufferedImage(mat1.cols(),mat1.rows(),BufferedImage.TYPE_BYTE_GRAY);
    bufferedImage.getRaster().setDataElements(0,0,mat1.cols(),mat1.rows(),data1);
    return bufferedImage;
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
  }
  return null;
}
Program: 77994
Project: 77994
Buggy source:
@Autowired public FullScreenImageController(WindowManager windowManager,ShootingService shootingService,FilterService filterService,ImageService imageService,ImagePrinter imagePrinter,RefreshManager refreshManager) throws ServiceException {
  this.filterService=filterService;
  this.imageService=imageService;
  this.shootingService=shootingService;
  this.windowManager=windowManager;
  this.imagePrinter=imagePrinter;
  this.refreshManager=refreshManager;
  this.activeShooting=shootingService.searchIsActive();
}

Fixed version (ground truth):
@Autowired public FullScreenImageController(WindowManager windowManager,ShootingService shootingService,FilterService filterService,ImageService imageService,ImagePrinter imagePrinter,ImageHelper imageHelper,RefreshManager refreshManager) throws ServiceException {
  this.filterService=filterService;
  this.imageService=imageService;
  this.shootingService=shootingService;
  this.windowManager=windowManager;
  this.imagePrinter=imagePrinter;
  this.refreshManager=refreshManager;
  this.imageHelper=imageHelper;
  this.activeShooting=shootingService.searchIsActive();
}
Program: 77995
Project: 77995
Buggy source:
/** 
 * saves the filtered image in database...
 */
@FXML public void saveFilteredImg(){
  LOGGER.info("String_Node_Str" + filteredImgPath);
  try {
    activeFilterImageView.setFitHeight(80);
    activeFilterImageView.setPreserveRatio(false);
    saveFilteredButton.setVisible(false);
    File outputfile=null;
    System.out.println("String_Node_Str" + activeShooting.getStorageDir());
    try {
      BufferedImage bi=filterService.filter(activeFilterImageView.getId(),ivfullscreenImage.getId());
      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");
      outputfile=new File(activeShooting.getStorageDir() + "String_Node_Str" + imgFilterName);
      ImageIO.write(bi,"String_Node_Str",outputfile);
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str",e);
    }
    activeFilterImageView=null;
    at.ac.tuwien.sepm.ws16.qse01.entities.Image newImage=imageService.create(new at.ac.tuwien.sepm.ws16.qse01.entities.Image(outputfile.getAbsolutePath(),activeShooting.getId()));
    refreshManager.notifyMiniatureFrameOfAdd(newImage);
    if ((currentIndex + 1) >= imageList.size())     imageList.add(newImage);
 else {
      imageList.add(currentIndex + 1,newImage);
    }
    currentIndex=currentIndex + 1;
    button4.setVisible(true);
    LOGGER.info("String_Node_Str");
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * saves the filtered image in database...
 */
@FXML public void saveFilteredImg(){
  LOGGER.info("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() + "String_Node_Str" + imgFilterName;
    imageHelper.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()));
    refreshManager.notifyMiniatureFrameOfAdd(newImage);
    if ((currentIndex + 1) >= imageList.size())     imageList.add(newImage);
 else {
      imageList.add(currentIndex + 1,newImage);
    }
    currentIndex=currentIndex + 1;
    button4.setVisible(true);
    LOGGER.info("String_Node_Str");
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str" + e.getMessage());
  }
}
Program: 77997
Project: 77997
Buggy source:
@Override public void handle(TableColumn.CellEditEvent<Profile.PairLogoRelativeRectangle,Double> t){
  try {
    Profile.PairLogoRelativeRectangle p=((Profile.PairLogoRelativeRectangle)t.getTableView().getItems().get(t.getTablePosition().getRow()));
    if (!t.getNewValue().isNaN()) {
      p.getRelativeRectangle().setHeight(t.getNewValue());
      pservice.editPairLogoRelativeRectangle(p);
    }
 else {
      refreshTableLogo(pservice.getAllPairLogoRelativeRectangle(((Profile)profilList.getSelectionModel().getSelectedItem()).getId()));
    }
  }
 catch (  ServiceException e) {
    try {
      refreshTableProfiles(pservice.getAllProfiles());
    }
 catch (    ServiceException e1) {
      LOGGER.debug("String_Node_Str" + e1.getMessage());
    }
  }
}

Fixed version (ground truth):
@Override public void handle(TableColumn.CellEditEvent<Background,String> t){
  try {
    Background p=((Background)t.getTableView().getItems().get(t.getTablePosition().getRow()));
    if (t.getNewValue().compareTo("String_Node_Str") != 0) {
      p.setName(t.getNewValue());
    }
 else {
      refreshTablePosition(pservice.getAllPositionsOfProfile(((Profile)profilList.getSelectionModel().getSelectedItem())));
    }
  }
 catch (  ServiceException e) {
  }
}
Program: 77998
Project: 77998
Buggy source:
@Override public TableCell<Profile.PairLogoRelativeRectangle,Boolean> call(TableColumn<Profile.PairLogoRelativeRectangle,Boolean> p){
  return new LogoButtonCell(logoList,pservice,windowManager.getStage(),selectedProfile.getId());
}

Fixed version (ground truth):
@Override public TableCell<Background,Boolean> call(TableColumn<Background,Boolean> p){
  return new BackgroundButtonCell(backgroundList,pservice,windowManager.getStage());
}
Program: 78000
Project: 78000
Buggy source:
/** 
 * This method loads the OpenCVLibrary from the Ressource Lib folder
 * @throws ServiceException if the operating System is not supported
 */
public void loadLibrary() throws ServiceException {
  if (!isLoaded) {
    try {
      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
      isLoaded=true;
      LOGGER.info("String_Node_Str",Core.NATIVE_LIBRARY_NAME);
    }
 catch (    Exception e) {
      LOGGER.error("String_Node_Str",e);
    }
    if (!isLoaded) {
      String lib;
      String operatingSystem=System.getProperty("String_Node_Str").toLowerCase();
      if (operatingSystem.contains("String_Node_Str")) {
        lib="String_Node_Str";
      }
 else       if (operatingSystem.contains("String_Node_Str")) {
        lib="String_Node_Str";
      }
 else       if (operatingSystem.contains("String_Node_Str")) {
        lib="String_Node_Str";
      }
 else {
        LOGGER.error("String_Node_Str",operatingSystem);
        throw new ServiceException("String_Node_Str");
      }
      String libPath=this.getClass().getResource(lib).getPath();
      System.load(libPath);
      isLoaded=true;
      LOGGER.info("String_Node_Str",libPath);
    }
  }
}

Fixed version (ground truth):
/** 
 * This method loads the OpenCVLibrary from the Ressource Lib folder
 * @throws ServiceException if the operating System is not supported
 */
public void loadLibrary() throws ServiceException {
  if (!isLoaded) {
    try {
      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
      isLoaded=true;
      LOGGER.info("String_Node_Str",Core.NATIVE_LIBRARY_NAME);
    }
 catch (    UnsatisfiedLinkError e) {
      LOGGER.error("String_Node_Str",e);
    }
    if (!isLoaded) {
      String lib;
      String operatingSystem=System.getProperty("String_Node_Str").toLowerCase();
      if (operatingSystem.contains("String_Node_Str")) {
        lib="String_Node_Str";
      }
 else       if (operatingSystem.contains("String_Node_Str")) {
        lib="String_Node_Str";
      }
 else       if (operatingSystem.contains("String_Node_Str")) {
        lib="String_Node_Str";
      }
 else {
        LOGGER.error("String_Node_Str",operatingSystem);
        throw new ServiceException("String_Node_Str");
      }
      String libPath=this.getClass().getResource(lib).getPath();
      System.load(libPath);
      isLoaded=true;
      LOGGER.info("String_Node_Str",libPath);
    }
  }
}
Program: 78001
Project: 78001
Buggy source:
@Override public BufferedImage filterSobel(String imgPath){
  LOGGER.info("String_Node_Str" + imgPath);
  int kernelSize=3;
  Mat source=Imgcodecs.imread(imgPath,Imgcodecs.CV_LOAD_IMAGE_COLOR);
  Mat destination=new Mat(source.rows(),source.cols(),source.type());
  Mat kernel=new Mat(kernelSize,kernelSize,CvType.CV_32F){
{
      put(0,0,-1);
      put(0,1,0);
      put(0,2,1);
      put(1,0 - 2);
      put(1,1,0);
      put(1,2,2);
      put(2,0,-1);
      put(2,1,0);
      put(2,2,1);
    }
  }
;
  Imgproc.filter2D(source,destination,-1,kernel);
  return getBufferedImage(destination);
}

Fixed version (ground truth):
@Override public BufferedImage filterSobel(String imgPath){
  LOGGER.info("String_Node_Str" + imgPath);
  int kernelSize=3;
  Mat source=Imgcodecs.imread(imgPath,Imgcodecs.CV_LOAD_IMAGE_COLOR);
  Mat destination=new Mat(source.rows(),source.cols(),source.type());
  Mat kernel=new Mat(kernelSize,kernelSize,CvType.CV_32F){
{
      put(0,0,-1);
      put(0,1,0);
      put(0,2,1);
      put(1,0,-2);
      put(1,1,0);
      put(1,2,2);
      put(2,0,-1);
      put(2,1,0);
      put(2,2,1);
    }
  }
;
  Imgproc.filter2D(source,destination,-1,kernel);
  return getBufferedImage(destination);
}
Program: 78002
Project: 78002
Buggy source:
Background add(Background.Category category) throws ServiceException ;

Fixed version (ground truth):
Background add(Background background) throws ServiceException ;
Program: 78003
Project: 78003
Buggy source:
boolean edit(Background.Category category) throws ServiceException ;

Fixed version (ground truth):
boolean edit(Background background) throws ServiceException ;
Program: 78004
Project: 78004
Buggy source:
@FXML private void saveLogo(){
  LOGGER.debug("String_Node_Str");
  String name=txLogoName.getText();
  if (name.trim().compareTo("String_Node_Str") == 0 || txLogoLogo.getText().compareTo("String_Node_Str") == 0) {
    LOGGER.debug("String_Node_Str");
    showError("String_Node_Str");
  }
 else {
    try {
      Logo newLogo=new Logo(name,txLogoLogo.getText());
      RelativeRectangle newPosition=new RelativeRectangle(Double.valueOf(txLogoX.getText()),Double.valueOf(txLogoY.getText()),Double.valueOf(txLogoHoehe.getText()),Double.valueOf(txLogoBreite.getText()));
      LOGGER.info("String_Node_Str");
      newLogo=pservice.addLogo(newLogo);
      Profile.PairLogoRelativeRectangle p=new Profile.PairLogoRelativeRectangle(newLogo,newPosition);
      logoList.add(p);
      pservice.addPairLogoRelativeRectangle(selectedProfile.getId(),newLogo.getId(),newPosition);
    }
 catch (    ServiceException e) {
      LOGGER.debug("String_Node_Str" + e.getMessage());
    }
catch (    NumberFormatException e) {
      showError("String_Node_Str");
      LOGGER.error("String_Node_Str" + e.getMessage());
    }
  }
}

Fixed version (ground truth):
@FXML private void saveLogo(){
  LOGGER.debug("String_Node_Str");
  String name=txLogoName.getText();
  if (name.trim().compareTo("String_Node_Str") == 0 || txLogoLogo.getText().compareTo("String_Node_Str") == 0) {
    LOGGER.debug("String_Node_Str");
    showError("String_Node_Str");
  }
 else {
    try {
      Logo newLogo=new Logo(name,txLogoLogo.getText());
      RelativeRectangle newPosition=new RelativeRectangle(Double.valueOf(txLogoX.getText()),Double.valueOf(txLogoY.getText()),Double.valueOf(txLogoHoehe.getText()),Double.valueOf(txLogoBreite.getText()));
      LOGGER.info("String_Node_Str");
      newLogo=pservice.addLogo(newLogo);
      Profile.PairLogoRelativeRectangle p=new Profile.PairLogoRelativeRectangle(newLogo,newPosition);
      p=pservice.addPairLogoRelativeRectangle(selectedProfile.getId(),newLogo.getId(),newPosition);
      logoList.add(p);
    }
 catch (    ServiceException e) {
      LOGGER.debug("String_Node_Str" + e.getMessage());
    }
catch (    NumberFormatException e) {
      showError("String_Node_Str");
      LOGGER.error("String_Node_Str" + e.getMessage());
    }
  }
}
Program: 78006
Project: 78006
Buggy source:
@Override public void handle(ActionEvent t){
  Alert alert=new Alert(Alert.AlertType.CONFIRMATION);
  alert.setTitle("String_Node_Str");
  alert.setHeaderText("String_Node_Str");
  alert.setContentText("String_Node_Str");
  alert.initOwner(primaryStage);
  ButtonType butJa=new ButtonType("String_Node_Str");
  ButtonType butNein=new ButtonType("String_Node_Str");
  alert.getButtonTypes().setAll(butJa,butNein);
  Optional<ButtonType> result=alert.showAndWait();
  if (result.get() == butJa) {
    Profile.PairLogoRelativeRectangle currentPairLogo=(Profile.PairLogoRelativeRectangle)LogoButtonCell.this.getTableView().getItems().get(LogoButtonCell.this.getIndex());
    posList.remove(currentPairLogo);
    try {
      int countsOfLogoUsing=0;
      for (      Profile.PairLogoRelativeRectangle p : pservice.getAllPairLogoRelativeRectangle(profileID)) {
        if (currentPairLogo.getLogo().getId() == p.getLogo().getId())         countsOfLogoUsing++;
      }
      if (countsOfLogoUsing == 1)       pservice.eraseLogo(currentPairLogo.getLogo());
      pservice.erasePairLogoRelativeRectangle(currentPairLogo);
    }
 catch (    ServiceException e) {
      e.printStackTrace();
    }
    setGraphic(null);
  }
}

Fixed version (ground truth):
@Override public void handle(ActionEvent t){
  Alert alert=new Alert(Alert.AlertType.CONFIRMATION);
  alert.setTitle("String_Node_Str");
  alert.setHeaderText("String_Node_Str");
  alert.setContentText("String_Node_Str");
  alert.initOwner(primaryStage);
  ButtonType butJa=new ButtonType("String_Node_Str");
  ButtonType butNein=new ButtonType("String_Node_Str");
  alert.getButtonTypes().setAll(butJa,butNein);
  Optional<ButtonType> result=alert.showAndWait();
  if (result.get() == butJa) {
    Profile.PairLogoRelativeRectangle currentPairLogo=(Profile.PairLogoRelativeRectangle)LogoButtonCell.this.getTableView().getItems().get(LogoButtonCell.this.getIndex());
    posList.remove(currentPairLogo);
    try {
      int countsOfLogoUsing=0;
      for (      Profile.PairLogoRelativeRectangle p : pservice.getAllPairLogoRelativeRectangle(profileID)) {
        if (p.getLogo() != null && currentPairLogo.getLogo().getId() == p.getLogo().getId())         countsOfLogoUsing++;
      }
      if (countsOfLogoUsing == 1)       pservice.eraseLogo(currentPairLogo.getLogo());
      pservice.erasePairLogoRelativeRectangle(currentPairLogo);
    }
 catch (    ServiceException e) {
      e.printStackTrace();
    }
    setGraphic(null);
  }
}
Program: 78009
Project: 78009
Buggy source:
@Override public boolean erasePairLogoRelativeRectangle(Profile.PairLogoRelativeRectangle pairLogoRelativeRectangle) throws ServiceException {
  Profile profile=this.get(pairLogoRelativeRectangle.getProfileId());
  List<Profile.PairLogoRelativeRectangle> pairLogoRelativeRectangles=profile.getPairLogoRelativeRectangles();
  for (  Profile.PairLogoRelativeRectangle auxPairLogoRelativeRectangle : pairLogoRelativeRectangles) {
    if (auxPairLogoRelativeRectangle.getId() == pairLogoRelativeRectangle.getId()) {
      pairLogoRelativeRectangles.remove(auxPairLogoRelativeRectangle);
    }
  }
  profile.setPairLogoRelativeRectangles(pairLogoRelativeRectangles);
  return this.edit(profile);
}

Fixed version (ground truth):
@Override public boolean erasePairLogoRelativeRectangle(Profile.PairLogoRelativeRectangle pairLogoRelativeRectangle) throws ServiceException {
  Profile profile=this.get(pairLogoRelativeRectangle.getProfileId());
  List<Profile.PairLogoRelativeRectangle> pairLogoRelativeRectangles=profile.getPairLogoRelativeRectangles();
  Profile.PairLogoRelativeRectangle toRemove=null;
  for (  Profile.PairLogoRelativeRectangle auxPairLogoRelativeRectangle : pairLogoRelativeRectangles) {
    if (auxPairLogoRelativeRectangle.getId() == pairLogoRelativeRectangle.getId()) {
      toRemove=auxPairLogoRelativeRectangle;
    }
  }
  if (toRemove != null)   pairLogoRelativeRectangles.remove(toRemove);
  profile.setPairLogoRelativeRectangles(pairLogoRelativeRectangles);
  return this.edit(profile);
}
Program: 78010
Project: 78010
Buggy source:
/** 
 * gets last image (image when swiped left) there by using transitions for visual purpose catches FillNotFound exeption
 */
public void onLastImagePressed(){
  LOGGER.debug("String_Node_Str" + currentIndex);
  upperbutton=true;
  try {
    if (currentIndex - 1 > -1) {
      if (currentIndex - 1 > 0) {
        currentIndex=currentIndex - 1;
      }
 else       if (currentIndex - 1 == 0) {
        currentIndex=0;
        b4=false;
        button4.setVisible(false);
      }
      if (!button3.isVisible() && imageList.size() > 1) {
        b3=true;
        button3.setVisible(true);
      }
      ivfullscreenImage.setImage(new Image(new FileInputStream(imageList.get(currentIndex).getImagepath()),base.getWidth(),base.getHeight(),true,true));
    }
 else {
      windowManager.showMiniatureFrame();
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * gets last image (image when swiped left) there by using transitions for visual purpose catches FillNotFound exeption
 */
public void onLastImagePressed(){
  LOGGER.debug("String_Node_Str" + currentIndex);
  upperbutton=true;
  try {
    if (currentIndex - 1 > -1) {
      if (currentIndex - 1 > 0) {
        currentIndex=currentIndex - 1;
      }
 else       if (currentIndex - 1 == 0) {
        currentIndex=0;
        b4=false;
        button4.setVisible(false);
      }
      if (!button3.isVisible() && imageList.size() > 1) {
        b3=true;
        button3.setVisible(true);
      }
      ivfullscreenImage.setImage(new Image(new FileInputStream(imageList.get(currentIndex).getImagepath()),base.getWidth(),base.getHeight(),true,true));
      ivfullscreenImage.setId(imageList.get(currentIndex).getImagepath());
      makePreviewFilter(imageList.get(currentIndex).getImagepath());
      saveFilteredButton.setVisible(false);
    }
 else {
      windowManager.showMiniatureFrame();
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
}
Program: 78011
Project: 78011
Buggy source:
/** 
 * get next image (image when deleted or swiped right) there by using transitions for visual purpose catches FillNotFound exeption
 */
public void onNextImage(){
  LOGGER.debug("String_Node_Str" + currentIndex);
  upperbutton=true;
  try {
    if (currentIndex + 1 < imageList.size()) {
      if (currentIndex + 1 < imageList.size() - 1) {
        currentIndex=currentIndex + 1;
      }
 else       if (currentIndex + 1 == imageList.size() - 1) {
        currentIndex=imageList.size() - 1;
        b3=false;
        button3.setVisible(false);
      }
      if (!button4.isVisible() && imageList.size() > 1) {
        b4=true;
        button4.setVisible(true);
      }
      ivfullscreenImage.setImage(new Image(new FileInputStream(imageList.get(currentIndex).getImagepath()),base.getWidth(),base.getHeight(),true,true));
    }
 else {
      windowManager.showMiniatureFrame();
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * get next image (image when deleted or swiped right) there by using transitions for visual purpose catches FillNotFound exeption
 */
public void onNextImage(){
  LOGGER.debug("String_Node_Str" + currentIndex);
  upperbutton=true;
  try {
    if (currentIndex + 1 < imageList.size()) {
      if (currentIndex + 1 < imageList.size() - 1) {
        currentIndex=currentIndex + 1;
      }
 else       if (currentIndex + 1 == imageList.size() - 1) {
        currentIndex=imageList.size() - 1;
        b3=false;
        button3.setVisible(false);
      }
      if (!button4.isVisible() && imageList.size() > 1) {
        b4=true;
        button4.setVisible(true);
      }
      ivfullscreenImage.setImage(new Image(new FileInputStream(imageList.get(currentIndex).getImagepath()),base.getWidth(),base.getHeight(),true,true));
      ivfullscreenImage.setId(imageList.get(currentIndex).getImagepath());
      makePreviewFilter(imageList.get(currentIndex).getImagepath());
      saveFilteredButton.setVisible(false);
    }
 else {
      windowManager.showMiniatureFrame();
    }
  }
 catch (  FileNotFoundException e) {
    e.printStackTrace();
  }
}
Program: 78014
Project: 78014
Buggy source:
@Override public void handle(ActionEvent t){
  Alert alert=new Alert(Alert.AlertType.CONFIRMATION);
  alert.setTitle("String_Node_Str");
  alert.setHeaderText("String_Node_Str");
  alert.setContentText("String_Node_Str");
  alert.initOwner(primaryStage);
  ButtonType butJa=new ButtonType("String_Node_Str");
  ButtonType butNein=new ButtonType("String_Node_Str");
  alert.getButtonTypes().setAll(butJa,butNein);
  Optional<ButtonType> result=alert.showAndWait();
  if (result.get() == butJa) {
    Profile.PairLogoRelativeRectangle currentProfile=(Profile.PairLogoRelativeRectangle)LogoButtonCell.this.getTableView().getItems().get(LogoButtonCell.this.getIndex());
    posList.remove(currentProfile);
    setGraphic(null);
  }
}

Fixed version (ground truth):
@Override public void handle(ActionEvent t){
  Alert alert=new Alert(Alert.AlertType.CONFIRMATION);
  alert.setTitle("String_Node_Str");
  alert.setHeaderText("String_Node_Str");
  alert.setContentText("String_Node_Str");
  alert.initOwner(primaryStage);
  ButtonType butJa=new ButtonType("String_Node_Str");
  ButtonType butNein=new ButtonType("String_Node_Str");
  alert.getButtonTypes().setAll(butJa,butNein);
  Optional<ButtonType> result=alert.showAndWait();
  if (result.get() == butJa) {
    Profile.PairLogoRelativeRectangle currentPairLogo=(Profile.PairLogoRelativeRectangle)LogoButtonCell.this.getTableView().getItems().get(LogoButtonCell.this.getIndex());
    posList.remove(currentPairLogo);
    try {
      pservice.erasePairLogoRelativeRectangle(currentPairLogo);
    }
 catch (    ServiceException e) {
      e.printStackTrace();
    }
    setGraphic(null);
  }
}