Program: 87053
Project: 87053
Buggy source:
public AccessRule editAccessRule() throws ApplicationException {
  Repository repository=(Repository)getRepositoryComboBox().getSelectedItem();
  String pathString=(String)getPathTextField().getText();
  String levelOfAccess=null;
  Group group=null;
  User user=null;
  Validator.validateNotEmptyString(ResourceUtil.getString("String_Node_Str"),pathString);
  if (getReadWriteRadioButton().isSelected()) {
    levelOfAccess=Constants.ACCESS_LEVEL_READWRITE;
  }
 else   if (getReadOnlyRadioButton().isSelected()) {
    levelOfAccess=Constants.ACCESS_LEVEL_READONLY;
  }
 else {
    levelOfAccess=Constants.ACCESS_LEVEL_DENY_ACCESS;
  }
  if (getGroupRadioButton().isSelected()) {
    group=(Group)getGroupComboBox().getSelectedItem();
    Validator.validateNotNull(ResourceUtil.getString("String_Node_Str"),group);
  }
 else   if (getUserRadioButton().isSelected()) {
    user=(User)getUserComboBox().getSelectedItem();
    Validator.validateNotNull(ResourceUtil.getString("String_Node_Str"),user);
  }
 else   if (getAllUsersRadioButton().isSelected()) {
    user=Document.addUser("String_Node_Str");
  }
  if (group != null) {
    AccessRule foundRule=Document.findGroupAccessRule(repository,pathString,group);
    if (foundRule == null || accessRule == foundRule) {
      accessRule.getPath().removeAccessRule(accessRule);
      accessRule.setPath(Document.addPath(repository,pathString));
      accessRule.getPath().addAccessRule(accessRule);
      accessRule.setGroup(group);
      accessRule.setUser(null);
      accessRule.setLevel(levelOfAccess);
    }
 else {
      throw new ApplicationException(ResourceUtil.getString("String_Node_Str"));
    }
  }
 else   if (user != null) {
    AccessRule foundRule=Document.findUserAccessRule(repository,pathString,user);
    if (foundRule == null || accessRule == foundRule) {
      accessRule.getPath().removeAccessRule(accessRule);
      accessRule.setPath(Document.addPath(repository,pathString));
      accessRule.getPath().addAccessRule(accessRule);
      accessRule.setGroup(null);
      accessRule.setUser(user);
      accessRule.setLevel(levelOfAccess);
    }
 else {
      throw new ApplicationException(ResourceUtil.getString("String_Node_Str"));
    }
  }
 else {
    throw new ApplicationException(ResourceUtil.getString("String_Node_Str"));
  }
  return accessRule;
}

Fixed version (ground truth):
public AccessRule editAccessRule() throws ApplicationException {
  Repository repository=(Repository)getRepositoryComboBox().getSelectedItem();
  String pathString=(String)getPathTextField().getText();
  String levelOfAccess=null;
  Group group=null;
  User user=null;
  Validator.validateNotEmptyString(ResourceUtil.getString("String_Node_Str"),pathString);
  if (getReadWriteRadioButton().isSelected()) {
    levelOfAccess=Constants.ACCESS_LEVEL_READWRITE;
  }
 else   if (getReadOnlyRadioButton().isSelected()) {
    levelOfAccess=Constants.ACCESS_LEVEL_READONLY;
  }
 else {
    levelOfAccess=Constants.ACCESS_LEVEL_DENY_ACCESS;
  }
  if (getGroupRadioButton().isSelected()) {
    group=(Group)getGroupComboBox().getSelectedItem();
    Validator.validateNotNull(ResourceUtil.getString("String_Node_Str"),group);
  }
 else   if (getUserRadioButton().isSelected()) {
    user=(User)getUserComboBox().getSelectedItem();
    Validator.validateNotNull(ResourceUtil.getString("String_Node_Str"),user);
  }
 else   if (getAllUsersRadioButton().isSelected()) {
    user=Document.addUser("String_Node_Str");
  }
  if (group != null) {
    AccessRule foundRule=Document.findGroupAccessRule(repository,pathString,group);
    if (foundRule == null || accessRule == foundRule) {
      accessRule.getPath().removeAccessRule(accessRule);
      accessRule.setPath(Document.addPath(repository,pathString));
      accessRule.getPath().addAccessRule(accessRule);
      accessRule.setGroup(group);
      group.addAccessRule(accessRule);
      if (accessRule.getUser() != null) {
        accessRule.getUser().removeAccessRule(accessRule);
      }
      accessRule.setUser(null);
      accessRule.setLevel(levelOfAccess);
    }
 else {
      throw new ApplicationException(ResourceUtil.getString("String_Node_Str"));
    }
  }
 else   if (user != null) {
    AccessRule foundRule=Document.findUserAccessRule(repository,pathString,user);
    if (foundRule == null || accessRule == foundRule) {
      accessRule.getPath().removeAccessRule(accessRule);
      accessRule.setPath(Document.addPath(repository,pathString));
      accessRule.getPath().addAccessRule(accessRule);
      if (accessRule.getGroup() != null) {
        accessRule.getGroup().removeAccessRule(accessRule);
      }
      accessRule.setGroup(null);
      accessRule.setUser(user);
      user.addAccessRule(accessRule);
      accessRule.setLevel(levelOfAccess);
    }
 else {
      throw new ApplicationException(ResourceUtil.getString("String_Node_Str"));
    }
  }
 else {
    throw new ApplicationException(ResourceUtil.getString("String_Node_Str"));
  }
  return accessRule;
}