nus-yam/ex-repair huggingface dataset:
Program: 78099
Project: 78099
Buggy source:
private RelativeRectangle calculatePosition(RelativeRectangle position,double imageWidth,double imageHeight,double logoWidth,double logoHeight) throws ServiceException {
  if (position == null) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str");
  }
  double relativeLogoWidth=position.getWidth();
  double relativeLogoHeight=position.getHeight();
  double widthHeightRatio=logoWidth / logoHeight;
  if ((int)relativeLogoHeight == -1 && (int)relativeLogoWidth == -1) {
    relativeLogoWidth=logoWidth / imageWidth * (100D);
    relativeLogoHeight=logoHeight / imageHeight * (100D);
  }
 else   if ((int)relativeLogoHeight == -1 && relativeLogoWidth > 0) {
    relativeLogoHeight=relativeLogoWidth / widthHeightRatio;
  }
 else   if (relativeLogoHeight > 0 && (int)relativeLogoWidth == -1) {
    relativeLogoWidth=widthHeightRatio * relativeLogoHeight;
  }
 else {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str");
  }
  position.setHeight(relativeLogoHeight);
  position.setWidth(relativeLogoWidth);
  return position;
}

Fixed version (ground truth):
private RelativeRectangle calculatePosition(RelativeRectangle position,double imageWidth,double imageHeight,double logoWidth,double logoHeight) throws ServiceException {
  if (position == null) {
    LOGGER.error("String_Node_Str");
    throw new ServiceException("String_Node_Str");
  }
  double relativeLogoWidth=position.getWidth();
  double relativeLogoHeight=position.getHeight();
  double widthHeightRatio=logoWidth / logoHeight;
  if ((int)relativeLogoHeight == -1 && (int)relativeLogoWidth == -1) {
    relativeLogoWidth=logoWidth / imageWidth * (100D);
    relativeLogoHeight=logoHeight / imageHeight * (100D);
  }
 else   if ((int)relativeLogoHeight == -1 && relativeLogoWidth > 0) {
    relativeLogoHeight=relativeLogoWidth / widthHeightRatio;
  }
 else   if (relativeLogoHeight > 0 && (int)relativeLogoWidth == -1) {
    relativeLogoWidth=widthHeightRatio * relativeLogoHeight;
  }
  position.setHeight(relativeLogoHeight);
  position.setWidth(relativeLogoWidth);
  return position;
}
Program: 78100
Project: 78100
Buggy source:
public ProfileCheckboxCell(ObservableList<Profile> pList,ProfileService pservice,String checkboxTyp){
  this.pList=pList;
  this.pservice=pservice;
  this.checkboxTyp=checkboxTyp;
}

Fixed version (ground truth):
public ProfileCheckboxCell(ObservableList<Profile> pList,ProfileService pservice,String checkboxTyp){
  this.pList=pList;
  this.pservice=pservice;
  this.checkboxTyp=checkboxTyp;
  cellCheckbox.setOnMouseClicked(new EventHandler<MouseEvent>(){
    @Override public void handle(    MouseEvent event){
      Profile currentProfile=(Profile)ProfileCheckboxCell.this.getTableView().getItems().get(ProfileCheckboxCell.this.getIndex());
      if (checkboxTyp.equals("String_Node_Str"))       currentProfile.setMobilEnabled(cellCheckbox.isSelected());
 else       if (checkboxTyp.equals("String_Node_Str"))       currentProfile.setMobilEnabled(cellCheckbox.isSelected());
 else       if (checkboxTyp.equals("String_Node_Str"))       currentProfile.setMobilEnabled(cellCheckbox.isSelected());
 else       if (checkboxTyp.equals("String_Node_Str"))       currentProfile.setMobilEnabled(cellCheckbox.isSelected());
      try {
        pservice.edit(currentProfile);
      }
 catch (      ServiceException e) {
        e.printStackTrace();
      }
    }
  }
);
}
Program: 78101
Project: 78101
Buggy source:
/** 
 * @Test public void getProfileWithValidArgumentThatExistsInPersistenceStore() throws ServiceException{ Profile profile = new Profile(100, "Testprofile100", null,null,false,false,false,false); profileService.add(profile); profile = profileService.get(100); assertTrue(profile.getName() == "Testprofile100" && profile.getId() == 100); }
 */
public void readProfileWithValidArgumentThatDoesNotExistInPersistenceStore() throws ServiceException {
  Profile profile=new Profile(100,"String_Node_Str",null,null,false,false,false,false);
  profileService.add(profile);
  profile=profileService.get(101);
  assertTrue(profile == null);
}

Fixed version (ground truth):
/** 
 * @Test public void getProfileWithValidArgumentThatExistsInPersistenceStore() throws ServiceException{ Profile profile = new Profile(100, "Testprofile100", null,null,false,false,false,false); profileService.add(profile); profile = profileService.get(100); assertTrue(profile.getName() == "Testprofile100" && profile.getId() == 100); }
 */
public void readProfileWithValidArgumentThatDoesNotExistInPersistenceStore() throws ServiceException {
  Profile profile=new Profile(100,"String_Node_Str",null,null,false,false,false,false,false);
  profileService.add(profile);
  profile=profileService.get(101);
  assertTrue(profile == null);
}
Program: 78102
Project: 78102
Buggy source:
public void deleteProfileWithValidArgumentThatExistsInPersistenceStore() throws ServiceException {
  Profile profile=new Profile(100,"String_Node_Str",null,null,false,false,false,false);
  profileService.add(profile);
  profile=profileService.get(100);
  assertTrue(profile.getName() == "String_Node_Str" && profile.getId() == 100);
  profileService.erase(profile);
  profile=profileService.get(100);
  assertTrue(profile == null);
}

Fixed version (ground truth):
public void deleteProfileWithValidArgumentThatExistsInPersistenceStore() throws ServiceException {
  Profile profile=new Profile(100,"String_Node_Str",null,null,false,false,false,false,false);
  profileService.add(profile);
  profile=profileService.get(100);
  assertTrue(profile.getName() == "String_Node_Str" && profile.getId() == 100);
  profileService.erase(profile);
  profile=profileService.get(100);
  assertTrue(profile == null);
}
Program: 78104
Project: 78104
Buggy source:
public void closeFrames(){
  for (  Stage stage : shotStages)   stage.close();
}

