Program: 45104
Project: 45104
Buggy source:
/** 
 * Modifies the domain's capabilities out of the DomainInfo object.
 * @param domain a <code>DomainInfo</code> value
 * @exception PermissionException if a permission error occurs
 * @exception MailManagerException if an error occurs
 */
public void modifyDomain(DomainInfo domain) throws PermissionException, MailManagerException {
  LdapFacade ldap=null;
  String domainName=domain.getName();
  String domaindn=domainDn(domainName);
  try {
    ldap=getLdap();
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",booleanToString(domain.getCanEditAccounts()));
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",booleanToString(domain.getCanEditPostmasters()));
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",booleanToString(domain.getActive()));
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",getUnixTimeString());
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",booleanToString(domain.getDelete()));
    if (domain.getActive()) {
      hiddenAccountUpdate(ldap,domainName,true);
    }
 else {
      hiddenAccountUpdate(ldap,domainName,false);
      Iterator i=getAccounts(domainName).iterator();
      while (i.hasNext()) {
        AccountInfo ai=(AccountInfo)i.next();
        ai.setActive(false);
        modifyAccount(ai);
      }
      i=getAliases(domainName).iterator();
      while (i.hasNext()) {
        AliasInfo ali=(AliasInfo)i.next();
        ali.setActive(false);
        modifyAlias(ali);
      }
    }
  }
 catch (  NoPermissionException e) {
    throw new PermissionException("String_Node_Str" + domainName,e);
  }
catch (  NamingException e) {
    throw new MailManagerException(domainName,e);
  }
 finally {
    closeLdap(ldap);
  }
}

Fixed version (ground truth):
/** 
 * Modifies the domain's capabilities out of the DomainInfo object.
 * @param domain a <code>DomainInfo</code> value
 * @exception PermissionException if a permission error occurs
 * @exception MailManagerException if an error occurs
 */
public void modifyDomain(DomainInfo domain) throws PermissionException, MailManagerException {
  LdapFacade ldap=null;
  String domainName=domain.getName();
  String domaindn=domainDn(domainName);
  try {
    ldap=getLdap();
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",booleanToString(domain.getCanEditAccounts()));
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",booleanToString(domain.getCanEditPostmasters()));
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",booleanToString(domain.getActive()));
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",getUnixTimeString());
    ldap.modifyElementAttribute(domaindn,"String_Node_Str",booleanToString(domain.getDelete()));
    if (domain.getActive() && !domain.getDelete()) {
      hiddenAccountUpdate(ldap,domainName,true);
    }
 else {
      hiddenAccountUpdate(ldap,domainName,false);
      Iterator i=getAccounts(domainName).iterator();
      while (i.hasNext()) {
        AccountInfo ai=(AccountInfo)i.next();
        ai.setActive(false);
        modifyAccount(ai);
      }
      i=getAliases(domainName).iterator();
      while (i.hasNext()) {
        AliasInfo ali=(AliasInfo)i.next();
        ali.setActive(false);
        modifyAlias(ali);
      }
    }
  }
 catch (  NoPermissionException e) {
    throw new PermissionException("String_Node_Str" + domainName,e);
  }
catch (  NamingException e) {
    throw new MailManagerException(domainName,e);
  }
 finally {
    closeLdap(ldap);
  }
}