Program: 50617
Project: 50617
Buggy source:
@Override public ErrorCollection validate(BuildConfiguration buildConfiguration){
  boolean error=false;
  ErrorCollection errorCollection=super.validate(buildConfiguration);
  String hostame=StringUtils.trim(buildConfiguration.getString(REPOSITORY_GERRIT_REPOSITORY_HOSTNAME));
  if (!StringUtils.isNotBlank(hostame)) {
    errorCollection.addError(REPOSITORY_GERRIT_REPOSITORY_HOSTNAME,"String_Node_Str");
    error=true;
  }
  String strPort=buildConfiguration.getString(REPOSITORY_GERRIT_REPOSITORY_PORT,"String_Node_Str").trim();
  if (!StringUtils.isNotBlank(strPort)) {
    errorCollection.addError(REPOSITORY_GERRIT_REPOSITORY_PORT,"String_Node_Str");
    error=true;
  }
  String strProject=buildConfiguration.getString(REPOSITORY_GERRIT_PROJECT,"String_Node_Str").trim();
  if (!StringUtils.isNotBlank(strProject)) {
    errorCollection.addError(REPOSITORY_GERRIT_PROJECT,"String_Node_Str");
    error=true;
  }
  String username=StringUtils.trim(buildConfiguration.getString(REPOSITORY_GERRIT_USERNAME));
  if (!StringUtils.isNotBlank(username)) {
    errorCollection.addError(REPOSITORY_GERRIT_USERNAME,"String_Node_Str");
    error=true;
  }
  if (buildConfiguration.getBoolean(TEMPORARY_GERRIT_SSH_KEY_CHANGE)) {
    final Object o=buildConfiguration.getProperty(TEMPORARY_GERRIT_SSH_KEY_FROM_FILE);
    if (o == null) {
      errorCollection.addError(REPOSITORY_GERRIT_SSH_KEY,textProvider.getText("String_Node_Str"));
      error=true;
    }
  }
  String key=encrypterRef.get().decrypt(buildConfiguration.getString(REPOSITORY_GERRIT_SSH_KEY,"String_Node_Str"));
  if (!StringUtils.isNotBlank(key)) {
    errorCollection.addError(REPOSITORY_GERRIT_SSH_KEY,textProvider.getText("String_Node_Str"));
    error=true;
  }
  String strPhrase=buildConfiguration.getString(TEMPORARY_GERRIT_SSH_PASSPHRASE);
  if (buildConfiguration.getBoolean(TEMPORARY_GERRIT_SSH_PASSPHRASE_CHANGE)) {
    strPhrase=encrypterRef.get().encrypt(strPhrase);
  }
 else   if (strPhrase == null) {
    strPhrase=buildConfiguration.getString(REPOSITORY_GERRIT_SSH_PASSPHRASE,"String_Node_Str");
  }
  String keyFilePath=buildConfiguration.getString(REPOSITORY_GERRIT_SSH_KEY_FILE);
  if (!StringUtils.isNotBlank(keyFilePath)) {
    errorCollection.addError(REPOSITORY_GERRIT_SSH_KEY_FILE,"String_Node_Str");
    error=true;
  }
  if (error)   return errorCollection;
  try {
    testGerritConnection(keyFilePath,hostame,Integer.valueOf(strPort),username,strProject,strPhrase);
  }
 catch (  RepositoryException e) {
    errorCollection.addError(REPOSITORY_GERRIT_REPOSITORY_HOSTNAME,e.getMessage());
  }
  return errorCollection;
}

Fixed version (ground truth):
@Override public ErrorCollection validate(BuildConfiguration buildConfiguration){
  boolean error=false;
  ErrorCollection errorCollection=super.validate(buildConfiguration);
  String hostame=StringUtils.trim(buildConfiguration.getString(REPOSITORY_GERRIT_REPOSITORY_HOSTNAME));
  if (!StringUtils.isNotBlank(hostame)) {
    errorCollection.addError(REPOSITORY_GERRIT_REPOSITORY_HOSTNAME,"String_Node_Str");
    error=true;
  }
  String strPort=buildConfiguration.getString(REPOSITORY_GERRIT_REPOSITORY_PORT,"String_Node_Str").trim();
  if (!StringUtils.isNotBlank(strPort)) {
    errorCollection.addError(REPOSITORY_GERRIT_REPOSITORY_PORT,"String_Node_Str");
    error=true;
  }
  String strProject=buildConfiguration.getString(REPOSITORY_GERRIT_PROJECT,"String_Node_Str").trim();
  if (!StringUtils.isNotBlank(strProject)) {
    errorCollection.addError(REPOSITORY_GERRIT_PROJECT,"String_Node_Str");
    error=true;
  }
  String username=StringUtils.trim(buildConfiguration.getString(REPOSITORY_GERRIT_USERNAME));
  if (!StringUtils.isNotBlank(username)) {
    errorCollection.addError(REPOSITORY_GERRIT_USERNAME,"String_Node_Str");
    error=true;
  }
  if (buildConfiguration.getBoolean(TEMPORARY_GERRIT_SSH_KEY_CHANGE)) {
    final Object o=buildConfiguration.getProperty(TEMPORARY_GERRIT_SSH_KEY_FROM_FILE);
    if (o == null) {
      errorCollection.addError(REPOSITORY_GERRIT_SSH_KEY,textProvider.getText("String_Node_Str"));
      error=true;
    }
  }
  String key=encrypterRef.get().decrypt(buildConfiguration.getString(REPOSITORY_GERRIT_SSH_KEY,"String_Node_Str"));
  if (!StringUtils.isNotBlank(key)) {
    errorCollection.addError(REPOSITORY_GERRIT_SSH_KEY,textProvider.getText("String_Node_Str"));
    error=true;
  }
  String strPhrase=buildConfiguration.getString(TEMPORARY_GERRIT_SSH_PASSPHRASE);
  if (buildConfiguration.getBoolean(TEMPORARY_GERRIT_SSH_PASSPHRASE_CHANGE)) {
    strPhrase=encrypterRef.get().encrypt(strPhrase);
  }
 else   if (strPhrase == null) {
    strPhrase=buildConfiguration.getString(REPOSITORY_GERRIT_SSH_PASSPHRASE,"String_Node_Str");
  }
  String keyFilePath=buildConfiguration.getString(REPOSITORY_GERRIT_SSH_KEY_FILE);
  if (!StringUtils.isNotBlank(keyFilePath)) {
    errorCollection.addError(REPOSITORY_GERRIT_SSH_KEY_FILE,"String_Node_Str");
    error=true;
  }
  if (error)   return errorCollection;
  try {
    testGerritConnection(keyFilePath,key,hostame,Integer.valueOf(strPort),username,strProject,strPhrase);
  }
 catch (  RepositoryException e) {
    errorCollection.addError(REPOSITORY_GERRIT_REPOSITORY_HOSTNAME,e.getMessage());
  }
  return errorCollection;
}