Fixed version (ground truth):
public void closeFrames(){
  isClosed=true;
  for (  Stage stage : shotStages)   stage.close();
}
Program: 78105
Project: 78105
Buggy source:
@Override public List<Camera> getCameras() throws CameraException {
  try {
    cameraService.setAllCamerasInactive();
  }
 catch (  ServiceException e) {
    LOGGER.debug("String_Node_Str");
  }
  int count=0;
  final CameraList cl=new CameraList();
  try {
    LOGGER.debug("String_Node_Str" + cl);
    count=cl.getCount();
    Camera camera;
    for (int i=0; i < count; i++) {
      cameraGphotoList.add(new CameraGphoto());
      Pointer pInfo=cl.getPortInfo(i);
      cameraPortList.add(cl.getPort(i));
      cameraModelList.add(cl.getModel(i));
      LOGGER.debug(pInfo.toString());
      cameraGphotoList.get(i).setPortInfo(cl.getPortPath(cl.getPort(i,true)));
      cameraGphotoList.get(i).initialize();
      cameraGphotoList.get(i).ref();
      try {
        camera=cameraService.createCamera(new Camera(-1,"String_Node_Str" + i,cameraPortList.get(i),cameraModelList.get(i),"String_Node_Str" + i));
        cameraService.setCameraActive(camera.getId());
        cameraList.add(camera);
      }
 catch (      ServiceException ex) {
        LOGGER.error("String_Node_Str");
        throw new CameraException(ex.getMessage(),-1);
      }
    }
  }
  finally {
    CameraUtils.closeQuietly(cl);
  }
  return null;
}

Fixed version (ground truth):
@Override public List<Camera> getCameras() throws CameraException {
  try {
    cameraService.setAllCamerasInactive();
  }
 catch (  ServiceException e) {
    LOGGER.debug("String_Node_Str");
  }
  int count=0;
  final CameraList cl=new CameraList();
  try {
    LOGGER.debug("String_Node_Str" + cl);
    count=cl.getCount();
    Camera camera;
    for (int i=0; i < count; i++) {
      cameraGphotoList.add(new CameraGphoto());
      Pointer pInfo=cl.getPortInfo(i);
      cameraPortList.add(cl.getPort(i));
      cameraModelList.add(cl.getModel(i));
      LOGGER.debug(pInfo.toString());
      cameraGphotoList.get(i).setPortInfo(cl.getPortPath(cl.getPort(i,true)));
      cameraGphotoList.get(i).initialize();
      cameraGphotoList.get(i).ref();
      try {
        camera=new Camera(-1,"String_Node_Str" + i,cameraPortList.get(i),cameraModelList.get(i),"String_Node_Str" + i);
        camera=cameraService.cameraExists(camera);
        if (camera == null) {
          camera=new Camera(-1,"String_Node_Str" + i,cameraPortList.get(i),cameraModelList.get(i),"String_Node_Str" + i);
          cameraService.createCamera(camera);
        }
        cameraService.setCameraActive(camera.getId());
        cameraList.add(camera);
      }
 catch (      ServiceException ex) {
        LOGGER.error("String_Node_Str");
        throw new CameraException(ex.getMessage(),-1);
      }
    }
  }
  finally {
    CameraUtils.closeQuietly(cl);
  }
  return null;
}
Program: 78107
Project: 78107
Buggy source:
public CameraFile waitForImage(){
  checkNotClosed();
  PointerByReference event=new PointerByReference();
  try {
    final PointerByReference event_data=new PointerByReference();
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_wait_for_event(camera,1000000,event,event_data,CameraList.CONTEXT),"String_Node_Str");
    if (event.getPointer().getInt(0) == GP_EVENT_FILE_ADDED) {
      final CameraFilePath path=new CameraFilePath(event_data.getValue());
      path.read();
      final CameraFile.Path p=new CameraFile.Path(path);
      LOGGER.debug("String_Node_Str");
      return p.newFile(camera);
    }
 else {
      return null;
    }
  }
 catch (  CameraException ex) {
    LOGGER.error("String_Node_Str");
    return null;
  }
}

Fixed version (ground truth):
public CameraFile waitForImage() throws CameraException {
  checkNotClosed();
  PointerByReference event=new PointerByReference();
  try {
    final PointerByReference event_data=new PointerByReference();
    CameraUtils.check(GPhoto2Native.INSTANCE.gp_camera_wait_for_event(camera,0,event,event_data,CameraList.CONTEXT),"String_Node_Str");
    if (event.getPointer().getInt(0) == GP_EVENT_FILE_ADDED) {
      final CameraFilePath path=new CameraFilePath(event_data.getValue());
      path.read();
      final CameraFile.Path p=new CameraFile.Path(path);
      LOGGER.debug("String_Node_Str");
      return p.newFile(camera);
    }
 else {
      return null;
    }
  }
 catch (  CameraException ex) {
    LOGGER.error("String_Node_Str");
    throw new CameraException(ex.getMessage(),ex.getResult());
  }
}
Program: 78108
Project: 78108
Buggy source:
/** 
 * inizialise cb_Profiles
 */
