Program: 77854
Project: 77854
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.getId() != shootingservice.searchIsActive().getProfileid()) {
        profile=profileservice.get(shootingservice.searchIsActive().getProfileid());
        isButtoncreated=false;
        filterList.clear();
      }
    }
    if (filterList.isEmpty()) {
      filterList=filterservice.getAllFilteredImages(System.getProperty("String_Node_Str") + "String_Node_Str");
    }
    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()) {
      filterList=filterservice.getAllFilteredImages(System.getProperty("String_Node_Str") + "String_Node_Str");
    }
    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);
  }
}