nus-yam/ex-repair huggingface dataset:
Program: 77828
Project: 77828
Buggy source:
/** 
 * on serien pictures pressed
 */
public void onSerialPressed(){
  unmark();
  profile.getPairCameraPositions().get(index).setShotType(Profile.PairCameraPosition.SHOT_TYPE_MULTIPLE);
  serien.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(3))));
  currentMode=1;
}

Fixed version (ground truth):
/** 
 * on serien pictures pressed
 */
public void onSerialPressed(){
  try {
    unmark();
    profileservice.getActiveProfile().getPairCameraPositions().get(index).setShotType(Profile.PairCameraPosition.SHOT_TYPE_MULTIPLE);
    serien.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(3))));
    currentMode=1;
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 77830
Project: 77830
Buggy source:
/** 
 * decides whether an new filter image is chosen or green screen
 * @param index current mode
 * @param idFilter current filter id
 * @param greenscreen boolean green screen or not
 */
public void currentlyChosen(int index,int idFilter,boolean greenscreen){
  try {
    this.index=index;
    titel.setText("String_Node_Str");
    greengrid=new GridPane();
    if (filtergrid == null) {
      filtergrid=new GridPane();
    }
    if (index > -1) {
      profile=profileservice.getActiveProfile();
      if (profile.getId() != profileservice.getActiveProfile().getId()) {
      }
      currentMode=profile.getPairCameraPositions().get(index).getShotType();
      markfirst();
      if (greenscreen) {
        filtergrid.setVisible(false);
        greengrid.setVisible(true);
        titel.setText("String_Node_Str" + profile.getPairCameraPositions().get(index).getPosition().getName() + "String_Node_Str");
        titel.setVisible(true);
        createGreenscreenButton();
      }
 else {
        greengrid.setVisible(false);
        filtergrid.setVisible(true);
        titel.setText("String_Node_Str" + profile.getPairCameraPositions().get(index).getPosition().getName() + "String_Node_Str");
        titel.setVisible(true);
        creatButtons();
      }
    }
  }
 catch (  ServiceException e) {
    LOGGER.debug("String_Node_Str",e);
    showInformationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * decides whether an new filter image is chosen or green screen
 * @param index current mode
 * @param idFilter current filter id
 * @param greenscreen boolean green screen or not
 */
public void currentlyChosen(int index,int idFilter,boolean greenscreen){
  try {
    this.index=index;
    titel.setText("String_Node_Str");
    greengrid=new GridPane();
    if (filtergrid == null) {
      filtergrid=new GridPane();
    }
    if (index > -1) {
      currentMode=profileservice.getActiveProfile().getPairCameraPositions().get(index).getShotType();
      markfirst();
      if (greenscreen) {
        filtergrid.setVisible(false);
        greengrid.setVisible(true);
        titel.setText("String_Node_Str" + profileservice.getActiveProfile().getPairCameraPositions().get(index).getPosition().getName() + "String_Node_Str");
        titel.setVisible(true);
        createGreenscreenButton();
      }
 else {
        greengrid.setVisible(false);
        filtergrid.setVisible(true);
        titel.setText("String_Node_Str" + profileservice.getActiveProfile().getPairCameraPositions().get(index).getPosition().getName() + "String_Node_Str");
        titel.setVisible(true);
        creatButtons();
      }
    }
  }
 catch (  ServiceException e) {
    LOGGER.debug("String_Node_Str",e);
    showInformationDialog("String_Node_Str");
  }
}
Program: 77832
Project: 77832
Buggy source:
/** 
 * on single image pressed
 */
public void onSinglePressed(){
  unmark();
  profile.getPairCameraPositions().get(index).setShotType(Profile.PairCameraPosition.SHOT_TYPE_SINGLE);
  singel.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(3))));
  currentMode=0;
}

Fixed version (ground truth):
/** 
 * on single image pressed
 */
public void onSinglePressed(){
  try {
    unmark();
    profileservice.getActiveProfile().getPairCameraPositions().get(index).setShotType(Profile.PairCameraPosition.SHOT_TYPE_SINGLE);
    singel.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(3))));
    currentMode=0;
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 77833
Project: 77833
Buggy source:
/** 
 * inizialises chousenimage and buttonList and findes aktuell profile
 */
