Program: 126371
Project: 126371
Buggy source:
@Override public void execute(){
  if (node == null) {
    return;
  }
  IElementParameter elementParameter=node.getElementParameter(ISAPConstant.SAP_FUNCTION);
  if (elementParameter != null && functionUnit != null) {
    elementParameter.setValue(TalendQuoteUtils.addQuotes(functionUnit.getName()));
  }
  IElementParameter schemasTableParam=node.getElementParameter(ISAPConstant.TABLE_SCHEMAS);
  if (schemasTableParam != null) {
    List<Map<String,Object>> paramValues=(List<Map<String,Object>>)schemasTableParam.getValue();
    if (paramValues == null) {
      paramValues=new ArrayList<Map<String,Object>>();
      schemasTableParam.setValue(paramValues);
    }
    if (newMetadatTable != null) {
      createNewSchema(paramValues,newMetadatTable,MetadataSchemaType.OUTPUT.name());
    }
 else {
      if (functionUnit != null) {
        EList<MetadataTable> tables=functionUnit.getTables();
        for (        MetadataTable table : tables) {
          createNewSchema(paramValues,ConvertionHelper.convert(table),MetadataSchemaType.OUTPUT.name());
        }
      }
    }
  }
  IElementParameter inputTableParam=node.getElementParameter(ISAPConstant.MAPPING_INPUT);
  if (inputTableParam != null) {
    List<Map<String,Object>> paramValues=(List<Map<String,Object>>)inputTableParam.getValue();
    if (paramValues == null) {
      paramValues=new ArrayList<Map<String,Object>>();
      inputTableParam.setValue(paramValues);
    }
    if (newMetadatTable != null) {
      createNewSchema(paramValues,newMetadatTable,MetadataSchemaType.INPUT.name());
    }
 else {
      if (functionUnit != null) {
        EList<MetadataTable> tables=functionUnit.getInputTables();
        for (        MetadataTable table : tables) {
          createNewSchema(paramValues,ConvertionHelper.convert(table),MetadataSchemaType.INPUT.name());
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void execute(){
  if (node == null) {
    return;
  }
  IElementParameter elementParameter=node.getElementParameter(ISAPConstant.SAP_FUNCTION);
  if (elementParameter != null && functionUnit != null) {
    elementParameter.setValue(TalendQuoteUtils.addQuotes(functionUnit.getName()));
  }
  IElementParameter schemasTableParam=node.getElementParameter(ISAPConstant.TABLE_SCHEMAS);
  if (schemasTableParam != null) {
    List<Map<String,Object>> paramValues=(List<Map<String,Object>>)schemasTableParam.getValue();
    if (paramValues == null) {
      paramValues=new ArrayList<Map<String,Object>>();
      schemasTableParam.setValue(paramValues);
    }
    if (newMetadatTable != null) {
      createNewSchema(paramValues,newMetadatTable,MetadataSchemaType.OUTPUT.name());
    }
 else {
      if (functionUnit != null) {
        EList<MetadataTable> tables=functionUnit.getTables();
        for (        MetadataTable table : tables) {
          createNewSchema(paramValues,ConvertionHelper.convert(table),MetadataSchemaType.OUTPUT.name());
        }
      }
    }
  }
  IElementParameter inputTableParam=node.getElementParameter(ISAPConstant.MAPPING_INPUT);
  if (inputTableParam != null) {
    List<Map<String,Object>> paramValues=(List<Map<String,Object>>)inputTableParam.getValue();
    if (paramValues == null) {
      paramValues=new ArrayList<Map<String,Object>>();
      inputTableParam.setValue(paramValues);
    }
    if (newMetadatTable != null) {
      Map<String,String> properties=newMetadatTable.getAdditionalProperties();
      if (properties != null) {
        properties.put(ISINPUT,TRUE);
      }
      createNewSchema(paramValues,newMetadatTable,MetadataSchemaType.INPUT.name());
    }
 else {
      if (functionUnit != null) {
        EList<MetadataTable> tables=functionUnit.getInputTables();
        for (        MetadataTable table : tables) {
          EMap<String,String> properties=table.getAdditionalProperties();
          if (properties != null) {
            properties.put(ISINPUT,TRUE);
          }
          createNewSchema(paramValues,ConvertionHelper.convert(table),MetadataSchemaType.INPUT.name());
        }
      }
    }
  }
}