@FXML private void initialize(){
  try {
    List<Profile> prof=profileService.getAllProfiles();
    ObservableList<Profile> observableListProfile=FXCollections.observableList(prof);
    profileChoiceBox.setItems(observableListProfile);
    if (profileChoiceBox != null) {
      profileChoiceBox.setValue(observableListProfile.get(0));
    }
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * inizialise cb_Profiles
 */
@FXML private void initialize(){
  try {
    List<Profile> prof=profileService.getAllProfiles();
    ObservableList<Profile> observableListProfile=FXCollections.observableList(prof);
    profileChoiceBox.setItems(observableListProfile);
    if (profileChoiceBox != null && !observableListProfile.isEmpty()) {
      profileChoiceBox.setValue(observableListProfile.get(0));
    }
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
  }
}
Program: 78109
Project: 78109
Buggy source:
/** 
 * This test reads all images of an existing shooting in database.
 */
@Test public void getAllImagesByExistingShootingID() throws Throwable {
  shootingDAO.create(new Shooting(1,1,"String_Node_Str",true));
  Image img=new Image(99,"String_Node_Str",2,new Date());
  img.setAutoDate();
  imageDAO.create(img);
  assertThat(imageDAO.getAllImages(99).size(),is(1));
}

Fixed version (ground truth):
/** 
 * This test reads all images of an existing shooting in database.
 */
@Test public void getAllImagesByExistingShootingID() throws Throwable {
  shootingDAO.create(new Shooting(1,1,"String_Node_Str",true));
  Image img=new Image(99,"String_Node_Str",2,new Date());
  img.setAutoDate();
  imageDAO.create(img);
  assertThat(imageDAO.getAllImages(99).size(),is(0));
}
Program: 78110
Project: 78110
Buggy source:
/** 
 * iniziaising full screen image view
 */
@FXML private void initialize(){
  try {
    if (imageList == null) {
      activ=shootingService.searchIsActive().getId();
      if (activ != 0) {
        imageList=imageService.getAllImages(activ);
      }
      currentIndex=0;
    }
    if (currentIndex >= 0 && imageList != null && imageList.isEmpty()) {
      Image imlast=null;
      Image imnext=null;
      Image imonscreen=new Image(new FileInputStream(imageList.get(currentIndex).getImagepath()));
      slide[1]=new ImageView(imonscreen);
      if (currentIndex != 0) {
        imlast=new Image(new FileInputStream(imageList.get(currentIndex - 1).getImagepath()));
        slide[0]=new ImageView(imlast);
      }
 else {
        slide[0]=null;
      }
      if (currentIndex != imageList.size() - 1) {
        imnext=new Image(new FileInputStream(imageList.get(currentIndex + 1).getImagepath()));
        slide[2]=new ImageView(imnext);
      }
 else {
        slide[2]=null;
      }
      ivfullscreenImage.setImage(slide[1].getImage());
    }
  }
 catch (  ServiceException e) {
    LOGGER.debug("String_Node_Str" + e);
    informationDialog("String_Node_Str");
  }
catch (  FileNotFoundException e) {
    LOGGER.debug("String_Node_Str" + e);
    informationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * iniziaising full screen image view
 */
@FXML private void initialize(){
  try {
    if (imageList == null) {
      activ=shootingService.searchIsActive().getId();
      if (activ != 0) {
        imageList=imageService.getAllImages(activ);
      }
      currentIndex=0;
    }
    if (currentIndex >= 0 && imageList != null && !imageList.isEmpty()) {
      Image imlast=null;
      Image imnext=null;
      Image imonscreen=new Image(new FileInputStream(imageList.get(currentIndex).getImagepath()));
      slide[1]=new ImageView(imonscreen);
      if (currentIndex != 0) {
        imlast=new Image(new FileInputStream(imageList.get(currentIndex - 1).getImagepath()));
        slide[0]=new ImageView(imlast);
      }
 else {
        slide[0]=null;
      }
      if (currentIndex != imageList.size() - 1) {
        imnext=new Image(new FileInputStream(imageList.get(currentIndex + 1).getImagepath()));
        slide[2]=new ImageView(imnext);
      }
 else {
        slide[2]=null;
      }
      ivfullscreenImage.setImage(slide[1].getImage());
    }
  }
 catch (  ServiceException e) {
    LOGGER.debug("String_Node_Str" + e);
    informationDialog("String_Node_Str");
  }
catch (  FileNotFoundException e) {
    LOGGER.debug("String_Node_Str" + e);
    informationDialog("String_Node_Str");
  }
}
Program: 78111
Project: 78111
Buggy source:
/** 
 * Closes the mainStage and all shotStages, which leads to the application being closed, too.
 */
public void closeStages(){
  shotStageList.forEach(Stage::close);
  mainStage.close();
}

Fixed version (ground truth):
/** 
 * Closes the mainStage and all shotStages, which leads to the application being closed, too.
 */
public void closeStages(){
  mainStage.close();
}
Program: 78113
Project: 78113
Buggy source:
@Override public void addLogosCreateNewImage(String srcImgPath,String destImgPath) throws ServiceException {
  BufferedImage img;
  try {
    img=ImageIO.read(new File(srcImgPath));
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str" + e);
    throw new ServiceException(e);
  }
  List<Logo> logos=profileService.getAllLogosOfProfile();
  for (  Logo logo : logos) {
    if (!cachedLogos.containsKey(logo)) {
      BufferedImage logoImage=ImageIO.read(logo.getPath());
      cachedLogos.put(logo,logoImage);
    }
    RelativeRectangle curLogoPosition=profileService.getRelativeRectangleOfLogoOfProfile(logo);
    addLogoAtPosition(img,cachedLogos.get(logo),curLogoPosition);
  }
  try {
    saveImage(img,destImgPath);
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str" + e);
    throw new ServiceException(e);
  }
}

Fixed version (ground truth):
@Override public void addLogosCreateNewImage(String srcImgPath,String destImgPath) throws ServiceException {
  BufferedImage img;
  try {
    img=ImageIO.read(new File(srcImgPath));
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str" + e);
    throw new ServiceException(e);
  }
  List<Logo> logos=profileService.getAllLogosOfProfile();
  for (  Logo logo : logos) {
    try {
      if (!cachedLogos.containsKey(logo)) {
        BufferedImage logoImage=ImageIO.read(new File(logo.getPath()));
        cachedLogos.put(logo,logoImage);
      }
      RelativeRectangle curLogoPosition=profileService.getRelativeRectangleOfLogoOfProfile(logo);
      addLogoAtPosition(img,cachedLogos.get(logo),curLogoPosition);
    }
 catch (    IOException e) {
      LOGGER.error("String_Node_Str" + e);
      throw new ServiceException(e);
    }
  }
  try {
    saveImage(img,destImgPath);
  }
 catch (  IOException e) {
    LOGGER.error("String_Node_Str" + e);
    throw new ServiceException(e);
  }
}
Program: 78114
Project: 78114
Buggy source:
@Override public void start(Stage primaryStage) throws IOException {
  LOGGER.info("String_Node_Str");
  applicationContext=new AnnotationConfigApplicationContext(MainApplication.class);
  windowManager=applicationContext.getBean(WindowManager.class);
  windowManager.prepare(primaryStage,applicationContext);
}

Fixed version (ground truth):
@Override public void start(Stage primaryStage) throws IOException {
  LOGGER.info("String_Node_Str");
  applicationContext=new AnnotationConfigApplicationContext(MainApplication.class);
  WindowManager windowManager=applicationContext.getBean(WindowManager.class);
  windowManager.start(primaryStage,applicationContext);
}
Program: 78115
Project: 78115
Buggy source:
/** 
 * Closes the login-frame and sets back all the values possibly changed during the time it was open.
 */
@FXML public void closeLogin(){
  wrongCredentialsLabel.setVisible(false);
  adminField.setText("String_Node_Str");
  passwordField.setText("String_Node_Str");
  windowManager.showMainFrame();
}

Fixed version (ground truth):
/** 
 * Closes the login-frame and sets back all the values possibly changed during the time it was open.
 */
@FXML public void closeLogin(){
  resetValues();
  windowManager.showMainFrame();
}
Program: 78116
Project: 78116
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) {
      windowManager.showShootingAdministration();
      closeLogin();
    }
 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) {
      windowManager.showShootingAdministration();
      resetValues();
    }
 else {
      wrongCredentialsLabel.setVisible(true);
    }
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str" + e);
  }
}
Program: 78117
Project: 78117
Buggy source:
public Stage getStage(){
  return this.mainStage;
}

