Program: 77835
Project: 77835
Buggy source:
/** 
 * if right button gets pressed the controller loads the filter buttons and there  pictures
 */
public void switchToFilter(){
  try {
    if (shootingservice.searchIsActive().getActive()) {
      if (profile != null) {
        if (profile.getId() != shootingservice.searchIsActive().getProfileid()) {
          profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
          isButtoncreated=false;
          filterList.clear();
        }
      }
 else {
        profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
        isButtoncreated=false;
        filterList.clear();
      }
    }
    if (filterList.isEmpty()) {
      try {
        String filterPreviewImagePath=windowmanager.copyResource("String_Node_Str");
        filterList=filterservice.getAllFilteredImages(filterPreviewImagePath);
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
    if (profile.isFilerEnabled() || profile.isGreenscreenEnabled()) {
      rightbutton.setVisible(false);
      allpicturesview.setVisible(false);
      gridpanel.setVisible(false);
      leftbutton.setVisible(true);
      if (!isRefreshed && profileold != null && isButtoncreated && profileold.getId() == shootingservice.searchIsActive().getProfileid()) {
        loadButton();
      }
 else {
        isRefreshed=false;
        if (profile.getId() != shootingservice.searchIsActive().getProfileid()) {
          profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
        }
        profileold=profile;
        creatButtons();
      }
    }
 else {
      rightbutton.setVisible(false);
    }
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
    LOGGER.error("String_Node_Str",e);
  }
catch (  NullPointerException n) {
    LOGGER.error("String_Node_Str",n);
  }
}

Fixed version (ground truth):
/** 
 * if right button gets pressed the controller loads the filter buttons and there  pictures
 */
public void switchToFilter(){
  try {
    if (shootingservice.searchIsActive().getActive()) {
      if (profile != null) {
        if (profile.getId() != shootingservice.searchIsActive().getProfileid()) {
          profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
          isButtoncreated=false;
          filterList.clear();
        }
      }
 else {
        profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
        isButtoncreated=false;
        filterList.clear();
      }
    }
    if (filterList.isEmpty()) {
      try {
        String filterPreviewImagePath=windowmanager.copyResource("String_Node_Str");
        filterList=filterservice.getAllFilteredImages(filterPreviewImagePath);
      }
 catch (      IOException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
    if (profileservice.getActiveProfile().isFilerEnabled() || profileservice.getActiveProfile().isGreenscreenEnabled()) {
      rightbutton.setVisible(false);
      allpicturesview.setVisible(false);
      gridpanel.setVisible(false);
      leftbutton.setVisible(true);
      if (!isRefreshed && profileold != null && isButtoncreated && profileold.getId() == shootingservice.searchIsActive().getProfileid()) {
        loadButton();
      }
 else {
        isRefreshed=false;
        if (profile.getId() != shootingservice.searchIsActive().getProfileid()) {
          profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
        }
        profileold=profile;
        creatButtons();
      }
    }
 else {
      rightbutton.setVisible(false);
    }
  }
 catch (  ServiceException e) {
    showInformationDialog("String_Node_Str");
    LOGGER.error("String_Node_Str",e);
  }
catch (  NullPointerException n) {
    LOGGER.error("String_Node_Str",n);
  }
}