Program: 77978
Project: 77978
Buggy source:
/** 
 * desides whether an new fiter imge is chousen or green screen
 * @param index current mode
 * @param idFilter current filter id
 * @param greenscreen boolean green screen or not
 */
public void currentlychousen(int index,int idFilter,boolean greenscreen){
  this.index=index;
  LOGGER.debug("String_Node_Str" + index);
  fId=idFilter;
  titel.setText("String_Node_Str");
  try {
    if (profile == null) {
      profile=profileservice.get(shootingService.searchIsActive().getProfileid());
    }
    if (profile != profileservice.get(shootingService.searchIsActive().getProfileid())) {
      profile=profileservice.get(shootingService.searchIsActive().getProfileid());
      currentMode=new Integer[profile.getPairCameraPositions().size()];
    }
    if (!first) {
      firstVisit();
    }
    if (currentMode[this.index] == null) {
      currentMode[this.index]=1;
    }
switch (currentMode[this.index]) {
case 0:
      singel.setStyle("String_Node_Str");
    break;
case 1:
  serien.setStyle("String_Node_Str");
break;
case 2:
ontime.setStyle("String_Node_Str");
singel.setStyle("String_Node_Str");
break;
}
if (greenscreen) {
titel=new Label("String_Node_Str" + profileservice.getAllPairCameraPositionOfProfile().get(index).getCamera().getId() + "String_Node_Str");
creatGreenscreenButton();
}
 else {
if (buttonList.isEmpty()) {
titel=new Label("String_Node_Str" + profileservice.getAllPairCameraPositionOfProfile().get(index).getCamera().getId() + "String_Node_Str");
creatButtons();
}
 else {
titel=new Label("String_Node_Str" + profileservice.getAllPairCameraPositionOfProfile().get(index).getCamera().getId() + "String_Node_Str");
loadButton();
}
}
}
 catch (ServiceException e) {
LOGGER.debug("String_Node_Str",e);
}
}

Fixed version (ground truth):
/** 
 * desides whether an new fiter imge is chousen or green screen
 * @param index current mode
 * @param idFilter current filter id
 * @param greenscreen boolean green screen or not
 */
public void currentlychousen(int index,int idFilter,boolean greenscreen){
  this.index=index;
  fId=idFilter;
  titel.setText("String_Node_Str");
  LOGGER.debug("String_Node_Str" + index + "String_Node_Str"+ currentMode.length);
  try {
    if (index > -1) {
      if (profile == null) {
        profile=profileservice.get(shootingService.searchIsActive().getProfileid());
      }
      if (!first) {
        firstVisit();
        currentMode[this.index]=1;
        singel.setStyle("String_Node_Str");
      }
      if (profile != profileservice.get(shootingService.searchIsActive().getProfileid())) {
        profile=profileservice.get(shootingService.searchIsActive().getProfileid());
        currentMode=new Integer[profile.getPairCameraPositions().size()];
        currentMode[this.index]=1;
      }
switch (currentMode[this.index]) {
case 0:
        singel.setStyle("String_Node_Str");
      break;
case 1:
    serien.setStyle("String_Node_Str");
  break;
case 2:
ontime.setStyle("String_Node_Str");
singel.setStyle("String_Node_Str");
break;
}
if (greenscreen) {
titel=new Label("String_Node_Str" + profileservice.getAllPairCameraPositionOfProfile().get(index).getCamera().getId() + "String_Node_Str");
creatGreenscreenButton();
}
 else {
if (buttonList.isEmpty()) {
titel=new Label("String_Node_Str" + profileservice.getAllPairCameraPositionOfProfile().get(index).getCamera().getId() + "String_Node_Str");
creatButtons();
}
 else {
titel=new Label("String_Node_Str" + profileservice.getAllPairCameraPositionOfProfile().get(index).getCamera().getId() + "String_Node_Str");
loadButton();
}
}
}
}
 catch (ServiceException e) {
LOGGER.debug("String_Node_Str",e);
}
}