Fixed version (ground truth):
/** 
 * Returns the mainStage.
 * @return the mainStage
 */
public Stage getStage(){
  return this.mainStage;
}
Program: 78118
Project: 78118
Buggy source:
public void showMiniatureFrame(){
  mainStage.setScene(miniaturScene);
  mainStage.setFullScreen(true);
}

Fixed version (ground truth):
/** 
 * Sets the miniaturScene as Scene in the mainStage.
 */
public void showMiniatureFrame(){
  mainStage.setScene(miniaturScene);
  mainStage.setFullScreen(true);
}
Program: 78119
Project: 78119
Buggy source:
public void closeStages(){
  shotStageList.forEach(Stage::close);
  mainStage.close();
}

Fixed version (ground truth):
/** 
 * Closes the mainStage and all shotStages, which leads to the application being closed, too.
 */
public void closeStages(){
  shotStageList.forEach(Stage::close);
  mainStage.close();
}
Program: 78120
Project: 78120
Buggy source:
public void showMainFrame(){
  mainStage.setScene(mainScene);
  mainStage.setFullScreen(true);
}

Fixed version (ground truth):
/** 
 * Sets the mainScene as Scene in the mainStage.
 */
public void showMainFrame(){
  mainStage.setScene(mainScene);
  mainStage.setFullScreen(true);
}
Program: 78121
Project: 78121
Buggy source:
public void showProfileScene(){
  mainStage.setScene(profileScene);
  mainStage.setFullScreen(true);
}

Fixed version (ground truth):
/** 
 * Sets the profileScene as Scene in the mainStage.
 */
public void showProfileScene(){
  mainStage.setScene(profileScene);
  mainStage.setFullScreen(true);
}
Program: 78122
Project: 78122
Buggy source:
public void showAdminLogin(){
  mainStage.setScene(adminLoginScene);
  mainStage.setFullScreen(true);
}

Fixed version (ground truth):
/** 
 * Sets the adminLoginScene as Scene in the mainStage.
 */
public void showAdminLogin(){
  mainStage.setScene(adminLoginScene);
  mainStage.setFullScreen(true);
}
Program: 78123
Project: 78123
Buggy source:
public void showShootingAdministration(){
  mainStage.setScene(shootingScene);
  mainStage.setFullScreen(true);
}

Fixed version (ground truth):
/** 
 * Sets the shootingScene as Scene in the mainStage.
 */
