Program: 29772
Project: 29772
Buggy source:
/** 
 */
@Override protected int executeCommand() throws CommandException, CommandValidationException {
  try {
    DomainsManager manager=new PEDomainsManager();
    DomainConfig config=new DomainConfig(domainName,domainDir);
    manager.validateDomain(config,false);
    verifyPortBase();
  }
 catch (  DomainException e) {
    logger.fine(e.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),e);
  }
  adminUser=programOpts.getUser();
  if (!ok(adminUser)) {
    adminUser=SystemPropertyConstants.DEFAULT_ADMIN_USER;
    adminPassword=SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
  }
 else   if (noPassword) {
    adminPassword=SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
  }
 else {
    boolean haveAdminPwd=false;
    adminPassword=passwords.get(ADMIN_ADMINPASSWORD);
    if (adminPassword != null) {
      haveAdminPwd=true;
      logger.warning(strings.get("String_Node_Str"));
    }
 else {
      haveAdminPwd=passwords.get(ADMIN_PASSWORD) != null;
      adminPassword=getAdminPassword();
    }
    validatePassword(adminPassword,adminPasswordOption);
  }
  if (saveMasterPassword)   useMasterPassword=true;
  if (useMasterPassword)   masterPassword=getMasterPassword();
  if (masterPassword == null)   masterPassword=DEFAULT_MASTER_PASSWORD;
  validatePassword(masterPassword,masterPasswordOption);
  try {
    if (adminPort != null) {
      verifyPortIsValid(adminPort);
    }
    if (instancePort != null) {
      verifyPortIsValid(instancePort);
    }
    createTheDomain(domainDir,domainProperties);
  }
 catch (  CommandException ce) {
    logger.info(ce.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),ce);
  }
catch (  Exception e) {
    logger.fine(e.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),e);
  }
  return 0;
}

Fixed version (ground truth):
/** 
 */
@Override protected int executeCommand() throws CommandException, CommandValidationException {
  try {
    DomainsManager manager=new PEDomainsManager();
    DomainConfig config=new DomainConfig(domainName,domainDir);
    manager.validateDomain(config,false);
    verifyPortBase();
  }
 catch (  DomainException e) {
    logger.fine(e.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),e);
  }
  adminUser=programOpts.getUser();
  if (!ok(adminUser)) {
    adminUser=SystemPropertyConstants.DEFAULT_ADMIN_USER;
    adminPassword=SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
  }
 else   if (noPassword) {
    adminPassword=SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
  }
 else {
    boolean haveAdminPwd=false;
  }
  if (saveMasterPassword)   useMasterPassword=true;
  if (masterPassword == null)   masterPassword=DEFAULT_MASTER_PASSWORD;
  try {
    if (adminPort != null) {
      verifyPortIsValid(adminPort);
    }
    if (instancePort != null) {
      verifyPortIsValid(instancePort);
    }
    createTheDomain(domainDir,domainProperties);
  }
 catch (  CommandException ce) {
    logger.info(ce.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),ce);
  }
catch (  Exception e) {
    logger.fine(e.getLocalizedMessage());
    throw new CommandException(strings.get("String_Node_Str",domainName),e);
  }
  return 0;
}