@FXML private void initialize(){
  try {
    if (shootingService.searchIsActive().getActive()) {
      profile=profileservice.get(shootingService.searchIsActive().getProfileid());
    }
    filtermap=new HashMap<>();
  }
 catch (  ServiceException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * inizialises chousenimage and buttonList and findes aktuell profile
 */
@FXML private void initialize(){
  filtermap=new HashMap<>();
}
Program: 77834
Project: 77834
Buggy source:
/** 
 * switch to login when pressed
 */
public void switchToLogin(){
  try {
    windowmanager.showAdminLogin(WindowManager.SHOW_SHOOTINGSCENE,WindowManager.SHOW_CUSTOMERSCENE);
    rightbutton.setVisible(true);
    if (!allpicturesview.isVisible()) {
      if (shootingservice.searchIsActive().getActive()) {
        profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
      }
      List<Profile.PairCameraPosition> pairList=profile.getPairCameraPositions();
      if (pairList.isEmpty() || pairList.size() == 0) {
        rightbutton.setVisible(false);
      }
      allpicturesview.setVisible(true);
      gridpanel.setVisible(true);
      leftbutton.setVisible(false);
      setInvisible();
    }
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * switch to login when pressed
 */
public void switchToLogin(){
  try {
    windowmanager.showAdminLogin(WindowManager.SHOW_SHOOTINGSCENE,WindowManager.SHOW_CUSTOMERSCENE);
    rightbutton.setVisible(true);
    if (!allpicturesview.isVisible()) {
      if (shootingservice.searchIsActive().getActive()) {
        profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
      }
      List<Profile.PairCameraPosition> pairList=profileservice.getAllPairCameraPositionOfProfile();
      if (pairList.isEmpty() || pairList.size() == 0) {
        rightbutton.setVisible(false);
      }
      allpicturesview.setVisible(true);
      gridpanel.setVisible(true);
      leftbutton.setVisible(false);
      setInvisible();
    }
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 77836
Project: 77836
Buggy source:
@FXML private void initialize(){
  try {
    leftbutton.setVisible(false);
    if (shootingservice.searchIsActive().getActive()) {
      profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
    }
    if (profile != null && !profile.isGreenscreenEnabled() && !profile.isFilerEnabled()) {
      rightbutton.setVisible(false);
    }
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@FXML private void initialize(){
  leftbutton.setVisible(false);
}
Program: 77837
Project: 77837
Buggy source:
/** 
 * if the customer wants to continue the shooting, he gets linked to the customer page of the active shooting
 */
public void onRecoveryPressed(){
  try {
    windowmanager.notifyActiveShootingAvailable();
    Profile profile=profileService.get(shootingService.searchIsActive().getProfileid());
    boolean camerasFitPosition=imageProcessingManager.checkImageProcessing(profile);
    if (camerasFitPosition) {
      imageProcessingManager.initImageProcessing();
      windowmanager.showScene(WindowManager.SHOW_CUSTOMERSCENE);
    }
 else {
      showInformationDialog("String_Node_Str");
      onEndShootingPressed();
    }
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
    onEndShootingPressed();
  }
}

Fixed version (ground truth):
/** 
 * if the customer wants to continue the shooting, he gets linked to the customer page of the active shooting
 */
public void onRecoveryPressed(){
  try {
    windowmanager.notifyActiveShootingAvailable();
    profileService.setActiveProfile(shootingService.searchIsActive().getProfileid());
    boolean camerasFitPosition=imageProcessingManager.checkImageProcessing(profileService.getActiveProfile());
    if (camerasFitPosition) {
      imageProcessingManager.initImageProcessing();
      windowmanager.showScene(WindowManager.SHOW_CUSTOMERSCENE);
    }
 else {
      showInformationDialog("String_Node_Str");
      onEndShootingPressed();
    }
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
    onEndShootingPressed();
  }
}
Program: 77838
Project: 77838
Buggy source:
/** 
 * when pressed a new shooting starts to successfully start a new shooting a storage path gets selected and a profile must be selected
 */
@FXML public void onStartShootingPressed(){
  LOGGER.info("String_Node_Str" + path);
  if (profileChoiceBox.getValue() != null) {
    try {
      Profile profile=profileChoiceBox.getSelectionModel().getSelectedItem();
      if (path == null) {
        path=shootingService.createPath();
      }
      profileService.setActiveProfile(profile.getId());
      Shooting shouting=new Shooting(0,profile.getId(),path,bgPath,true);
      path="String_Node_Str";
      shootingService.addShooting(shouting);
      boolean test=true;
      try {
        boolean camerasFitPosition=imageProcessingManager.checkImageProcessing(profile);
        if (camerasFitPosition) {
          imageProcessingManager.initImageProcessing();
          test=false;
        }
      }
 catch (      ServiceException e) {
        LOGGER.debug("String_Node_Str",e);
      }
 finally {
        if (test) {
          showInformationDialog("String_Node_Str");
        }
        windowManager.showScene(WindowManager.SHOW_CUSTOMERSCENE);
      }
    }
 catch (    ServiceException serviceExeption) {
      LOGGER.error("String_Node_Str",serviceExeption);
      showInformationDialog("String_Node_Str");
    }
  }
 else {
    showInformationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * when pressed a new shooting starts to successfully start a new shooting a storage path gets selected and a profile must be selected
 */
@FXML public void onStartShootingPressed(){
  LOGGER.info("String_Node_Str" + path);
  if (profileChoiceBox.getValue() != null) {
    try {
      Profile profile=profileChoiceBox.getSelectionModel().getSelectedItem();
      if (path == null) {
        path=shootingService.createPath();
      }
      Shooting shouting=new Shooting(0,profile.getId(),path,bgPath,true);
      path="String_Node_Str";
      shootingService.addShooting(shouting);
      profileService.setActiveProfile(profile.getId());
      boolean test=true;
      try {
        boolean camerasFitPosition=imageProcessingManager.checkImageProcessing(profile);
        if (camerasFitPosition) {
          imageProcessingManager.initImageProcessing();
          test=false;
        }
      }
 catch (      ServiceException e) {
        LOGGER.debug("String_Node_Str",e);
      }
 finally {
        if (test) {
          showInformationDialog("String_Node_Str");
        }
        windowManager.showScene(WindowManager.SHOW_CUSTOMERSCENE);
      }
    }
 catch (    ServiceException serviceExeption) {
      LOGGER.error("String_Node_Str",serviceExeption);
      showInformationDialog("String_Node_Str");
    }
  }
 else {
    showInformationDialog("String_Node_Str");
  }
}
Program: 77839
Project: 77839
Buggy source:
/** 
 * Opens Mainframe again
 */
@FXML public void onDemolitionPressed(){
  try {
    if (shootingService.searchIsActive().getActive()) {
      Profile profile=profileChoiceBox.getSelectionModel().getSelectedItem();
      if (shootingService.searchIsActive().getProfileid() == profile.getId()) {
        Shooting shooting=new Shooting(shootingService.searchIsActive().getId(),profile.getId(),"String_Node_Str",bgPath,true);
        LOGGER.debug("String_Node_Str" + shooting.getId() + "String_Node_Str"+ shooting.getBgPictureFolder());
        profileService.setActiveProfile(profile.getId());
        shootingService.update(shooting);
      }
      windowManager.showScene(WindowManager.SHOW_CUSTOMERSCENE);
    }
 else {
      windowManager.showScene(WindowManager.SHOW_MAINSCENE);
    }
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
    showInformationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Opens Mainframe again
 */
@FXML public void onDemolitionPressed(){
  try {
    if (shootingService.searchIsActive().getActive()) {
      Profile profile=profileChoiceBox.getSelectionModel().getSelectedItem();
      if (shootingService.searchIsActive().getProfileid() == profile.getId()) {
        Shooting shooting=new Shooting(shootingService.searchIsActive().getId(),profile.getId(),"String_Node_Str",bgPath,true);
        LOGGER.debug("String_Node_Str" + shooting.getId() + "String_Node_Str"+ shooting.getBgPictureFolder());
        profileService.setActiveProfile(profile.getId());
        profileService.resetActiveProfileNonPersistentAttributes();
        shootingService.update(shooting);
      }
      windowManager.showScene(WindowManager.SHOW_CUSTOMERSCENE);
    }
 else {
      windowManager.showScene(WindowManager.SHOW_MAINSCENE);
    }
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
    showInformationDialog("String_Node_Str");
  }
}
Program: 77840
Project: 77840
Buggy source:
/** 
 * Shooting ends to do so the service methode endShooting gets called and main frame gets called catches ServiceException caused by Service methodes
 */
@FXML public void onStopShootingPressed(){
  try {
    shootingService.endShooting();
    inactivemode();
    imageProcessingManager.stopImageProcessing();
    windowManager.showScene(WindowManager.SHOW_MAINSCENE);
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
    showInformationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Shooting ends to do so the service methode endShooting gets called and main frame gets called catches ServiceException caused by Service methodes
 */
@FXML public void onStopShootingPressed(){
  try {
    profileService.resetActiveProfileNonPersistentAttributes();
    shootingService.endShooting();
    inactivemode();
    imageProcessingManager.stopImageProcessing();
    windowManager.showScene(WindowManager.SHOW_MAINSCENE);
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
    showInformationDialog("String_Node_Str");
  }
}
Program: 77842
Project: 77842
Buggy source:
/** 
 * when pressed a new shooting starts to successfully start a new shooting a storage path gets selected and a profile must be selected
 */
@FXML public void onStartShootingPressed(){
  LOGGER.info("String_Node_Str" + path);
  if (profileChoiceBox.getValue() != null) {
    try {
      Profile profile=profileChoiceBox.getSelectionModel().getSelectedItem();
      if (path == null) {
        path=shootingService.createPath();
      }
      Shooting shouting=new Shooting(0,profile.getId(),path,bgPath,true);
      path="String_Node_Str";
      shootingService.addShooting(shouting);
      boolean test=true;
      try {
        boolean camerasFitPosition=imageProcessingManager.checkImageProcessing(profile);
        if (camerasFitPosition) {
          imageProcessingManager.initImageProcessing();
          test=false;
        }
      }
 catch (      ServiceException e) {
        LOGGER.debug("String_Node_Str",e);
      }
 finally {
        if (test) {
          showInformationDialog("String_Node_Str");
        }
        windowManager.showScene(WindowManager.SHOW_CUSTOMERSCENE);
      }
    }
 catch (    ServiceException serviceExeption) {
      LOGGER.error("String_Node_Str",serviceExeption);
      showInformationDialog("String_Node_Str");
    }
  }
 else {
    showInformationDialog("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * when pressed a new shooting starts to successfully start a new shooting a storage path gets selected and a profile must be selected
 */
@FXML public void onStartShootingPressed(){
  LOGGER.info("String_Node_Str" + path);
  if (profileChoiceBox.getValue() != null) {
    try {
      Profile profile=profileChoiceBox.getSelectionModel().getSelectedItem();
      if (path == null) {
        path=shootingService.createPath();
      }
      profileService.setActiveProfile(profile.getId());
      Shooting shouting=new Shooting(0,profile.getId(),path,bgPath,true);
      path="String_Node_Str";
      shootingService.addShooting(shouting);
      boolean test=true;
      try {
        boolean camerasFitPosition=imageProcessingManager.checkImageProcessing(profile);
        if (camerasFitPosition) {
          imageProcessingManager.initImageProcessing();
          test=false;
        }
      }
 catch (      ServiceException e) {
        LOGGER.debug("String_Node_Str",e);
      }
 finally {
        if (test) {
          showInformationDialog("String_Node_Str");
        }
        windowManager.showScene(WindowManager.SHOW_CUSTOMERSCENE);
      }
    }
 catch (    ServiceException serviceExeption) {
      LOGGER.error("String_Node_Str",serviceExeption);
      showInformationDialog("String_Node_Str");
    }
  }
 else {
    showInformationDialog("String_Node_Str");
  }
}
Program: 77843
Project: 77843
Buggy source:
/** 
 * This method loads the OpenCVLibrary from the Ressource Lib folder
 * @throws LibraryLoadingException if the operating System is not supported
 */
public void loadLibrary() throws LibraryLoadingException {
  if (!isLoaded) {
    try {
      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
      isLoaded=true;
      LOGGER.info("String_Node_Str",Core.NATIVE_LIBRARY_NAME);
    }
 catch (    UnsatisfiedLinkError e) {
      LOGGER.info("String_Node_Str");
      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 LibraryLoadingException("String_Node_Str");
      }
      String dest=System.getProperty("String_Node_Str") + "String_Node_Str" + lib;
      FileTransfer ft=new FileTransfer();
      try {
        ft.transfer("String_Node_Str" + lib,dest,false);
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e1);
        throw new LibraryLoadingException(e1);
      }
      System.load(dest);
      isLoaded=true;
      LOGGER.info("String_Node_Str",operatingSystem,dest);
    }
  }
}

Fixed version (ground truth):
/** 
 * This method loads the OpenCVLibrary from the Ressource Lib folder
 * @throws LibraryLoadingException if the operating System is not supported
 */
public void loadLibrary() throws LibraryLoadingException {
  if (!isLoaded) {
    try {
      isLoaded=true;
      LOGGER.info("String_Node_Str",Core.NATIVE_LIBRARY_NAME);
    }
 catch (    UnsatisfiedLinkError e) {
      LOGGER.info("String_Node_Str");
      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 LibraryLoadingException("String_Node_Str");
      }
      String dest=System.getProperty("String_Node_Str") + "String_Node_Str" + lib;
      FileTransfer ft=new FileTransfer();
      try {
        ft.transfer("String_Node_Str" + lib,dest,false);
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e1);
        throw new LibraryLoadingException(e1);
      }
      isLoaded=true;
      LOGGER.info("String_Node_Str",operatingSystem,dest);
    }
  }
}
Program: 77844
Project: 77844
Buggy source:
@Override public Camera exists(Camera camera) throws PersistenceException {
  PreparedStatement stmt=null;
  String query="String_Node_Str";
  Camera ret=null;
  try {
    stmt=con.prepareStatement(query);
    stmt.setString(2,camera.getModel());
    ResultSet rs=stmt.executeQuery();
    if (rs.next()) {
      ret=new Camera(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getString("String_Node_Str"),rs.getString("String_Node_Str"),rs.getString("String_Node_Str"));
    }
  }
 catch (  SQLException e) {
    LOGGER.error("String_Node_Str",e);
    throw new PersistenceException(e.getMessage());
  }
catch (  NullPointerException e) {
    LOGGER.error("String_Node_Str",e);
    throw new IllegalArgumentException();
  }
 finally {
    if (stmt != null) {
      try {
        stmt.close();
      }
 catch (      SQLException e) {
        LOGGER.debug("String_Node_Str",e);
      }
    }
  }
  return ret;
}

Fixed version (ground truth):
@Override public Camera exists(Camera camera) throws PersistenceException {
  PreparedStatement stmt=null;
  String query="String_Node_Str";
  Camera ret=null;
  try {
    stmt=con.prepareStatement(query);
    stmt.setString(1,camera.getModel());
    ResultSet rs=stmt.executeQuery();
    if (rs.next()) {
      ret=new Camera(rs.getInt("String_Node_Str"),rs.getString("String_Node_Str"),rs.getString("String_Node_Str"),rs.getString("String_Node_Str"),rs.getString("String_Node_Str"));
    }
  }
 catch (  SQLException e) {
    LOGGER.error("String_Node_Str",e);
    throw new PersistenceException(e.getMessage());
  }
catch (  NullPointerException e) {
    LOGGER.error("String_Node_Str",e);
    throw new IllegalArgumentException();
  }
 finally {
    if (stmt != null) {
      try {
        stmt.close();
      }
 catch (      SQLException e) {
        LOGGER.debug("String_Node_Str",e);
      }
    }
  }
  return ret;
}
Program: 77845
Project: 77845
Buggy source:
/** 
 * sets the delete desicion scene
 * @param imageView image view of the image that should be deleted
 */
public void showDeleteScene(boolean scene,javafx.scene.image.Image imageView){
  if (scene) {
    deleteImageController.setdeleteImage(true,imageView);
  }
 else {
    deleteImageController.setdeleteImage(false,imageView);
  }
  mainStage.setScene(deleteScene);
  mainStage.setFullScreen(true);
}

Fixed version (ground truth):
/** 
 * sets the delete desicion scene todo 
 * @param imageView image view of the image that should be deleted
 */
public void showDeleteScene(boolean scene,javafx.scene.image.Image imageView){
  if (scene) {
    deleteImageController.setdeleteImage(true,imageView);
  }
 else {
    deleteImageController.setdeleteImage(false,imageView);
  }
  mainStage.setScene(deleteScene);
  mainStage.setFullScreen(true);
}
Program: 77846
Project: 77846
Buggy source:
/** 
 * to be called from delete scene
 */
public void showFullscreenImage(boolean decison){
  mainStage.setScene(pictureFullScene);
  mainStage.setFullScreen(true);
  pictureController.shouldBeDeleted(decison);
}

Fixed version (ground truth):
/** 
 * to be called from delete scene TODO
 */
public void showFullscreenImage(boolean decison){
  mainStage.setScene(pictureFullScene);
  mainStage.setFullScreen(true);
  pictureController.shouldBeDeleted(decison);
}
Program: 77847
Project: 77847
Buggy source:
/** 
 * if cropping then stop cropping else closes full screen and opens miniatur sceen again before doing so it sets currentIndex to -1 to overcome possible null pointer exeptions
 */
@FXML public void onClosePressed(){
  if (cropping) {
    cropping=false;
    cropRectangle.setVisible(false);
    resizeHandleNW.setVisible(false);
    resizeHandleSE.setVisible(false);
    cropRectangle=null;
    resizeHandleSE=null;
    resizeHandleNW=null;
  }
  windowManager.showScene(WindowManager.SHOW_MINIATURESCENE);
}

Fixed version (ground truth):
/** 
 * if cropping then stop cropping else closes full screen and opens miniatur sceen again before doing so it sets currentIndex to -1 to overcome possible null pointer exeptions
 */
@FXML public void onClosePressed(){
  if (cropping == true) {
    cropping=false;
    cropRectangle.setVisible(false);
    resizeHandleNW.setVisible(false);
    resizeHandleSE.setVisible(false);
    cropRectangle=null;
    resizeHandleSE=null;
    resizeHandleNW=null;
  }
  windowManager.showScene(WindowManager.SHOW_MINIATURESCENE);
}
Program: 77848
Project: 77848
Buggy source:
/** 
 * This method loads the OpenCVLibrary from the Ressource Lib folder
 * @throws LibraryLoadingException if the operating System is not supported
 */
public void loadLibrary() throws LibraryLoadingException {
  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");
      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 LibraryLoadingException("String_Node_Str");
      }
      String dest=System.getProperty("String_Node_Str") + "String_Node_Str" + lib;
      FileTransfer ft=new FileTransfer();
      try {
        ft.transfer("String_Node_Str" + lib,dest,false);
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e1);
        throw new LibraryLoadingException(e1);
      }
      System.load(dest);
      isLoaded=true;
      LOGGER.info("String_Node_Str",operatingSystem,dest);
    }
  }
}

Fixed version (ground truth):
/** 
 * This method loads the OpenCVLibrary from the Ressource Lib folder
 * @throws LibraryLoadingException if the operating System is not supported
 */
public void loadLibrary() throws LibraryLoadingException {
  if (!isLoaded) {
    try {
      System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
      isLoaded=true;
      LOGGER.info("String_Node_Str",Core.NATIVE_LIBRARY_NAME);
    }
 catch (    UnsatisfiedLinkError e) {
      LOGGER.info("String_Node_Str");
      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 LibraryLoadingException("String_Node_Str");
      }
      String dest=System.getProperty("String_Node_Str") + "String_Node_Str" + lib;
      FileTransfer ft=new FileTransfer();
      try {
        ft.transfer("String_Node_Str" + lib,dest,false);
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e1);
        throw new LibraryLoadingException(e1);
      }
      System.load(dest);
      isLoaded=true;
      LOGGER.info("String_Node_Str",operatingSystem,dest);
    }
  }
}
Program: 77849
Project: 77849
Buggy source:
/** 
 * goes back to costumer frame
 */
public void onBackbuttonpressed(){
  wm.showScene(WindowManager.SHOW_CUSTOMERSCENE);
}

Fixed version (ground truth):
/** 
 * goes back to customer frame
 */
public void onBackbuttonpressed(){
  wm.showScene(WindowManager.SHOW_CUSTOMERSCENE);
}
Program: 77851
Project: 77851
Buggy source:
@Override public void run(){
  createTempDir();
  while (!shouldStop) {
    if (takeImage) {
      if (countdown != 0) {
        shotFrameController.showCountdown(countdown);
      }
      captureImage();
      if (serieShot) {
        for (int i=0; i < 5; i++) {
          captureImage();
        }
      }
      takeImage=false;
    }
 else {
      capturePreview();
    }
    if (shouldStop) {
      try {
        cameraGphoto.close();
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
      LOGGER.debug("String_Node_Str",camera);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  createTempDir();
  while (!shouldStop) {
    if (takeImage) {
      if (countdown != 0) {
        shotFrameController.showCountdown(countdown);
      }
      captureImage();
      takeImage=false;
    }
 else {
      capturePreview();
    }
    if (shouldStop) {
      try {
        cameraGphoto.close();
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
      LOGGER.debug("String_Node_Str",camera);
    }
  }
}
Program: 77852
Project: 77852
Buggy source:
/** 
 * if cropping then stop cropping else closes full screen and opens miniatur sceen again before doing so it sets currentIndex to -1 to overcome possible null pointer exeptions
 */
@FXML public void onClosePressed(){
  if (cropping) {
    cropping=false;
    image3.setVisible(true);
    image4.setVisible(true);
    button1.setVisible(true);
    button11.setVisible(true);
    button12.setVisible(true);
    button5.setCancelButton(true);
    button6.setCancelButton(true);
    button7.setCancelButton(true);
    button8.setCancelButton(true);
    button9.setCancelButton(true);
    button13.setVisible(false);
    cropRectangle.setVisible(false);
    resizeHandleNW.setVisible(false);
    resizeHandleSE.setVisible(false);
  }
 else {
    windowManager.showScene(WindowManager.SHOW_MINIATURESCENE);
  }
}

Fixed version (ground truth):
/** 
 * if cropping then stop cropping else closes full screen and opens miniatur sceen again before doing so it sets currentIndex to -1 to overcome possible null pointer exeptions
 */
@FXML public void onClosePressed(){
  if (cropping) {
    cropping=false;
    cropRectangle.setVisible(false);
    resizeHandleNW.setVisible(false);
    resizeHandleSE.setVisible(false);
    cropRectangle=null;
    resizeHandleSE=null;
    resizeHandleNW=null;
  }
  windowManager.showScene(WindowManager.SHOW_MINIATURESCENE);
}
Program: 77855
Project: 77855
Buggy source:
/** 
 * decides if something has chanced and adapts chances
 */
public void refresh(){
  try {
    if (!miniLastVisit) {
      isRefreshed=true;
      if (filterChouseside) {
        basicpane.getChildren().remove(grid);
        grid=new GridPane();
        gridpanel=new GridPane();
        creatButtons();
      }
      filterChouseside=false;
    }
    if (profileservice.getActiveProfile().getPairCameraPositions().isEmpty() || profileservice.getActiveProfile().getPairCameraPositions().size() == 0) {
      rightbutton.setVisible(false);
    }
    miniLastVisit=false;
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * decides if something has chanced and adapts chances
 */
public void refresh(){
  try {
    if (!miniLastVisit) {
      isRefreshed=true;
      if (filterChouseside) {
        basicpane.getChildren().remove(grid);
        grid=new GridPane();
        creatButtons();
      }
      filterChouseside=false;
    }
    if (profileservice.getActiveProfile().getPairCameraPositions().isEmpty() || profileservice.getActiveProfile().getPairCameraPositions().size() == 0) {
      rightbutton.setVisible(false);
    }
    miniLastVisit=false;
  }
 catch (  ServiceException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 77857
Project: 77857
Buggy source:
/** 
 * if cropping then stop cropping else closes full screen and opens miniatur sceen again before doing so it sets currentIndex to -1 to overcome possible null pointer exeptions
 */
@FXML public void onClosePressed(){
  if (cropping == true) {
    cropping=false;
    cropRectangle.setVisible(false);
    resizeHandleNW.setVisible(false);
    resizeHandleSE.setVisible(false);
    cropRectangle=null;
    resizeHandleSE=null;
    resizeHandleNW=null;
  }
  windowManager.showScene(WindowManager.SHOW_MINIATURESCENE);
}

Fixed version (ground truth):
/** 
 * if cropping then stop cropping else closes full screen and opens miniatur sceen again before doing so it sets currentIndex to -1 to overcome possible null pointer exeptions
 */
@FXML public void onClosePressed(){
  if (cropping) {
    cropping=false;
    cropRectangle.setVisible(false);
    resizeHandleNW.setVisible(false);
    resizeHandleSE.setVisible(false);
    cropRectangle=null;
    resizeHandleSE=null;
    resizeHandleNW=null;
  }
  windowManager.showScene(WindowManager.SHOW_MINIATURESCENE);
}
Program: 77858
Project: 77858
Buggy source:
private void captureImage(){
  Image image;
  try {
    final CameraFile cf=cameraGphoto.captureImage();
    if (cf != null) {
      Shooting activeShooting=shootingService.searchIsActive();
      if (activeShooting != null) {
        int imageID=imageService.getNextImageID();
        String directoryPath=activeShooting.getStorageDir() + "String_Node_Str";
        DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
        Date date=new Date();
        String imagePath=directoryPath + "String_Node_Str" + camera.getId()+ "String_Node_Str"+ dateFormat.format(date)+ "String_Node_Str";
        image=new Image(imageID,imagePath,activeShooting.getId(),new Date());
        image=imageService.create(image);
        cf.save(new File(imagePath).getAbsolutePath());
        imageProcessor.processShot(image);
        LOGGER.debug(imageService.getLastImgPath(activeShooting.getId()));
      }
 else {
        LOGGER.error("String_Node_Str");
      }
      cf.close();
    }
  }
 catch (  CameraException ex) {
    LOGGER.error("String_Node_Str",ex);
    setStop(true);
  }
catch (  ServiceException ex) {
    LOGGER.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
private void captureImage(){
  Image image;
  int anz=1;
  List<Image> imageList=new ArrayList<>();
  if (serieShot) {
    anz=5;
  }
  try {
    final CameraFile cf=cameraGphoto.captureImage();
    if (cf != null) {
      Shooting activeShooting=shootingService.searchIsActive();
      if (activeShooting != null) {
        for (int i=0; i < anz; i++) {
          int imageID=imageService.getNextImageID();
          String directoryPath=activeShooting.getStorageDir() + "String_Node_Str";
          DateFormat dateFormat=new SimpleDateFormat("String_Node_Str");
          Date date=new Date();
          String imagePath=directoryPath + "String_Node_Str" + camera.getId()+ "String_Node_Str"+ dateFormat.format(date)+ "String_Node_Str";
          image=new Image(imageID,imagePath,activeShooting.getId(),new Date());
          image=imageService.create(image);
          cf.save(new File(imagePath).getAbsolutePath());
          imageList.add(image);
          LOGGER.debug(imageService.getLastImgPath(activeShooting.getId()));
        }
        for (        Image shot : imageList) {
          imageProcessor.processShot(shot);
          sleep(5000);
        }
      }
 else {
        LOGGER.error("String_Node_Str");
      }
      cf.close();
    }
  }
 catch (  CameraException ex) {
    LOGGER.error("String_Node_Str",ex);
    setStop(true);
  }
catch (  ServiceException|InterruptedException ex) {
    LOGGER.error("String_Node_Str",ex);
  }
}
Program: 77859
Project: 77859
Buggy source:
public void onCropPressed(){
  cropping=true;
  saveFilteredButton.setVisible(true);
  LOGGER.debug("String_Node_Str");
  if (cropRectangle == null) {
    cropRectangle=createDraggableRectangle(forCropping.getWidth() - 400,forCropping.getHeight() - 400,100,100);
    forCropping.getChildren().add(cropRectangle);
  }
 else {
    cropRectangle.setVisible(true);
    resizeHandleNW.setVisible(true);
    resizeHandleSE.setVisible(true);
  }
}

Fixed version (ground truth):
public void onCropPressed(){
  cropping=true;
  saveFilteredButton.setVisible(true);
  LOGGER.debug("String_Node_Str");
  if (cropRectangle == null) {
    cropRectangle=createDraggableRectangle((forCropping.getWidth() / 2) - 200,(forCropping.getHeight() / 2) - 300,400,600);
    forCropping.getChildren().add(cropRectangle);
  }
 else   if (cropRectangle.isVisible()) {
    cropRectangle.setVisible(false);
    resizeHandleNW.setVisible(false);
    resizeHandleSE.setVisible(false);
    saveFilteredButton.setVisible(false);
  }
 else {
    cropRectangle.setVisible(true);
    resizeHandleNW.setVisible(true);
    resizeHandleSE.setVisible(true);
  }
}
Program: 77860
Project: 77860
Buggy source:
@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 dao.createAndSave(img,bufCropped);
  }
 catch (  IOException|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 dao.createAndSave(img,bufCropped);
  }
 catch (  IOException|PersistenceException e) {
    LOGGER.error("String_Node_Str",e);
    throw new ServiceException(e.getMessage());
  }
}
Program: 77861
Project: 77861
Buggy source:
/** 
 * This method loads the OpenCVLibrary from the Ressource Lib folder
 * @throws LibraryLoadingException if the operating System is not supported
 */
public void loadLibrary() throws LibraryLoadingException {
  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);
      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 LibraryLoadingException("String_Node_Str");
      }
      String dest=System.getProperty("String_Node_Str") + "String_Node_Str" + lib;
      FileTransfer ft=new FileTransfer();
      try {
        ft.transfer("String_Node_Str" + lib,dest,false);
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e1);
        throw new LibraryLoadingException(e1);
      }
      System.load(dest);
      isLoaded=true;
      LOGGER.info("String_Node_Str",operatingSystem,dest);
    }
  }
}

Fixed version (ground truth):
/** 
 * This method loads the OpenCVLibrary from the Ressource Lib folder
 * @throws LibraryLoadingException if the operating System is not supported
 */
public void loadLibrary() throws LibraryLoadingException {
  if (!isLoaded) {
    try {
      isLoaded=true;
      LOGGER.info("String_Node_Str",Core.NATIVE_LIBRARY_NAME);
    }
 catch (    UnsatisfiedLinkError e) {
      LOGGER.error("String_Node_Str",e);
      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 LibraryLoadingException("String_Node_Str");
      }
      String dest=System.getProperty("String_Node_Str") + "String_Node_Str" + lib;
      FileTransfer ft=new FileTransfer();
      try {
        ft.transfer("String_Node_Str" + lib,dest,false);
      }
 catch (      IOException e1) {
        LOGGER.error("String_Node_Str",e1);
        throw new LibraryLoadingException(e1);
      }
      isLoaded=true;
      LOGGER.info("String_Node_Str",operatingSystem,dest);
    }
  }
}
Program: 77863
Project: 77863
Buggy source:
@FXML private void initialize(){
  try {
    leftbutton.setVisible(false);
    if (shootingservice.searchIsActive().getActive()) {
      profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
    }
    if (profile != null && !profile.isGreenscreenEnabled() && !profile.isFilerEnabled()) {
      rightbutton.setVisible(false);
      filterList=filterservice.getAllFilteredImages(System.getProperty("String_Node_Str") + "String_Node_Str");
    }
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
    LOGGER.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@FXML private void initialize(){
  try {
    leftbutton.setVisible(false);
    if (shootingservice.searchIsActive().getActive()) {
      profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
    }
    if (profile != null && !profile.isGreenscreenEnabled() && !profile.isFilerEnabled()) {
      rightbutton.setVisible(false);
    }
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 77864
Project: 77864
Buggy source:
/** 
 * on time image pressed
 */
public void onTimerPressed(){
  unmark();
  profile.getPairCameraPositions().get(index).setShotType(Profile.PairCameraPosition.SHOT_TYPE_TIMED);
  ontime.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
  singel.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
  currentMode=2;
}

Fixed version (ground truth):
/** 
 * on time image pressed
 */
public void onTimerPressed(){
  unmark();
  profile.getPairCameraPositions().get(index).setShotType(Profile.PairCameraPosition.SHOT_TYPE_TIMED);
  ontime.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
  currentMode=2;
}
Program: 77865
Project: 77865
Buggy source:
/** 
 * unmarks the old model so the new model can be marked
 */
private void unmark(){
  try {
    int i=currentMode;
switch (i) {
case 0:
      singel.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
    break;
case 1:
  serien.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
break;
case 2:
ontime.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
singel.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
break;
}
}
 catch (NullPointerException n) {
LOGGER.error("String_Node_Str",n);
}
}

Fixed version (ground truth):
/** 
 * unmarks the old model so the new model can be marked
 */
private void unmark(){
  try {
    int i=currentMode;
switch (i) {
case 0:
      singel.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
    break;
case 1:
  serien.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
break;
case 2:
ontime.setBorder(new Border(new BorderStroke(javafx.scene.paint.Paint.valueOf("String_Node_Str"),BorderStrokeStyle.SOLID,CornerRadii.EMPTY,new BorderWidths(1))));
break;
}
}
 catch (NullPointerException n) {
LOGGER.error("String_Node_Str",n);
}
}
Program: 77866
Project: 77866
Buggy source:
/** 
 * Checks if there is an active shooting and sets visibility and contents of buttons and labels accordingly.
 * @throws ServiceException if an error occurs while retrieving the active shooting from the service layer.
 */
private void setButtons() throws ServiceException {
  Shooting activeShooting=shootingService.searchIsActive();
  if (activeShooting != null && activeShooting.getActive()) {
    startButton.setVisible(false);
    stopButton.setVisible(true);
    storage.setVisible(false);
    canclebutton.setText("String_Node_Str");
    storageDirLabel.setVisible(false);
    gridSave.setVisible(false);
    finallsavingplace.setText(activeShooting.getStorageDir());
    finallsavingplace.setVisible(true);
    save1.setVisible(true);
    saveing.setVisible(false);
    if (activeShooting.getBgPictureFolder() != null && !activeShooting.getBgPictureFolder().isEmpty()) {
      bgStorageDirLabel.setText(activeShooting.getBgPictureFolder());
    }
  }
 else {
    stopButton.setVisible(false);
    startButton.setVisible(true);
    storage.setVisible(true);
    storageDirLabel.setVisible(true);
    gridSave.setVisible(true);
    canclebutton.setText("String_Node_Str");
    finallsavingplace.setVisible(false);
    save1.setVisible(false);
    saveing.setVisible(true);
  }
}

Fixed version (ground truth):
/** 
 * Checks if there is an active shooting and sets visibility and contents of buttons and labels accordingly.
 * @throws ServiceException if an error occurs while retrieving the active shooting from the service layer.
 */
private void setButtons() throws ServiceException {
  Shooting activeShooting=shootingService.searchIsActive();
  if (activeShooting != null && activeShooting.getActive()) {
    startButton.setVisible(false);
    stopButton.setVisible(true);
    storage.setVisible(false);
    canclebutton.setText("String_Node_Str");
    storageDirLabel.setVisible(true);
    storageDirLabel.setText("String_Node_Str" + activeShooting.getStorageDir());
    gridSave.setVisible(false);
    finallsavingplace.setText(activeShooting.getStorageDir());
    finallsavingplace.setVisible(true);
    save1.setVisible(true);
    saveing.setVisible(false);
    if (activeShooting.getBgPictureFolder() != null && !activeShooting.getBgPictureFolder().isEmpty()) {
      bgStorageDirLabel.setText(activeShooting.getBgPictureFolder());
    }
  }
 else {
    stopButton.setVisible(false);
    startButton.setVisible(true);
    storage.setVisible(true);
    storageDirLabel.setVisible(true);
    String userHome=System.getProperty("String_Node_Str");
    Path storagepath=Paths.get(userHome + "String_Node_Str");
    storageDirLabel.setText(storagepath.toString());
    gridSave.setVisible(true);
    canclebutton.setText("String_Node_Str");
    finallsavingplace.setVisible(false);
    save1.setVisible(false);
    saveing.setVisible(true);
  }
}