public void showShootingAdministration(){
  mainStage.setScene(shootingScene);
  mainStage.setFullScreen(true);
}
Program: 78124
Project: 78124
Buggy source:
@Override public Logo read(long 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.setLong(1,id);
    rs=stmt.executeQuery();
    if (!rs.next()) {
      Logo logo=new Logo(rs.getLong("String_Node_Str"),rs.getString("String_Node_Str"),rs.getBoolean("String_Node_Str"));
      LOGGER.debug("String_Node_Str" + logo);
      return logo;
    }
 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 Logo read(long 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.setLong(1,id);
    rs=stmt.executeQuery();
    if (rs.next()) {
      Logo logo=new Logo(rs.getLong("String_Node_Str"),rs.getString("String_Node_Str"),rs.getBoolean("String_Node_Str"));
      LOGGER.debug("String_Node_Str" + logo);
      return logo;
    }
 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: 78125
Project: 78125
Buggy source:
@Override public int getNextImageID(){
  LOGGER.debug("String_Node_Str");
  PreparedStatement stmt=null;
  String query="String_Node_Str";
  int nextImageID=0;
  try {
    stmt=con.prepareStatement(query);
    stmt.setInt(1,17);
    ResultSet rs=stmt.executeQuery();
    while (rs.next()) {
      nextImageID=rs.getInt("String_Node_Str") + 1;
    }
  }
 catch (  SQLException e) {
    new IllegalArgumentException("String_Node_Str",e);
  }
catch (  NullPointerException e) {
    throw new IllegalArgumentException();
  }
 finally {
    if (stmt != null) {
      try {
        stmt.close();
      }
 catch (      SQLException e) {
        new IllegalArgumentException("String_Node_Str",e);
      }
    }
  }
  return nextImageID;
}

Fixed version (ground truth):
@Override public int getNextImageID(){
  LOGGER.debug("String_Node_Str");
  PreparedStatement stmt=null;
  String query="String_Node_Str";
  int nextImageID=0;
  try {
    stmt=con.prepareStatement(query);
    stmt.setString(1,"String_Node_Str");
    ResultSet rs=stmt.executeQuery();
    while (rs.next()) {
      nextImageID=rs.getInt("String_Node_Str") + 1;
    }
  }
 catch (  SQLException e) {
    new IllegalArgumentException("String_Node_Str",e);
  }
catch (  NullPointerException e) {
    throw new IllegalArgumentException();
  }
 finally {
    if (stmt != null) {
      try {
        stmt.close();
      }
 catch (      SQLException e) {
        new IllegalArgumentException("String_Node_Str",e);
      }
    }
  }
  return nextImageID;
}
Program: 78126
Project: 78126
Buggy source:
/** 
 * Closes the login-frame and sets back all the values possibly changed during the time it was open.
 */
@FXML public void closeLogin(){
  wrongCredentialsLabel.setVisible(false);
  adminField.setText("String_Node_Str");
  passwordField.setText("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Closes the login-frame and sets back all the values possibly changed during the time it was open.
 */
@FXML public void closeLogin(){
  wrongCredentialsLabel.setVisible(false);
  adminField.setText("String_Node_Str");
  passwordField.setText("String_Node_Str");
  windowManager.showMainFrame();
}
Program: 78127
Project: 78127
Buggy source:
/** 
 * information dialog
 * @param info
 */
public void showInformationDialog(String info){
  Alert information=new Alert(Alert.AlertType.INFORMATION,info);
  information.setHeaderText("String_Node_Str");
  information.initOwner(primaryStage);
  information.show();
}

Fixed version (ground truth):
/** 
 * information dialog
 * @param info
 */
public void showInformationDialog(String info){
  Alert information=new Alert(Alert.AlertType.INFORMATION,info);
  information.setHeaderText("String_Node_Str");
  information.initOwner(windowManager.getStage());
  information.show();
}
Program: 78128
Project: 78128
Buggy source:
/** 
 * Opens Mainfframe again
 * @param actionEvent
 */
public void onDemolitionPressed(ActionEvent actionEvent){
  storageDirLabel.setText("String_Node_Str");
  primaryStage.close();
}

Fixed version (ground truth):
/** 
 * Opens Mainfframe again
 * @param actionEvent
 */
public void onDemolitionPressed(ActionEvent actionEvent){
  storageDirLabel.setText("String_Node_Str");
  windowManager.showMainFrame();
}
Program: 78129
Project: 78129
Buggy source:
/** 
 * Shooting wird beendet
 * @param actionEvent
 */
public void onStopShootingPressed(ActionEvent actionEvent){
  try {
    shootingService.endShooting();
    Alert information=new Alert(Alert.AlertType.INFORMATION,"String_Node_Str");
    information.setHeaderText("String_Node_Str");
    information.initOwner(primaryStage);
    information.show();
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Shooting wird beendet
 * @param actionEvent
 */
public void onStopShootingPressed(ActionEvent actionEvent){
  try {
    shootingService.endShooting();
    Alert information=new Alert(Alert.AlertType.INFORMATION,"String_Node_Str");
    information.setHeaderText("String_Node_Str");
    information.initOwner(windowManager.getStage());
    information.show();
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
  }
}
Program: 78130
Project: 78130
Buggy source:
/** 
 * find ordner of desire to save new project in
 * @param actionEvent
 */
public void onChooseStorageDirPressed(ActionEvent actionEvent){
  try {
    DirectoryChooser directoryChooser=new DirectoryChooser();
    directoryChooser.setTitle("String_Node_Str");
    File savefile=directoryChooser.showDialog(primaryStage);
    storageDirLabel.setText(savefile.getPath());
    path=savefile.getPath();
  }
 catch (  NullPointerException n) {
    showInformationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * find ordner of desire to save new project in
 * @param actionEvent
 */
public void onChooseStorageDirPressed(ActionEvent actionEvent){
  try {
    DirectoryChooser directoryChooser=new DirectoryChooser();
    directoryChooser.setTitle("String_Node_Str");
    File savefile=directoryChooser.showDialog(windowManager.getStage());
    storageDirLabel.setText(savefile.getPath());
    path=savefile.getPath();
  }
 catch (  NullPointerException n) {
    showInformationDialog("String_Node_Str");
  }
}
Program: 78132
Project: 78132
Buggy source:
public void showProfileStage(){
  mainStage.setScene(profileScene);
}

Fixed version (ground truth):
public void showProfileStage(){
  mainStage.setScene(profileScene);
  mainStage.setFullScreen(true);
}
Program: 78133
Project: 78133
Buggy source:
public void showMainFrame(){
  mainStage.show();
}

Fixed version (ground truth):
public void showMainFrame(){
  mainStage.setScene(mainScene);
  mainStage.setFullScreen(true);
}
Program: 78134
Project: 78134
Buggy source:
public void showAdminLogin(){
  mainStage.setScene(adminLoginScene);
}

Fixed version (ground truth):
public void showAdminLogin(){
  mainStage.setScene(adminLoginScene);
  mainStage.setFullScreen(true);
}
Program: 78135
Project: 78135
Buggy source:
public void showShootingAdministration(){
  mainStage.setScene(shootingScene);
}

Fixed version (ground truth):
public void showShootingAdministration(){
  mainStage.setScene(shootingScene);
  mainStage.setFullScreen(true);
}
Program: 78136
Project: 78136
Buggy source:
public JDBCImageDAO() throws PersistenceException {
  con=H2Handler.getInstance().getConnection();
}

Fixed version (ground truth):
@Autowired public JDBCImageDAO(DBHandler dbHandler) throws PersistenceException {
  con=dbHandler.getConnection();
}
Program: 78137
Project: 78137
Buggy source:
public JDBCShootingDAO() throws Exception {
  con=H2Handler.getInstance().getConnection();
}

Fixed version (ground truth):
@Autowired public JDBCShootingDAO(DBHandler dbHandler) throws PersistenceException {
  con=dbHandler.getConnection();
}
Program: 78139
Project: 78139
Buggy source:
@Override public void add_session(Shooting shouting) throws PersistenceException {
  try {
    PreparedStatement stmt=con.prepareStatement("String_Node_Str" + shouting.getPropertyId() + shouting.getStorageFile()+ "String_Node_Str"+ shouting.getIsactiv()+ "String_Node_Str",java.sql.Statement.RETURN_GENERATED_KEYS);
  }
 catch (  SQLException e) {
    LOGGER.info("String_Node_Str",e.getMessage());
    throw new PersistenceException(e);
  }
}

Fixed version (ground truth):
@Override public void add_session(Shooting shouting) throws PersistenceException {
  try {
    String sql="String_Node_Str";
    PreparedStatement stmt=null;
    stmt=this.con.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);
    stmt.setInt(1,shouting.getPropertyId());
    stmt.setString(2,shouting.getStorageFile());
    stmt.setBoolean(3,shouting.getIsactiv());
    stmt.executeUpdate();
  }
 catch (  SQLException e) {
    LOGGER.info("String_Node_Str",e.getMessage());
    throw new PersistenceException(e);
  }
}
Program: 78140
Project: 78140
Buggy source:
/** 
 * Opens Mainfframe again
 * @param actionEvent
 */
public void on_DemolitionPressed(ActionEvent actionEvent){
  lb_storageplace.setText("String_Node_Str");
  mainApplication.showMainFraim();
}

Fixed version (ground truth):
/** 
 * Opens Mainfframe again
 * @param actionEvent
 */
public void on_DemolitionPressed(ActionEvent actionEvent){
  lb_storageplace.setText("String_Node_Str");
  primaryStage.close();
}
Program: 78141
Project: 78141
Buggy source:
/** 
 * when pressed an new session starts(costumer interface opens)
 * @param actionEvent
 */
public void on_StartSessoionPressed(ActionEvent actionEvent){
  if (cb_Profile.getValue() != null) {
    if (path == "String_Node_Str" || path == null) {
      Profile profile=(Profile)cb_Profile.getSelectionModel().getSelectedItem();
      Shooting shouting=new Shooting(profile.getId(),path,true);
      lb_storageplace.setText("String_Node_Str");
      LOGGER.info("String_Node_Str",shouting);
      try {
        sessionService.add_session(shouting);
      }
 catch (      ServiceException serviceExeption) {
        LOGGER.info("String_Node_Str",serviceExeption.getMessage());
        informationDialog("String_Node_Str");
      }
    }
 else {
      informationDialog("String_Node_Str");
    }
  }
 else {
    informationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * when pressed an new session starts(costumer interface opens)
 * @param actionEvent
 */
public void on_StartSessoionPressed(ActionEvent actionEvent){
  LOGGER.info(path);
  if (cb_Profile.getValue() != null) {
    if (path != null) {
      try {
        Profile profile=(Profile)cb_Profile.getSelectionModel().getSelectedItem();
        Shooting shouting=new Shooting(profile.getId(),path,true);
        lb_storageplace.setText("String_Node_Str");
        LOGGER.info("String_Node_Str",path);
        path=null;
        sessionService.add_session(shouting);
      }
 catch (      ServiceException serviceExeption) {
        LOGGER.debug(serviceExeption.getMessage());
        informationDialog("String_Node_Str");
      }
    }
 else {
      informationDialog("String_Node_Str");
    }
  }
 else {
    informationDialog("String_Node_Str");
  }
}
Program: 78142
Project: 78142
Buggy source:
/** 
 * find ordner of desire to save new project in
 * @param actionEvent
 */
public void on_FinedPressed(ActionEvent actionEvent){
  DirectoryChooser directoryChooser=new DirectoryChooser();
  directoryChooser.setTitle("String_Node_Str");
  File savefile=directoryChooser.showDialog(primaryStage);
  lb_storageplace.setText(savefile.getPath());
  path=savefile.getPath();
}

Fixed version (ground truth):
/** 
 * find ordner of desire to save new project in
 * @param actionEvent
 */
public void on_FinedPressed(ActionEvent actionEvent){
  try {
    DirectoryChooser directoryChooser=new DirectoryChooser();
    directoryChooser.setTitle("String_Node_Str");
    File savefile=directoryChooser.showDialog(primaryStage);
    lb_storageplace.setText(savefile.getPath());
    path=savefile.getPath();
  }
 catch (  NullPointerException n) {
    informationDialog("String_Node_Str");
  }
}
Program: 78143
Project: 78143
Buggy source:
@Override public void onStockFetched(Stock stock){
  if (swipeRefreshLayout != null)   swipeRefreshLayout.setRefreshing(false);
  if (stock != null) {
    stockTrackingBinding.setStock(stock);
    currentStock=stock;
    Timber.d("String_Node_Str");
  }
 else {
    Timber.d("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onStockFetched(Stock stock){
  if (swipeRefreshLayout != null)   swipeRefreshLayout.setRefreshing(false);
  if (stock != null) {
    stockTrackingBinding.setStock(stock);
    currentStock=stock;
  }
}
Program: 78144
Project: 78144
Buggy source:
@Override public void unsubscribe(){
  compositeSubscription.clear();
}

Fixed version (ground truth):
@Override public void unsubscribe(){
  Timber.d("String_Node_Str");
  compositeSubscription.clear();
}
Program: 78145
Project: 78145
Buggy source:
public void fetchstock(String stockName,boolean inBackground){
  if (!inBackground)   stockView.showLoading();
  compositeSubscription.add(stockDataRepository.getStock(stockName).subscribeOn(AndroidSchedulers.mainThread()).subscribe(stock -> {
    stockView.onStockFetched(stock);
  }
,throwable -> {
    throwable.printStackTrace();
  }
));
}

Fixed version (ground truth):
public void fetchstock(String stockName,boolean inBackground){
  if (fetchSubsciption != null) {
    compositeSubscription.remove(fetchSubsciption);
  }
  if (!inBackground)   stockView.showLoading();
  fetchSubsciption=stockDataRepository.getStock(stockName).observeOn(AndroidSchedulers.mainThread(),true).subscribe(stock -> {
    stockView.onStockFetched(stock);
  }
,e -> {
    if (e instanceof IOException && !NetworkUtils.isInternetOn(StockTrackerApp.getContext())) {
      stockView.showError(StringUtils.getString(R.string.no_internet));
    }
 else     stockView.showError(StringUtils.getString(R.string.something_went_wrong));
  }
);
  compositeSubscription.add(fetchSubsciption);
}
Program: 78146
Project: 78146
Buggy source:
@Override public Observable<Stock> getStock(String stockName){
  return RetrofitService.getInstance().getStockData(RestApi.FUNCTION.TIME_SERIES_DAILY,stockName,RestApi.INTERVAL.MIN_15.getValue(),RestApi.OUTPUT_SIZE.COMPACT,API_KEY).map(stockApiResponse -> getStockFromStockApiResponse(stockApiResponse));
}

Fixed version (ground truth):
@Override public Observable<Stock> getStock(String stockName){
  return RetrofitService.getInstance().getStockData(RestApi.FUNCTION.TIME_SERIES_DAILY,stockName,RestApi.INTERVAL.MIN_15.getValue(),RestApi.OUTPUT_SIZE.COMPACT,API_KEY).map(stockApiResponse -> getStockFromStockApiResponse(stockApiResponse)).subscribeOn(Schedulers.io());
}
Program: 78147
Project: 78147
Buggy source:
@Override protected void onPause(){
  super.onPause();
  scheduleStockSyncService(this,60 * 60,60 * 60 * 2);
}

Fixed version (ground truth):
@Override protected void onPause(){
  super.onPause();
  FirebaseHelper.scheduleStockSyncService(this,60 * 60,60 * 60 * 2);
}
Program: 78148
Project: 78148
Buggy source:
private void removeFocusAndCloseKeyboard(){
  stockEditText.requestFocus();
  InputMethodManager imm=(InputMethodManager)getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
  imm.hideSoftInputFromWindow(stockEditText.getRootView().getWindowToken(),0);
}

Fixed version (ground truth):
private void removeFocusAndCloseKeyboard(){
  stockEditText.requestFocus();
  InputMethodManager imm=(InputMethodManager)getContext().getSystemService(INPUT_METHOD_SERVICE);
  imm.hideSoftInputFromWindow(stockEditText.getWindowToken(),0);
}
Program: 78149
Project: 78149
Buggy source:
private void focusEditTextAndOpenKeyboard(){
  getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
  InputMethodManager imm=(InputMethodManager)getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
  imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
  stockEditText.requestFocus();
  stockEditText.performClick();
}

Fixed version (ground truth):
private void focusEditTextAndOpenKeyboard(){
  getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
Program: 78150
Project: 78150
Buggy source:
@Override public void setupDialog(Dialog dialog,int style){
  super.setupDialog(dialog,style);
  mView=View.inflate(getContext(),R.layout.fragment_stock_selector,null);
  dialog.setContentView(mView);
  ButterKnife.bind(this,mView);
  focusEditTextAndOpenKeyboard();
  stockEditText.setOnFocusChangeListener(new MyFocusChangeListener());
  CoordinatorLayout.LayoutParams params=(CoordinatorLayout.LayoutParams)((View)mView.getParent()).getLayoutParams();
  CoordinatorLayout.Behavior behavior=params.getBehavior();
  if (behavior != null && behavior instanceof BottomSheetBehavior) {
    ((BottomSheetBehavior)behavior).setBottomSheetCallback(mBottomSheetBehaviorCallback);
  }
  ButterKnife.bind(this,mView);
}

Fixed version (ground truth):
@Override public void setupDialog(Dialog dialog,int style){
  super.setupDialog(dialog,style);
  mView=View.inflate(getContext(),R.layout.fragment_stock_selector,null);
  dialog.setContentView(mView);
  ButterKnife.bind(this,mView);
  focusEditTextAndOpenKeyboard();
  CoordinatorLayout.LayoutParams params=(CoordinatorLayout.LayoutParams)((View)mView.getParent()).getLayoutParams();
  CoordinatorLayout.Behavior behavior=params.getBehavior();
  if (behavior != null && behavior instanceof BottomSheetBehavior) {
    ((BottomSheetBehavior)behavior).setBottomSheetCallback(mBottomSheetBehaviorCallback);
  }
  ButterKnife.bind(this,mView);
}
Program: 78152
Project: 78152
Buggy source:
@Override public void onViewCreated(View view,@Nullable Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  swipeRefreshLayout.setOnRefreshListener(() -> {
    swipeRefreshLayout.setRefreshing(true);
    stockPresenter.fetchstock(currentStockName,true,true);
  }
);
  if (currentStock == null)   stockPresenter.fetchstock(currentStockName,false,false);
 else {
    onStockFetched(currentStock);
  }
  EventBus.getInstance().toObserverable().subscribe(o -> {
    if (o instanceof StockSelectorFragment.StockSymbolWrapper) {
      String stockName=((StockSelectorFragment.StockSymbolWrapper)o).stockName;
      SharedPreferencesHelper.setLastViewedStock(stockName);
      currentStockName=stockName;
      currentStock=null;
      stockTrackingBinding.setStock(null);
      stockPresenter.fetchstock(((StockSelectorFragment.StockSymbolWrapper)o).stockName,false,false);
    }
  }
,throwable -> throwable.printStackTrace());
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,@Nullable Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  swipeRefreshLayout.setOnRefreshListener(() -> {
    swipeRefreshLayout.setRefreshing(true);
    stockPresenter.fetchstock(currentStockName,true,true);
  }
);
  if (currentStock == null)   stockPresenter.fetchstock(currentStockName,false,false);
 else {
    onStockFetched(currentStock);
  }
  EventBus.getInstance().toObserverable().subscribe(o -> {
    if (o instanceof StockSelectorFragment.StockSymbolWrapper) {
      String stockName=((StockSelectorFragment.StockSymbolWrapper)o).stockName;
      stockPresenter.fetchstock(stockName,false,false);
    }
  }
,throwable -> throwable.printStackTrace());
}
Program: 78153
Project: 78153
Buggy source:
@Override public void showError(String message){
  swipeRefreshLayout.setRefreshing(false);
  if (currentStock == null) {
    stockTrackingBinding.setShowRetry(true);
    stockTrackingBinding.setRetryMessage(message);
  }
 else {
    Toast.makeText(StockTrackerApp.getContext(),message,Toast.LENGTH_SHORT).show();
  }
}

Fixed version (ground truth):
@Override public void showError(String message){
  if (swipeRefreshLayout != null)   swipeRefreshLayout.setRefreshing(false);
  if (currentStock == null) {
    stockTrackingBinding.setShowRetry(true);
    stockTrackingBinding.setRetryMessage(message);
  }
 else {
    Toast.makeText(StockTrackerApp.getContext(),message,Toast.LENGTH_SHORT).show();
  }
}
Program: 78154
Project: 78154
Buggy source:
@Override public void onStockFetched(Stock stock){
  if (swipeRefreshLayout != null)   swipeRefreshLayout.setRefreshing(false);
  stockTrackingBinding.setShowRetry(false);
  if (stock != null) {
    if (!stock.isValidStock()) {
      showError(StringUtils.getString(R.string.invalid_stock));
      openStockSelector();
      return;
    }
    Timber.d("String_Node_Str");
    stockTrackingBinding.setStock(stock);
    currentStock=stock;
    drawGraph(stock);
  }
}

Fixed version (ground truth):
@Override public void onStockFetched(Stock stock){
  if (swipeRefreshLayout != null)   swipeRefreshLayout.setRefreshing(false);
  stockTrackingBinding.setShowRetry(false);
  if (stock != null) {
    if (!stock.isValidStock()) {
      showError(StringUtils.getString(R.string.invalid_stock));
      stockPresenter.unsubscribe();
      openStockSelector();
      return;
    }
    Timber.d("String_Node_Str");
    stockTrackingBinding.setStock(stock);
    currentStock=stock;
    currentStockName=stock.getStockName();
    SharedPreferencesHelper.setLastViewedStock(currentStockName);
    drawGraph(stock);
  }
}
Program: 78155
Project: 78155
Buggy source:
@Override public void destroy(){
  unsubscribe();
}

Fixed version (ground truth):
@Override public void destroy(){
  unsubscribe();
  stockView=null;
}
Program: 78156
Project: 78156
Buggy source:
private Stock getStockFromStockApiResponse(StockApiResponse stockApiResponse){
  Stock stock=new Stock();
  if (stockApiResponse.getErrorMessage() != null) {
    stock.setValidStock(false);
    return stock;
  }
  stock.setValidStock(true);
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  stock.setCurrentPrice(Double.valueOf(df.format(stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getClose())));
  stock.setClosed(!isMarkedOpen());
  stock.setOpeningPrice(Double.valueOf(df.format((stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getOpen()))));
  stock.setChangeInPrice(Double.valueOf(df.format(getChangeInPrice(stock.getCurrentPrice(),stockApiResponse))));
  stock.setIntradayLowPrice(Double.valueOf(df.format((stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getLow()))));
  stock.setIntradayHighPrice(Double.valueOf(df.format(stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getHigh())));
  stock.setStockName(stockApiResponse.getMetaData()._2Symbol);
  stock.setLastUpdatedDate(stockApiResponse.getMetaData()._3LastRefreshed);
  HashMap<String,Double> stockDatePriceMap=new HashMap<>();
  for (  String key : stockApiResponse.getTimeSeries15min().keySet())   stockDatePriceMap.put(key,stockApiResponse.getTimeSeries15min().get(key).getClose());
  stock.setHistoricalData(stockDatePriceMap);
  return stock;
}

Fixed version (ground truth):
public static Stock getStockFromStockApiResponse(StockApiResponse stockApiResponse){
  Stock stock=new Stock();
  if (stockApiResponse.getErrorMessage() != null) {
    stock.setValidStock(false);
    return stock;
  }
  stock.setValidStock(true);
  DecimalFormat df=new DecimalFormat("String_Node_Str");
  stock.setCurrentPrice(Double.valueOf(df.format(stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getClose())));
  stock.setClosed(!DateUtils.isMarkedOpen());
  stock.setOpeningPrice(Double.valueOf(df.format((stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getOpen()))));
  stock.setChangeInPrice(Double.valueOf(df.format(getChangeInPrice(stock.getCurrentPrice(),stockApiResponse))));
  stock.setIntradayLowPrice(Double.valueOf(df.format((stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getLow()))));
  stock.setIntradayHighPrice(Double.valueOf(df.format(stockApiResponse.getTimeSeries15min().get(stockApiResponse.getMetaData()._3LastRefreshed).getHigh())));
  stock.setStockName(stockApiResponse.getMetaData()._2Symbol);
  stock.setLastUpdatedDate(stockApiResponse.getMetaData()._3LastRefreshed);
  HashMap<String,Double> stockDatePriceMap=new HashMap<>();
  for (  String key : stockApiResponse.getTimeSeries15min().keySet())   stockDatePriceMap.put(key,stockApiResponse.getTimeSeries15min().get(key).getClose());
  stock.setHistoricalData(stockDatePriceMap);
  return stock;
}
Program: 78157
Project: 78157
Buggy source:
private double getChangeInPrice(double currentPrice,StockApiResponse stockApiResponse){
  Date todayDate=DateUtils.convertStringToDate(stockApiResponse.getMetaData()._3LastRefreshed);
  todayDate.setTime(todayDate.getTime() - 2);
  if (!stockApiResponse.getTimeSeries15min().containsKey(DateUtils.convertDateToString(todayDate)))   return 0d;
  return currentPrice - stockApiResponse.getTimeSeries15min().get(DateUtils.convertDateToString(todayDate)).getClose();
}

Fixed version (ground truth):
private static double getChangeInPrice(double currentPrice,StockApiResponse stockApiResponse){
  Date todayDate=DateUtils.convertStringToDate(stockApiResponse.getMetaData()._3LastRefreshed);
  todayDate.setTime(todayDate.getTime() - 2);
  if (!stockApiResponse.getTimeSeries15min().containsKey(DateUtils.convertDateToString(todayDate)))   return 0d;
  return currentPrice - stockApiResponse.getTimeSeries15min().get(DateUtils.convertDateToString(todayDate)).getClose();
}
Program: 78158
Project: 78158
Buggy source:
public void setPasswordAuthenticationAllowed(Boolean passwordAuthenticationAllowed){
  this.passwordAuthenticationAllowed=passwordAuthenticationAllowed;
}

Fixed version (ground truth):
public void setPasswordAuthenticationAllowed(boolean passwordAuthenticationAllowed){
  this.passwordAuthenticationAllowed=passwordAuthenticationAllowed;
}