Program: 118619
Project: 118619
Buggy source:
@Override public void undo(){
  elem.setPropertyValue(updataComponentParamName,new Boolean(true));
  if (propertyName.split("String_Node_Str")[1].equals(propertyTypeName) && (EmfComponent.BUILTIN.equals(value))) {
    for (    IElementParameter param : elem.getElementParameters()) {
      String repositoryValue=param.getRepositoryValue();
      if (param.isShow(elem.getElementParameters()) && (repositoryValue != null) && (!param.getName().equals(propertyTypeName))) {
        boolean paramFlag=JobSettingsConstants.isExtraParameter(param.getName());
        boolean extraFlag=JobSettingsConstants.isExtraParameter(propertyTypeName);
        if (paramFlag == extraFlag) {
          param.setRepositoryValueUsed(true);
        }
      }
    }
  }
 else {
    for (    IElementParameter param : elem.getElementParameters()) {
      String repositoryValue=param.getRepositoryValue();
      if (param.isShow(elem.getElementParameters()) && (repositoryValue != null)) {
        Object objectValue=RepositoryToComponentProperty.getValue(connection,repositoryValue,null);
        if (dragAndDropAction == true && connection instanceof XmlFileConnectionImpl) {
          objectValue=RepositoryToComponentProperty.getXmlAndXSDFileValue((XmlFileConnection)connection,repositoryValue);
          dragAndDropAction=false;
        }
        if (objectValue != null) {
          elem.setPropertyValue(param.getName(),oldValues.get(param.getName()));
          param.setRepositoryValueUsed(false);
        }
      }
    }
  }
  IElementParameter currentParam=elem.getElementParameter(propertyName);
  if (propertyName.split("String_Node_Str")[1].equals(propertyTypeName)) {
    if (value.equals(EmfComponent.BUILTIN)) {
      currentParam.setValue(EmfComponent.REPOSITORY);
    }
 else {
      currentParam.setValue(EmfComponent.BUILTIN);
      IElementParameter schemaParam=elem.getElementParameterFromField(EParameterFieldType.SCHEMA_TYPE,currentParam.getCategory());
      if (schemaParam != null) {
        IElementParameter schemaType=schemaParam.getChildParameters().get(EParameterName.SCHEMA_TYPE.getName());
        schemaType.setValue(EmfComponent.BUILTIN);
      }
      IElementParameter queryParam=elem.getElementParameterFromField(EParameterFieldType.QUERYSTORE_TYPE,currentParam.getCategory());
      if (queryParam != null) {
        IElementParameter queryStoreType=queryParam.getChildParameters().get(EParameterName.QUERYSTORE_TYPE.getName());
        queryStoreType.setValue(EmfComponent.BUILTIN);
      }
    }
  }
 else {
    elem.setPropertyValue(propertyName,oldMetadata);
  }
  JobSettings.switchToCurJobSettingsView();
}

Fixed version (ground truth):
@Override public void undo(){
  elem.setPropertyValue(updataComponentParamName,new Boolean(true));
  if (propertyName.split("String_Node_Str")[1].equals(propertyTypeName) && (EmfComponent.BUILTIN.equals(value))) {
    for (    IElementParameter param : elem.getElementParameters()) {
      String repositoryValue=param.getRepositoryValue();
      if (param.isShow(elem.getElementParameters()) && (repositoryValue != null) && (!param.getName().equals(propertyTypeName))) {
        boolean paramFlag=JobSettingsConstants.isExtraParameter(param.getName());
        boolean extraFlag=JobSettingsConstants.isExtraParameter(propertyTypeName);
        if (paramFlag == extraFlag) {
          param.setRepositoryValueUsed(true);
        }
      }
    }
  }
 else {
    for (    IElementParameter param : elem.getElementParameters()) {
      String repositoryValue=param.getRepositoryValue();
      if (param.isShow(elem.getElementParameters()) && (repositoryValue != null)) {
        Object objectValue=RepositoryToComponentProperty.getValue(connection,repositoryValue,null);
        if (dragAndDropAction == true && connection instanceof XmlFileConnectionImpl) {
          objectValue=RepositoryToComponentProperty.getXmlAndXSDFileValue((XmlFileConnection)connection,repositoryValue);
          dragAndDropAction=false;
        }
        if (objectValue != null) {
          elem.setPropertyValue(param.getName(),oldValues.get(param.getName()));
          param.setRepositoryValueUsed(false);
        }
      }
    }
  }
  IElementParameter currentParam=elem.getElementParameter(propertyName);
  if (propertyName.split("String_Node_Str")[1].equals(propertyTypeName)) {
    if (value.equals(EmfComponent.BUILTIN)) {
      currentParam.setValue(EmfComponent.REPOSITORY);
    }
 else {
      currentParam.setValue(EmfComponent.BUILTIN);
      IElementParameter schemaParam=elem.getElementParameterFromField(EParameterFieldType.SCHEMA_TYPE,currentParam.getCategory());
      if (schemaParam == null) {
        schemaParam=elem.getElementParameterFromField(EParameterFieldType.SCHEMA_REFERENCE,currentParam.getCategory());
      }
      if (schemaParam != null) {
        IElementParameter schemaType=schemaParam.getChildParameters().get(EParameterName.SCHEMA_TYPE.getName());
        schemaType.setValue(EmfComponent.BUILTIN);
      }
      IElementParameter queryParam=elem.getElementParameterFromField(EParameterFieldType.QUERYSTORE_TYPE,currentParam.getCategory());
      if (queryParam != null) {
        IElementParameter queryStoreType=queryParam.getChildParameters().get(EParameterName.QUERYSTORE_TYPE.getName());
        queryStoreType.setValue(EmfComponent.BUILTIN);
      }
    }
  }
 else {
    elem.setPropertyValue(propertyName,oldMetadata);
  }
  JobSettings.switchToCurJobSettingsView();
}