Program: 47334
Project: 47334
Buggy source:
/** 
 * Set the widgets according to what is currently in the DOM.
 */
public void buildPermissionsTable(Document fileInfo){
  String userOrRoleString="String_Node_Str";
  String recipientType="String_Node_Str";
  if (usersAndRolesList.getItemCount() == 0) {
    permissionsLabel.setText(Messages.getString("String_Node_Str"));
  }
 else {
    String value=usersAndRolesList.getValue(usersAndRolesList.getSelectedIndex());
    recipientType=getRecipientTypeByValue(value);
    userOrRoleString=value.substring(0,value.length() - 6);
    permissionsLabel.setText(Messages.getString("String_Node_Str",userOrRoleString));
  }
  List<Integer> perms=getPermissionsForUserOrRole(fileInfo,userOrRoleString,recipientType);
  if ("String_Node_Str".equals(userOrRoleString)) {
    writePermissionCheckBox.setEnabled(false);
    deletePermissionCheckBox.setEnabled(false);
    managePermissionCheckBox.setEnabled(false);
  }
  if (perms.contains(PERM_ALL)) {
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,false,PERM_ALL);
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,true,PERM_GRANT_PERM);
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,true,PERM_DELETE);
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,true,PERM_WRITE);
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,true,PERM_READ);
  }
  readPermissionCheckBox.setValue(perms.contains(PERM_READ) || perms.contains(PERM_GRANT_PERM) || perms.contains(PERM_ALL));
  deletePermissionCheckBox.setValue(perms.contains(PERM_DELETE) || perms.contains(PERM_GRANT_PERM) || perms.contains(PERM_ALL));
  writePermissionCheckBox.setValue(perms.contains(PERM_WRITE) || perms.contains(PERM_GRANT_PERM) || perms.contains(PERM_ALL));
  managePermissionCheckBox.setValue(perms.contains(PERM_GRANT_PERM) || perms.contains(PERM_ALL));
  inheritsCheckBox.setValue(isInheritsAcls(fileInfo));
  refreshPermission();
  if (!isModifiableUserOrRole(fileInfo,userOrRoleString,recipientType)) {
    managePermissionCheckBox.setEnabled(false);
  }
  addButton.setEnabled(!inheritsCheckBox.getValue());
  removeButton.setEnabled(!(isOwner(userOrRoleString,USER_TYPE,fileInfo) || isOwner(userOrRoleString,ROLE_TYPE,fileInfo) || !isModifiableUserOrRole(fileInfo,userOrRoleString,recipientType)) && !inheritsCheckBox.getValue());
}

Fixed version (ground truth):
/** 
 * Set the widgets according to what is currently in the DOM.
 */
public void buildPermissionsTable(Document fileInfo){
  String userOrRoleString="String_Node_Str";
  String recipientType="String_Node_Str";
  if (usersAndRolesList.getItemCount() == 0) {
    permissionsLabel.setText(Messages.getString("String_Node_Str"));
  }
 else {
    String value=usersAndRolesList.getValue(usersAndRolesList.getSelectedIndex());
    recipientType=getRecipientTypeByValue(value);
    userOrRoleString=value.substring(0,value.length() - 6);
    permissionsLabel.setText(Messages.getString("String_Node_Str",userOrRoleString));
  }
  List<Integer> perms=getPermissionsForUserOrRole(fileInfo,userOrRoleString,recipientType);
  if ("String_Node_Str".equals(userOrRoleString)) {
    writePermissionCheckBox.setEnabled(false);
    deletePermissionCheckBox.setEnabled(false);
    managePermissionCheckBox.setEnabled(false);
  }
  if (perms.contains(PERM_ALL)) {
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,false,PERM_ALL);
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,true,PERM_GRANT_PERM);
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,true,PERM_DELETE);
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,true,PERM_WRITE);
    updatePermissionForUserOrRole(fileInfo,userOrRoleString,recipientType,true,PERM_READ);
  }
  readPermissionCheckBox.setValue(perms.contains(PERM_READ) || perms.contains(PERM_GRANT_PERM) || perms.contains(PERM_ALL));
  deletePermissionCheckBox.setValue(perms.contains(PERM_DELETE) || perms.contains(PERM_GRANT_PERM) || perms.contains(PERM_ALL));
  writePermissionCheckBox.setValue(perms.contains(PERM_WRITE) || perms.contains(PERM_GRANT_PERM) || perms.contains(PERM_ALL));
  managePermissionCheckBox.setValue(perms.contains(PERM_GRANT_PERM) || perms.contains(PERM_ALL));
  inheritsCheckBox.setValue(isInheritsAcls(fileInfo));
  refreshPermission();
  if (!isModifiableUserOrRole(fileInfo,userOrRoleString,recipientType)) {
    managePermissionCheckBox.setEnabled(false);
  }
}