Program: 122825
Project: 122825
Buggy source:
/** 
 * Added by Marvin Wang on July 12, 2012 for getting the command of SAP.
 * @param object
 * @param connectionItem
 * @param table
 * @param node
 * @return
 */
private Command getSAPCommand(IRepositoryViewObject object,ConnectionItem connectionItem,MetadataTable table,Node node){
  String value=connectionItem.getProperty().getId() + "String_Node_Str" + table.getLabel();
  if (PluginChecker.isSAPWizardPluginLoaded() && connectionItem instanceof SAPConnectionItem) {
    if (object instanceof MetadataTableRepositoryObject) {
      if (table.eContainer() instanceof SAPFunctionUnit) {
        String sapComponentName=node.getComponent().getName();
        if ("String_Node_Str".equals(sapComponentName)) {
          IElementParameter schemaParam=node.getElementParameterFromField(EParameterFieldType.SCHEMA_TYPE);
          schemaParam.getChildParameters().get(EParameterName.SCHEMA_TYPE.getName()).setValue(EmfComponent.REPOSITORY);
          RepositoryChangeMetadataCommand changeValueCmd=new RepositoryChangeMetadataCommand(node,schemaParam.getName() + "String_Node_Str" + EParameterName.REPOSITORY_SCHEMA_TYPE.getName(),value,ConvertionHelper.convert(table),null,connectionItem.getConnection());
          return changeValueCmd;
        }
 else {
          SAPFunctionUnit functionUnit=(SAPFunctionUnit)table.eContainer();
          Command sapCmd=new RepositoryChangeMetadataForSAPCommand(node,ISAPConstant.TABLE_SCHEMAS,table.getLabel(),ConvertionHelper.convert(table),functionUnit);
          return sapCmd;
        }
      }
 else {
        Command sapCmd=new RepositoryChangeMetadataForSAPCommand(node,ISAPConstant.TABLE_SCHEMAS,table.getLabel(),ConvertionHelper.convert(table));
        return sapCmd;
      }
    }
 else     if (object instanceof SAPFunctionRepositoryObject) {
      if (table.eContainer() instanceof SAPFunctionUnit) {
        String sapComponentName=node.getComponent().getName();
        if ("String_Node_Str".equals(sapComponentName)) {
          SAPFunctionUnit functionUnit=(SAPFunctionUnit)table.eContainer();
          EList<MetadataTable> children=functionUnit.getTables();
          if (children != null && children.size() > 0) {
            value=connectionItem.getProperty().getId() + "String_Node_Str" + children.get(0).getLabel();
          }
 else           value=connectionItem.getProperty().getId() + "String_Node_Str";
          IElementParameter schemaParam=node.getElementParameterFromField(EParameterFieldType.SCHEMA_TYPE);
          schemaParam.getChildParameters().get(EParameterName.SCHEMA_TYPE.getName()).setValue(EmfComponent.BUILTIN);
          return new RepositoryChangeMetadataCommand(node,schemaParam.getName() + "String_Node_Str" + EParameterName.REPOSITORY_SCHEMA_TYPE.getName(),value,ConvertionHelper.convert(table),null,connectionItem.getConnection());
        }
 else {
          SAPFunctionUnit functionUnit=(SAPFunctionUnit)table.eContainer();
          Command sapCmd=new RepositoryChangeMetadataForSAPCommand(node,ISAPConstant.TABLE_SCHEMAS,table.getLabel(),ConvertionHelper.convert(table),functionUnit);
          return sapCmd;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Added by Marvin Wang on July 12, 2012 for getting the command of SAP.
 * @param object
 * @param connectionItem
 * @param table
 * @param node
 * @return
 */
private Command getSAPCommand(IRepositoryViewObject object,ConnectionItem connectionItem,MetadataTable table,Node node){
  String value=connectionItem.getProperty().getId() + "String_Node_Str" + table.getLabel();
  if (PluginChecker.isSAPWizardPluginLoaded() && connectionItem instanceof SAPConnectionItem) {
    if (object instanceof MetadataTableRepositoryObject) {
      if (table.eContainer() instanceof SAPFunctionUnit) {
        String sapComponentName=node.getComponent().getName();
        if ("String_Node_Str".equals(sapComponentName)) {
          IElementParameter schemaParam=node.getElementParameterFromField(EParameterFieldType.SCHEMA_TYPE);
          schemaParam.getChildParameters().get(EParameterName.SCHEMA_TYPE.getName()).setValue(EmfComponent.REPOSITORY);
          RepositoryChangeMetadataCommand changeValueCmd=new RepositoryChangeMetadataCommand(node,schemaParam.getName() + "String_Node_Str" + EParameterName.REPOSITORY_SCHEMA_TYPE.getName(),value,ConvertionHelper.convert(table),null,connectionItem.getConnection());
          return changeValueCmd;
        }
 else {
          SAPFunctionUnit functionUnit=(SAPFunctionUnit)table.eContainer();
          Command sapCmd=new RepositoryChangeMetadataForSAPCommand(node,ISAPConstant.TABLE_SCHEMAS,table.getLabel(),ConvertionHelper.convert(table),functionUnit);
          return sapCmd;
        }
      }
 else {
        Command sapCmd=new RepositoryChangeMetadataForSAPCommand(node,ISAPConstant.TABLE_SCHEMAS,table.getLabel(),ConvertionHelper.convert(table));
        return sapCmd;
      }
    }
 else     if (object instanceof SAPFunctionRepositoryObject) {
      if (table.eContainer() instanceof SAPFunctionUnit) {
        String sapComponentName=node.getComponent().getName();
        if ("String_Node_Str".equals(sapComponentName)) {
          SAPFunctionUnit functionUnit=(SAPFunctionUnit)table.eContainer();
          EList<MetadataTable> children=functionUnit.getTables();
          if (children != null && children.size() > 0) {
            value=connectionItem.getProperty().getId() + "String_Node_Str" + children.get(0).getLabel();
          }
 else {
            value=connectionItem.getProperty().getId() + "String_Node_Str";
          }
          IElementParameter schemaParam=node.getElementParameterFromField(EParameterFieldType.SCHEMA_TYPE);
          schemaParam.getChildParameters().get(EParameterName.SCHEMA_TYPE.getName()).setValue(EmfComponent.BUILTIN);
          return new RepositoryChangeMetadataCommand(node,schemaParam.getName() + "String_Node_Str" + EParameterName.REPOSITORY_SCHEMA_TYPE.getName(),value,ConvertionHelper.convert(table),null,connectionItem.getConnection());
        }
 else {
          SAPFunctionUnit functionUnit=(SAPFunctionUnit)table.eContainer();
          Command sapCmd=new RepositoryChangeMetadataForSAPCommand(node,ISAPConstant.TABLE_SCHEMAS,table.getLabel(),ConvertionHelper.convert(table),functionUnit);
          return sapCmd;
        }
      }
    }
  }
  return null;
}