nus-yam/ex-repair huggingface dataset:
Program: 33576
Project: 33576
Buggy source:
/** 
 * Create the query input part.
 * @param queryData the query data.
 * @throws UnsupportedException if any operation is not supported.
 * @throws ExecutionException in any error happens.
 */
private void createInputQuery(ConnectorQueryData queryData) throws UnsupportedException, ExecutionException {
  querySb.append("String_Node_Str");
  String streamName=StreamUtil.createStreamName(queryData.getProjection());
  querySb.append(streamName);
  if (queryData.hasFilterList()) {
    createConditionList(queryData);
  }
}

Fixed version (ground truth):
/** 
 * Create the query input part.
 * @param queryData the query data.
 * @throws ExecutionValidationException if any operation is not supported.
 * @throws ExecutionException in any error happens.
 */
private void createInputQuery(ConnectorQueryData queryData) throws ExecutionValidationException, ExecutionException {
  querySb.append("String_Node_Str");
  String streamName=StreamUtil.createStreamName(queryData.getProjection());
  querySb.append(streamName);
  if (queryData.hasFilterList()) {
    createConditionList(queryData);
  }
}
Program: 33577
Project: 33577
Buggy source:
/** 
 * Turn a crossdata operator into a shiddhi operator.
 * @param operator the crossdata operator.
 * @return a the siddhi operator.
 * @throws UnsupportedException if any operation is not supported.
 */
private String getSiddhiOperator(Operator operator) throws UnsupportedException {
  String siddhiOperator;
switch (operator) {
case DISTINCT:
    siddhiOperator="String_Node_Str";
  break;
case EQ:
siddhiOperator="String_Node_Str";
break;
case GET:
siddhiOperator="String_Node_Str";
break;
case GT:
siddhiOperator="String_Node_Str";
break;
case LET:
siddhiOperator="String_Node_Str";
break;
case LT:
siddhiOperator="String_Node_Str";
break;
default :
throw new UnsupportedException("String_Node_Str" + operator.toString() + "String_Node_Str");
}
return siddhiOperator;
}

Fixed version (ground truth):
/** 
 * Turn a crossdata operator into a shiddhi operator.
 * @param operator the crossdata operator.
 * @return a the siddhi operator.
 * @throws ExecutionValidationException if any operation is not supported.
 */
private String getSiddhiOperator(Operator operator) throws ExecutionValidationException {
  String siddhiOperator;
switch (operator) {
case DISTINCT:
    siddhiOperator="String_Node_Str";
  break;
case EQ:
siddhiOperator="String_Node_Str";
break;
case GET:
siddhiOperator="String_Node_Str";
break;
case GT:
siddhiOperator="String_Node_Str";
break;
case LET:
siddhiOperator="String_Node_Str";
break;
case LT:
siddhiOperator="String_Node_Str";
break;
default :
throw new ExecutionValidationException("String_Node_Str" + operator.toString() + "String_Node_Str");
}
return siddhiOperator;
}
Program: 33578
Project: 33578
Buggy source:
/** 
 * Create the query projection part.
 * @param queryData the query data.
 * @throws UnsupportedException if any operation is not supported.
 */
private void createProjection(ConnectorQueryData queryData) throws UnsupportedException {
  Select selectionClause=queryData.getSelect();
  Map<ColumnName,String> aliasMapping=selectionClause.getColumnMap();
  Set<ColumnName> columnMetadataList=aliasMapping.keySet();
  if (columnMetadataList == null || columnMetadataList.isEmpty()) {
    String message="String_Node_Str";
    logger.error(message);
    throw new UnsupportedException(message);
  }
  querySb.append("String_Node_Str");
  int numFields=columnMetadataList.size();
  int i=0;
  for (  ColumnName colName : columnMetadataList) {
    querySb.append(StreamUtil.createStreamName(queryData.getProjection())).append("String_Node_Str").append(colName.getName()).append("String_Node_Str").append(aliasMapping.get(colName));
    if (++i < numFields) {
      querySb.append("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Create the query projection part.
 * @param queryData the query data.
 * @throws ExecutionValidationException if any operation is not supported.
 */
private void createProjection(ConnectorQueryData queryData) throws ExecutionValidationException {
  Select selectionClause=queryData.getSelect();
  Map<ColumnName,String> aliasMapping=selectionClause.getColumnMap();
  Set<ColumnName> columnMetadataList=aliasMapping.keySet();
  if (columnMetadataList == null || columnMetadataList.isEmpty()) {
    String message="String_Node_Str";
    logger.error(message);
    throw new ExecutionValidationException(message);
  }
  querySb.append("String_Node_Str");
  int numFields=columnMetadataList.size();
  int i=0;
  for (  ColumnName colName : columnMetadataList) {
    querySb.append(StreamUtil.createStreamName(queryData.getProjection())).append("String_Node_Str").append(colName.getName()).append("String_Node_Str").append(aliasMapping.get(colName));
    if (++i < numFields) {
      querySb.append("String_Node_Str");
    }
  }
}
Program: 33579
Project: 33579
Buggy source:
/** 
 * Constructor.
 * @param credentials the credentials.
 * @param config The cluster configuration.
 * @throws ConnectionException
 * @throws StratioEngineConnectionException if an connections error happens.
 */
public StreamingConnection(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  if (credentials != null) {
    throw new ConnectionException("String_Node_Str");
  }
  String kafkaServer=ConnectorParser.hosts(config.getClusterOptions().get(KAFKA_SERVER))[0];
  int kafkaPort=Integer.parseInt(ConnectorParser.ports(config.getClusterOptions().get(KAFKA_PORT))[0]);
  String zooKeeperServer=ConnectorParser.hosts(config.getClusterOptions().get(ZOOKEEPER_SERVER))[0];
  int zooKeeperPort=Integer.parseInt(ConnectorParser.ports(config.getClusterOptions().get(ZOOKEEPER_PORT))[0]);
  stratioStreamingAPI=StratioStreamingAPIFactory.create().withServerConfig(kafkaServer,kafkaPort,zooKeeperServer,zooKeeperPort);
  try {
    stratioStreamingAPI.init();
    logger.info("String_Node_Str" + config.getName().getName() + "String_Node_Str");
    isConnected=true;
  }
 catch (  StratioEngineConnectionException e) {
    String msg="String_Node_Str" + e.getMessage();
    logger.error(msg);
    throw new ConnectionException(msg,e);
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param credentials the credentials.
 * @param config The cluster configuration.
 * @throws ConnectionException
 * @throws StratioEngineConnectionException if an connections error happens.
 */
public StreamingConnection(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  if (credentials != null) {
    final String msg="String_Node_Str";
    logger.error(msg);
    throw new ConnectionException(msg);
  }
  String[] kafkaServer=ConnectorParser.hosts(config.getClusterOptions().get(KAFKA_SERVER));
  String[] kafkaPort=ConnectorParser.ports(config.getClusterOptions().get(KAFKA_PORT));
  String[] zooKeeperServer=ConnectorParser.hosts(config.getClusterOptions().get(ZOOKEEPER_SERVER));
  String[] zooKeeperPort=ConnectorParser.ports(config.getClusterOptions().get(ZOOKEEPER_PORT));
  if (kafkaServer.length != kafkaPort.length || zooKeeperServer.length != zooKeeperPort.length) {
    final String msg="String_Node_Str";
    logger.error(msg);
    throw new ConnectionException(msg);
  }
  String kafkaQuorum=StreamUtil.getStreamingAddressFormat(kafkaServer,kafkaPort);
  String zookeeperQuorum=StreamUtil.getStreamingAddressFormat(zooKeeperServer,zooKeeperPort);
  stratioStreamingAPI=StratioStreamingAPIFactory.create().withServerConfig(kafkaQuorum,zookeeperQuorum);
  try {
    stratioStreamingAPI.init();
    logger.info("String_Node_Str" + config.getName().getName() + "String_Node_Str");
    isConnected=true;
  }
 catch (  StratioEngineConnectionException e) {
    String msg="String_Node_Str" + e.getMessage();
    logger.error(msg);
    throw new ConnectionException(msg,e);
  }
}
Program: 33580
Project: 33580
Buggy source:
@Test public void apiStreamingTest() throws ConnectorException, StratioEngineConnectionException {
  StratioStreamingAPI stratioStreamingAPI=(StratioStreamingAPI)StratioStreamingAPIFactory.create().withServerConfig("String_Node_Str",9092,"String_Node_Str",2182).init();
  waitSeconds(5);
  stratioStreamingAPI.close();
  waitSeconds(5);
  StratioStreamingAPI stratioStreamingAPI2=(StratioStreamingAPI)StratioStreamingAPIFactory.create().withServerConfig("String_Node_Str",9092,"String_Node_Str",2181).init();
  waitSeconds(5);
  stratioStreamingAPI2.close();
  assertTrue(true);
}

Fixed version (ground truth):
@Test public void apiStreamingTest() throws ConnectorException, StratioEngineConnectionException {
  StratioStreamingAPI stratioStreamingAPI=(StratioStreamingAPI)StratioStreamingAPIFactory.create().withServerConfig("String_Node_Str",9092,"String_Node_Str",2181).init();
  waitSeconds(5);
  stratioStreamingAPI.close();
  waitSeconds(5);
  StratioStreamingAPI stratioStreamingAPI2=(StratioStreamingAPI)StratioStreamingAPIFactory.create().withServerConfig("String_Node_Str",9092,"String_Node_Str",2181).init();
  waitSeconds(5);
  stratioStreamingAPI2.close();
  assertTrue(true);
}
Program: 33581
Project: 33581
Buggy source:
/** 
 * Return the DataStore Name.
 * @return DataStore Name
 */
@Override public String[] getDatastoreName(){
  return datastoreName;
}

Fixed version (ground truth):
/** 
 * Return the DataStore Name.
 * @return DataStore Name
 */
@Override public String[] getDatastoreName(){
  return datastoreName.clone();
}
Program: 33582
Project: 33582
Buggy source:
public void attachShutDownHook(){
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      try {
        shutdown();
      }
 catch (      ExecutionException e) {
        logger.error("String_Node_Str");
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Attach shut down hook.
 */
public void attachShutDownHook(){
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      try {
        shutdown();
      }
 catch (      ExecutionException e) {
        logger.error("String_Node_Str");
      }
    }
  }
);
}
Program: 33583
Project: 33583
Buggy source:
@Override public IConnector getConnector(){
  return new StreamingConnector();
}

Fixed version (ground truth):
@Override public IConnector getConnector(){
  try {
    return new StreamingConnector();
  }
 catch (  InitializationException e) {
    Assert.fail("String_Node_Str");
    return null;
  }
}
Program: 33584
Project: 33584
Buggy source:
/** 
 * Get the related   {@link Operations} to the given {@link Operator}
 * @param operator Relation operator
 * @return Operation related to the operator
 */
public static Operations retrieveFilterOperation(Operator operator,boolean indexed){
  Operations operation=null;
switch (operator) {
case EQ:
    operation=indexed ? Operations.FILTER_INDEXED_EQ : Operations.FILTER_NON_INDEXED_EQ;
  break;
case GET:
operation=indexed ? Operations.FILTER_INDEXED_GET : Operations.FILTER_NON_INDEXED_GET;
break;
case GT:
operation=indexed ? Operations.FILTER_INDEXED_GT : Operations.FILTER_NON_INDEXED_GT;
break;
case LET:
operation=indexed ? Operations.FILTER_INDEXED_LET : Operations.FILTER_NON_INDEXED_LET;
break;
case LT:
operation=indexed ? Operations.FILTER_INDEXED_LT : Operations.FILTER_NON_INDEXED_LT;
break;
case DISTINCT:
operation=indexed ? Operations.FILTER_INDEXED_DISTINCT : Operations.FILTER_NON_INDEXED_DISTINCT;
break;
case MATCH:
operation=Operations.FILTER_INDEXED_MATCH;
break;
default :
break;
}
return operation;
}

Fixed version (ground truth):
/** 
 * Get the related   {@link Operations} to the given {@link Operator}
 * @param operator Relation operator
 * @return Operation related to the operator
 */
public static Set<Operations> retrieveFilterOperation(Operator operator,boolean indexed){
  Set<Operations> operations=new HashSet<>();
switch (operator) {
case EQ:
    if (indexed)     operations.add(Operations.FILTER_INDEXED_EQ);
 else     operations.add(Operations.FILTER_NON_INDEXED_EQ);
  break;
case GET:
if (indexed) operations.add(Operations.FILTER_INDEXED_GET);
 else operations.add(Operations.FILTER_NON_INDEXED_GET);
break;
case GT:
if (indexed) operations.add(Operations.FILTER_INDEXED_GT);
 else operations.add(Operations.FILTER_NON_INDEXED_GT);
break;
case LET:
if (indexed) operations.add(Operations.FILTER_INDEXED_LET);
 else operations.add(Operations.FILTER_NON_INDEXED_LET);
break;
case LT:
if (indexed) operations.add(Operations.FILTER_INDEXED_LT);
 else operations.add(Operations.FILTER_NON_INDEXED_LT);
break;
case DISTINCT:
if (indexed) operations.add(Operations.FILTER_INDEXED_DISTINCT);
 else operations.add(Operations.FILTER_NON_INDEXED_DISTINCT);
break;
case MATCH:
operations.add(Operations.FILTER_INDEXED_MATCH);
break;
default :
break;
}
return operations;
}
Program: 33585
Project: 33585
Buggy source:
public static Filter createFilter(String catalogName,String tableName,String columnName,Operator operator,Long data,boolean indexed){
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(catalogName,tableName,columnName));
  IntegerSelector rightSelector=new IntegerSelector(data.toString());
  Relation relation=new Relation(leftSelector,operator,rightSelector);
  Filter filter=new Filter(retrieveFilterOperation(operator,indexed),relation);
  return filter;
}

Fixed version (ground truth):
public static Filter createFilter(String catalogName,String tableName,String columnName,Operator operator,Long data,boolean indexed){
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(catalogName,tableName,columnName));
  IntegerSelector rightSelector=new IntegerSelector(data.toString());
  return new Filter(retrieveFilterOperation(operator,indexed),new Relation(leftSelector,operator,rightSelector));
}
Program: 33586
Project: 33586
Buggy source:
public static Project createProject(String clusterName,String catalogName,String tableName,List<String> columnList){
  List<ColumnName> columns=new ArrayList<>();
  for (  String column : columnList) {
    columns.add(new ColumnName(catalogName,tableName,column));
  }
  TableName table=new TableName(catalogName,tableName);
  Project project=new Project(Operations.PROJECT,table,new ClusterName(clusterName),columns);
  return project;
}

Fixed version (ground truth):
public static Project createProject(String clusterName,String catalogName,String tableName,List<String> columnList){
  List<ColumnName> columns=new ArrayList<>();
  for (  String column : columnList) {
    columns.add(new ColumnName(catalogName,tableName,column));
  }
  TableName table=new TableName(catalogName,tableName);
  HashSet<Operations> operations=new HashSet<>();
  operations.add(Operations.PROJECT);
  return new Project(operations,table,new ClusterName(clusterName),columns);
}
Program: 33587
Project: 33587
Buggy source:
public static Select createSelect(List<ColumnName> columnsList,List<String> aliasNamesList){
  Map<Selector,String> columnsAliases=new LinkedHashMap<>();
  Map<String,ColumnType> columnsTypes=new LinkedHashMap<>();
  Map<Selector,ColumnType> typeMapFromColumnName=new LinkedHashMap<>();
  Iterator<String> aliasesIt=aliasNamesList.iterator();
  for (  ColumnName column : columnsList) {
    ColumnSelector columnSelector=new ColumnSelector(column);
    columnsAliases.put(columnSelector,aliasesIt.next());
    columnsTypes.put(column.getQualifiedName(),new ColumnType(DataType.TEXT));
    typeMapFromColumnName.put(columnSelector,new ColumnType(DataType.TEXT));
  }
  Select select=new Select(Operations.PROJECT,columnsAliases,columnsTypes,typeMapFromColumnName);
  return select;
}

Fixed version (ground truth):
public static Select createSelect(List<ColumnName> columnsList,List<String> aliasNamesList){
  Map<Selector,String> columnsAliases=new LinkedHashMap<>();
  Map<String,ColumnType> columnsTypes=new LinkedHashMap<>();
  Map<Selector,ColumnType> typeMapFromColumnName=new LinkedHashMap<>();
  Iterator<String> aliasesIt=aliasNamesList.iterator();
  for (  ColumnName column : columnsList) {
    ColumnSelector columnSelector=new ColumnSelector(column);
    columnsAliases.put(columnSelector,aliasesIt.next());
    columnsTypes.put(column.getQualifiedName(),new ColumnType(DataType.TEXT));
    typeMapFromColumnName.put(columnSelector,new ColumnType(DataType.TEXT));
  }
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.PROJECT);
  return new Select(operations,columnsAliases,columnsTypes,typeMapFromColumnName);
}
Program: 33588
Project: 33588
Buggy source:
public static OrderBy createOrderBy(String keyspace,String table,LinkedHashMap<String,OrderDirection> orderByFields){
  OrderBy orderBy=new OrderBy(Operations.SELECT_ORDER_BY,new LinkedList<OrderByClause>());
  List<OrderByClause> previousList=orderBy.getIds();
  for (  String field : orderByFields.keySet()) {
    OrderDirection direction=orderByFields.get(field);
    previousList.add(new OrderByClause(direction,new ColumnSelector(new ColumnName(keyspace,table,field))));
  }
  orderBy.setIds(previousList);
  return orderBy;
}

Fixed version (ground truth):
public static OrderBy createOrderBy(String keyspace,String table,LinkedHashMap<String,OrderDirection> orderByFields){
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.SELECT_ORDER_BY);
  OrderBy orderBy=new OrderBy(operations,new LinkedList<OrderByClause>());
  List<OrderByClause> previousList=orderBy.getIds();
  for (  String field : orderByFields.keySet()) {
    OrderDirection direction=orderByFields.get(field);
    previousList.add(new OrderByClause(direction,new ColumnSelector(new ColumnName(keyspace,table,field))));
  }
  orderBy.setIds(previousList);
  return orderBy;
}
Program: 33589
Project: 33589
Buggy source:
public static Join createJoin(String joinId,ColumnName leftSource,ColumnName rightSource){
  ColumnSelector leftSelector=new ColumnSelector(leftSource);
  ColumnSelector rightSelector=new ColumnSelector(rightSource);
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  Join join=new Join(Operations.SELECT_INNER_JOIN,joinId);
  join.addJoinRelation(relation);
  join.addSourceIdentifier(leftSource.getTableName().getQualifiedName());
  join.addSourceIdentifier(rightSource.getTableName().getQualifiedName());
  return join;
}

Fixed version (ground truth):
public static Join createJoin(String joinId,ColumnName leftSource,ColumnName rightSource){
  ColumnSelector leftSelector=new ColumnSelector(leftSource);
  ColumnSelector rightSelector=new ColumnSelector(rightSource);
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.SELECT_INNER_JOIN);
  Join join=new Join(operations,joinId);
  join.addJoinRelation(relation);
  join.addSourceIdentifier(leftSource.getTableName().getQualifiedName());
  join.addSourceIdentifier(rightSource.getTableName().getQualifiedName());
  return join;
}
Program: 33590
Project: 33590
Buggy source:
public static Join createJoinPartialResults(String joinId,ColumnName leftSource,ColumnName rightSource,List<ColumnMetadata> columnMetadata,List<Row> rows){
  ColumnSelector leftSelector=new ColumnSelector(leftSource);
  ColumnSelector rightSelector=new ColumnSelector(rightSource);
  Relation relation=new Relation(rightSelector,Operator.EQ,leftSelector);
  Join join=new Join(Operations.SELECT_INNER_JOIN_PARTIALS_RESULTS,joinId);
  join.addJoinRelation(relation);
  join.addSourceIdentifier(leftSource.getTableName().getQualifiedName());
  join.addSourceIdentifier(rightSource.getTableName().getQualifiedName());
  PartialResults partialResults=new PartialResults(Operations.PARTIAL_RESULTS);
  ResultSet resultSet=new ResultSet();
  resultSet.setColumnMetadata(columnMetadata);
  resultSet.setRows(rows);
  partialResults.setResults(resultSet);
  join.addPreviousSteps(partialResults);
  return join;
}

Fixed version (ground truth):
public static Join createJoinPartialResults(String joinId,ColumnName leftSource,ColumnName rightSource,List<ColumnMetadata> columnMetadata,List<Row> rows){
  ColumnSelector leftSelector=new ColumnSelector(leftSource);
  ColumnSelector rightSelector=new ColumnSelector(rightSource);
  Relation relation=new Relation(rightSelector,Operator.EQ,leftSelector);
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.SELECT_INNER_JOIN_PARTIALS_RESULTS);
  Join join=new Join(operations,joinId);
  join.addJoinRelation(relation);
  join.addSourceIdentifier(leftSource.getTableName().getQualifiedName());
  join.addSourceIdentifier(rightSource.getTableName().getQualifiedName());
  Set<Operations> operations2=new HashSet<>();
  operations2.add(Operations.PARTIAL_RESULTS);
  PartialResults partialResults=new PartialResults(operations2);
  ResultSet resultSet=new ResultSet();
  resultSet.setColumnMetadata(columnMetadata);
  resultSet.setRows(rows);
  partialResults.setResults(resultSet);
  join.addPreviousSteps(partialResults);
  return join;
}
Program: 33591
Project: 33591
Buggy source:
public static GroupBy createGroupBy(List<ColumnName> columnsList){
  List<Selector> selectorsList=new LinkedList<>();
  for (  ColumnName column : columnsList) {
    ColumnSelector selector=new ColumnSelector(column);
    selectorsList.add(selector);
  }
  return new GroupBy(Operations.SELECT_GROUP_BY,selectorsList);
}

Fixed version (ground truth):
public static GroupBy createGroupBy(List<ColumnName> columnsList){
  List<Selector> selectorsList=new LinkedList<>();
  for (  ColumnName column : columnsList) {
    ColumnSelector selector=new ColumnSelector(column);
    selectorsList.add(selector);
  }
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.SELECT_GROUP_BY);
  return new GroupBy(operations,selectorsList);
}
Program: 33592
Project: 33592
Buggy source:
private Filter createFilter(){
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT));
  StringSelector rightSelector=new StringSelector(DATA_CONSTANT);
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  Filter filter=new Filter(Operations.FILTER_NON_INDEXED_EQ,relation);
  return filter;
}

Fixed version (ground truth):
private Filter createFilter(){
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT));
  StringSelector rightSelector=new StringSelector(DATA_CONSTANT);
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.FILTER_NON_INDEXED_EQ);
  return new Filter(operations,relation);
}
Program: 33593
Project: 33593
Buggy source:
private Project createProject(ClusterName clusterName,TableName tableName){
  List<ColumnName> columns=new ArrayList<>();
  columns.add(new ColumnName(CATALOG_CONSTANT,tableName.getName(),COLUMN1_CONSTANT));
  columns.add(new ColumnName(CATALOG_CONSTANT,tableName.getName(),COLUMN2_CONSTANT));
  Project project=new Project(Operations.PROJECT,tableName,clusterName,columns);
  return project;
}

Fixed version (ground truth):
private Project createProject(ClusterName clusterName,TableName tableName){
  List<ColumnName> columns=new ArrayList<>();
  columns.add(new ColumnName(CATALOG_CONSTANT,tableName.getName(),COLUMN1_CONSTANT));
  columns.add(new ColumnName(CATALOG_CONSTANT,tableName.getName(),COLUMN2_CONSTANT));
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.PROJECT);
  return new Project(operations,tableName,clusterName,columns);
}
Program: 33594
Project: 33594
Buggy source:
private Select createSelect(){
  ColumnName columnName=new ColumnName("String_Node_Str","String_Node_Str","String_Node_Str");
  ColumnSelector columnSelector=new ColumnSelector(columnName);
  columnSelector.setAlias("String_Node_Str");
  Map<Selector,String> columnsAliases=new HashMap<>();
  columnsAliases.put(columnSelector,"String_Node_Str");
  Map<String,ColumnType> columnsTypes=new HashMap<>();
  columnsTypes.put("String_Node_Str",new ColumnType(DataType.BIGINT));
  Map<Selector,ColumnType> typeMapFromColumnName=new LinkedHashMap<>();
  typeMapFromColumnName.put(columnSelector,new ColumnType(DataType.BIGINT));
  Select select=new Select(Operations.PROJECT,columnsAliases,columnsTypes,typeMapFromColumnName);
  return select;
}

Fixed version (ground truth):
private Select createSelect(){
  ColumnName columnName=new ColumnName("String_Node_Str","String_Node_Str","String_Node_Str");
  ColumnSelector columnSelector=new ColumnSelector(columnName);
  columnSelector.setAlias("String_Node_Str");
  Map<Selector,String> columnsAliases=new HashMap<>();
  columnsAliases.put(columnSelector,"String_Node_Str");
  Map<String,ColumnType> columnsTypes=new HashMap<>();
  columnsTypes.put("String_Node_Str",new ColumnType(DataType.BIGINT));
  Map<Selector,ColumnType> typeMapFromColumnName=new LinkedHashMap<>();
  typeMapFromColumnName.put(columnSelector,new ColumnType(DataType.BIGINT));
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.PROJECT);
  return new Select(operations,columnsAliases,columnsTypes,typeMapFromColumnName);
}
Program: 33595
Project: 33595
Buggy source:
private Join createJoin(String joinId,TableName leftSourceId,TableName rightSourceId){
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(leftSourceId.getCatalogName().getName(),leftSourceId.getName(),COLUMN1_CONSTANT));
  ColumnSelector rightSelector=new ColumnSelector(new ColumnName(rightSourceId.getCatalogName().getName(),rightSourceId.getName(),COLUMN1_CONSTANT));
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  Join join=new Join(Operations.SELECT_INNER_JOIN,joinId);
  join.addJoinRelation(relation);
  join.addSourceIdentifier(leftSourceId.getQualifiedName());
  join.addSourceIdentifier(rightSourceId.getQualifiedName());
  return join;
}

Fixed version (ground truth):
private Join createJoin(String joinId,TableName leftSourceId,TableName rightSourceId){
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(leftSourceId.getCatalogName().getName(),leftSourceId.getName(),COLUMN1_CONSTANT));
  ColumnSelector rightSelector=new ColumnSelector(new ColumnName(rightSourceId.getCatalogName().getName(),rightSourceId.getName(),COLUMN1_CONSTANT));
  Relation relation=new Relation(leftSelector,Operator.EQ,rightSelector);
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.SELECT_INNER_JOIN);
  Join join=new Join(operations,joinId);
  join.addJoinRelation(relation);
  join.addSourceIdentifier(leftSourceId.getQualifiedName());
  join.addSourceIdentifier(rightSourceId.getQualifiedName());
  return join;
}
Program: 33596
Project: 33596
Buggy source:
private GroupBy createGroupBy(){
  ColumnSelector selector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT));
  List<Selector> selectorsList=new ArrayList<>();
  selectorsList.add(selector);
  return new GroupBy(Operations.SELECT_GROUP_BY,selectorsList);
}

Fixed version (ground truth):
private GroupBy createGroupBy(){
  ColumnSelector selector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT));
  List<Selector> selectorsList=new ArrayList<>();
  selectorsList.add(selector);
  Set<Operations> operations=new HashSet<>();
  operations.add(Operations.SELECT_GROUP_BY);
  return new GroupBy(operations,selectorsList);
}
Program: 33597
Project: 33597
Buggy source:
@Test public void testInit() throws Exception {
  IConfiguration iconfiguration=mock(IConfiguration.class);
  deepConnector.init(iconfiguration);
  DeepConnectionHandler connectionHandler=(DeepConnectionHandler)Whitebox.getInternalState(deepConnector,"String_Node_Str");
  Object recoveredConfiguration=Whitebox.getInternalState(connectionHandler,"String_Node_Str");
  assertNull("String_Node_Str",recoveredConfiguration);
  assertNotNull("String_Node_Str",connectionHandler);
}

Fixed version (ground truth):
@Test public void testInit() throws Exception {
  IConfiguration iconfiguration=mock(IConfiguration.class);
  deepConnector.init(iconfiguration);
  DeepConnectionHandler connectionHandler=(DeepConnectionHandler)Whitebox.getInternalState(deepConnector,"String_Node_Str");
  Object recoveredConfiguration=Whitebox.getInternalState(connectionHandler,"String_Node_Str");
  assertNull("String_Node_Str",recoveredConfiguration);
  assertNotNull("String_Node_Str",connectionHandler);
  deepConnector.shutdown();
}
Program: 33598
Project: 33598
Buggy source:
private Map<String,Serializable> returnConfig(Map<String,String> clusterOptions){
  Map<String,Serializable> values=new HashMap<>();
  if (clusterOptions.get(ExtractorConstants.HOSTS) != null) {
    values.put(ExtractorConstants.HOSTS,clusterOptions.get(ExtractorConstants.HOSTS));
    String[] hosts=ConnectorParser.hosts(clusterOptions.get(ExtractorConstants.HOSTS));
    values.put(ExtractorConstants.HOST,hosts[0]);
  }
 else {
    values.put(ExtractorConstants.HOST,clusterOptions.get(ExtractorConstants.HOST));
  }
  if (clusterOptions.get(ExtractorConstants.PORTS) != null) {
    values.put(ExtractorConstants.PORTS,clusterOptions.get(ExtractorConstants.PORTS));
    String[] ports=ConnectorParser.ports(clusterOptions.get(ExtractorConstants.PORTS));
    values.put(ExtractorConstants.PORT,ports[0]);
  }
 else {
    values.put(ExtractorConstants.PORT,clusterOptions.get(ExtractorConstants.PORT));
  }
  for (  String key : clusterOptions.keySet()) {
    Serializable val=clusterOptions.get(key);
    if (key.equals(ExtractorConstants.HOSTS) || key.equals(ExtractorConstants.HOST) || key.equals(ExtractorConstants.PORTS)|| key.equals(ExtractorConstants.ES_REST_PORTS)) {
      String formatArray=clusterOptions.get(key).replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
      values.put(key,formatArray);
    }
 else {
      values.put(key,val);
    }
  }
  return values;
}

Fixed version (ground truth):
private Map<String,Serializable> returnConfig(Map<String,String> clusterOptions){
  Map<String,Serializable> values=new HashMap<>();
  if (clusterOptions.get(ExtractorConstants.HOSTS) != null) {
    values.put(ExtractorConstants.HOSTS,clusterOptions.get(ExtractorConstants.HOSTS));
    String[] hosts=ConnectorParser.hosts(clusterOptions.get(ExtractorConstants.HOSTS));
    values.put(ExtractorConstants.HOST,hosts[0]);
  }
 else {
    values.put(ExtractorConstants.HOST,clusterOptions.get(ExtractorConstants.HOST));
  }
  if (clusterOptions.get(ExtractorConstants.PORTS) != null) {
    values.put(ExtractorConstants.PORTS,clusterOptions.get(ExtractorConstants.PORTS));
    String[] ports=ConnectorParser.ports(clusterOptions.get(ExtractorConstants.PORTS));
    values.put(ExtractorConstants.PORT,ports[0]);
  }
 else {
    values.put(ExtractorConstants.PORT,clusterOptions.get(ExtractorConstants.PORT));
  }
  for (  Entry<String,String> entry : clusterOptions.entrySet()) {
    Serializable val=entry.getValue();
    if (entry.getKey().equals(ExtractorConstants.HOSTS) || entry.getKey().equals(ExtractorConstants.HOST) || entry.getKey().equals(ExtractorConstants.PORTS)|| entry.getKey().equals(ExtractorConstants.ES_REST_PORTS)) {
      String formatArray=entry.getValue().replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str");
      values.put(entry.getKey(),formatArray);
    }
 else {
      values.put(entry.getKey(),val);
    }
  }
  return values;
}
Program: 33599
Project: 33599
Buggy source:
/** 
 * Use config & Credentials to create Deep native connection.
 * @param iCredentials .
 * @param connectorClusterConfig .
 * @return DeepConnection.
 */
@Override protected Connection createNativeConnection(ICredentials iCredentials,ConnectorClusterConfig connectorClusterConfig) throws ConnectionException {
  Connection connection;
  connection=new DeepConnection(iCredentials,connectorClusterConfig);
  return connection;
}

Fixed version (ground truth):
/** 
 * Use config & Credentials to create Deep native connection.
 * @param iCredentials The credentials
 * @param connectorClusterConfig The connector cluster configuration
 * @return DeepConnection
 */
@Override protected Connection createNativeConnection(ICredentials iCredentials,ConnectorClusterConfig connectorClusterConfig) throws ConnectionException {
  Connection connection;
  connection=new DeepConnection(iCredentials,connectorClusterConfig);
  return connection;
}
Program: 33600
Project: 33600
Buggy source:
public DeepConnectionHandler(IConfiguration configuration){
  super(configuration);
}

Fixed version (ground truth):
/** 
 * Basic constructor.
 * @param configuration The configuration
 */
public DeepConnectionHandler(IConfiguration configuration){
  super(configuration);
}
Program: 33601
Project: 33601
Buggy source:
/** 
 * Init Connection.
 * @param configuration
 */
@Override public void init(IConfiguration configuration) throws InitializationException {
  this.connectionHandler=new DeepConnectionHandler(null);
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + System.getProperty("String_Node_Str"));
  logger.info("String_Node_Str" + System.getProperty("String_Node_Str"));
  String sparkMaster=connectorConfig.getString(DeepConnectorConstants.SPARK_MASTER);
  String sparkHome=connectorConfig.getString(DeepConnectorConstants.SPARK_HOME);
  List<String> sparkJars=null;
  String[] jarsArray=new String[0];
  try {
    sparkJars=connectorConfig.getConfig(DeepConnectorConstants.SPARK).getStringList(DeepConnectorConstants.SPARK_JARS);
  }
 catch (  ConfigException e) {
    logger.info("String_Node_Str");
  }
  if (sparkJars != null) {
    jarsArray=new String[sparkJars.size()];
    sparkJars.toArray(jarsArray);
  }
  logger.info("String_Node_Str" + sparkMaster);
  logger.info("String_Node_Str" + sparkHome);
  this.deepContext=new DeepSparkContext(sparkMaster,DeepConnectorConstants.DEEP_CONNECTOR_JOB_CONSTANT,sparkHome,jarsArray);
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Init Connection.
 * @param configuration
 */
@Override public void init(IConfiguration configuration) throws InitializationException {
  this.connectionHandler=new DeepConnectionHandler(null);
  LOGGER.info("String_Node_Str");
  LOGGER.info("String_Node_Str" + System.getProperty("String_Node_Str"));
  LOGGER.info("String_Node_Str" + System.getProperty("String_Node_Str"));
  String sparkMaster=connectorConfig.getString(DeepConnectorConstants.SPARK_MASTER);
  String sparkHome=connectorConfig.getString(DeepConnectorConstants.SPARK_HOME);
  List<String> sparkJars=null;
  String[] jarsArray=new String[0];
  try {
    sparkJars=connectorConfig.getConfig(DeepConnectorConstants.SPARK).getStringList(DeepConnectorConstants.SPARK_JARS);
  }
 catch (  ConfigException e) {
    LOGGER.info("String_Node_Str",e);
  }
  if (sparkJars != null) {
    jarsArray=new String[sparkJars.size()];
    sparkJars.toArray(jarsArray);
  }
  LOGGER.info("String_Node_Str" + sparkMaster);
  LOGGER.info("String_Node_Str" + sparkHome);
  this.deepContext=new DeepSparkContext(sparkMaster,DeepConnectorConstants.DEEP_CONNECTOR_JOB_CONSTANT,sparkHome,jarsArray);
  LOGGER.info("String_Node_Str");
}
Program: 33602
Project: 33602
Buggy source:
/** 
 * Check if the connection associate to the clusterName is connected  {@link com.stratio.connector.commons.connection.ConnectionHandler.isConnected}.
 * @param name {@link com.stratio.crossdata.common.data.ClusterName}.
 * @return boolean
 */
@Override public boolean isConnected(ClusterName name){
  return connectionHandler.isConnected(name.getName());
}

Fixed version (ground truth):
/** 
 * Check if the connection associate to the clusterName is connected  {@link com.stratio.connector.commons.connection.ConnectionHandler.isConnected}.
 * @param name {@link com.stratio.crossdata.common.data.ClusterName}
 * @return boolean
 */
@Override public boolean isConnected(ClusterName name){
  return connectionHandler.isConnected(name.getName());
}
Program: 33603
Project: 33603
Buggy source:
/** 
 * Main uses to asociate the connector to crossdata.
 */
public static void main(String[] args) throws InitializationException {
  DeepConnector deepConnector=new DeepConnector();
  ConnectorApp connectorApp=new ConnectorApp();
  connectorApp.startup(deepConnector);
  deepConnector.attachShutDownHook();
}

Fixed version (ground truth):
/** 
 * Main uses to associate the connector to Crossdata.
 * @param args Args
 * @throws InitializationException
 */
public static void main(String[] args) throws InitializationException {
  DeepConnector deepConnector=new DeepConnector();
  ConnectorApp connectorApp=new ConnectorApp();
  connectorApp.startup(deepConnector);
  deepConnector.attachShutDownHook();
}
Program: 33604
Project: 33604
Buggy source:
@Override public void run(){
  try {
    shutdown();
  }
 catch (  ExecutionException e) {
    logger.error("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    shutdown();
  }
 catch (  ExecutionException e) {
    LOGGER.error("String_Node_Str",e);
  }
}
Program: 33605
Project: 33605
Buggy source:
/** 
 * Run the shutdown.
 */
public void attachShutDownHook(){
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      try {
        shutdown();
      }
 catch (      ExecutionException e) {
        logger.error("String_Node_Str");
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Run the shutdown.
 */
public void attachShutDownHook(){
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      try {
        shutdown();
      }
 catch (      ExecutionException e) {
        LOGGER.error("String_Node_Str",e);
      }
    }
  }
);
}
Program: 33606
Project: 33606
Buggy source:
public DeepConnector() throws InitializationException {
  InputStream input=DeepConnector.class.getClassLoader().getResourceAsStream(CONFIGURATION_FILE_CONSTANT);
  if (input == null) {
    String message="String_Node_Str" + CONFIGURATION_FILE_CONSTANT + "String_Node_Str";
    logger.error(message);
    throw new InitializationException(message);
  }
  connectorConfig=ConfigFactory.load(CONFIGURATION_FILE_CONSTANT);
}

Fixed version (ground truth):
public DeepConnector() throws InitializationException {
  InputStream input=DeepConnector.class.getClassLoader().getResourceAsStream(CONFIGURATION_FILE_CONSTANT);
  if (input == null) {
    String message="String_Node_Str" + CONFIGURATION_FILE_CONSTANT + "String_Node_Str";
    LOGGER.error(message);
    throw new InitializationException(message);
  }
  connectorConfig=ConfigFactory.load(CONFIGURATION_FILE_CONSTANT);
}
Program: 33607
Project: 33607
Buggy source:
@Override public IMetadataEngine getMetadataEngine() throws UnsupportedException {
  throw new UnsupportedException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Unsupported method.
 * @return IMetadataEngine
 */
@Override public IMetadataEngine getMetadataEngine() throws UnsupportedException {
  throw new UnsupportedException("String_Node_Str");
}
Program: 33608
Project: 33608
Buggy source:
@Override public IQueryEngine getQueryEngine() throws UnsupportedException {
  return new DeepQueryEngine(deepContext,connectionHandler);
}

Fixed version (ground truth):
/** 
 * Return the interface to invoke queries from crossdata.
 * @return DeepQueryEngine
 */
@Override public IQueryEngine getQueryEngine() throws UnsupportedException {
  return new DeepQueryEngine(deepContext,connectionHandler);
}
Program: 33609
Project: 33609
Buggy source:
/** 
 * Connect with the config expecified associate to a clusterName {ConnectionHandler}  {@link com.stratio.connector.deep.connection.DeepConnectionHandler.createNativeConnection}.
 * @param credentials
 * @param config {@link com.stratio.crossdata.common.connector.ConnectorClusterConfig}.
 */
@Override public void connect(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  String dataSourceName=config.getDataStoreName().getName();
  String extractorImplClassName=connectorConfig.getConfig(DeepConnectorConstants.CLUSTER_PREFIX_CONSTANT).getString(dataSourceName + DeepConnectorConstants.IMPL_CLASS_SUFIX_CONSTANT);
  config.getClusterOptions().put(DeepConnectorConstants.EXTRACTOR_IMPL_CLASS,extractorImplClassName);
  if (extractorImplClassName != null && extractorImplClassName.equals(ExtractorConstants.HDFS)) {
    config.getClusterOptions().put(ExtractorConstants.FS_FILE_PATH,connectorConfig.getConfig(ExtractorConstants.HDFS).getString(ExtractorConstants.FS_FILE_PATH));
  }
  connectionHandler.createConnection(credentials,config);
}

Fixed version (ground truth):
/** 
 * Connect with the config expecified associate to a clusterName {ConnectionHandler}  {@link com.stratio.connector.deep.connection.DeepConnectionHandler.createNativeConnection}.
 * @param credentials
 * @param config {@link com.stratio.crossdata.common.connector.ConnectorClusterConfig}
 */
@Override public void connect(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  String dataSourceName=config.getDataStoreName().getName();
  String extractorImplClassName=connectorConfig.getConfig(DeepConnectorConstants.CLUSTER_PREFIX_CONSTANT).getString(dataSourceName + DeepConnectorConstants.IMPL_CLASS_SUFIX_CONSTANT);
  config.getClusterOptions().put(DeepConnectorConstants.EXTRACTOR_IMPL_CLASS,extractorImplClassName);
  if (extractorImplClassName != null && extractorImplClassName.equals(ExtractorConstants.HDFS)) {
    config.getClusterOptions().put(ExtractorConstants.FS_FILE_PATH,connectorConfig.getConfig(ExtractorConstants.HDFS).getString(ExtractorConstants.FS_FILE_PATH));
  }
  connectionHandler.createConnection(credentials,config);
}
Program: 33610
Project: 33610
Buggy source:
/** 
 * Get the column metadata in order.
 * @return A list of {@link ColumnMetadata}.
 */
@Override public List<ColumnMetadata> getColumnMetadata(){
  return columnMetadata;
}

Fixed version (ground truth):
/** 
 * Get the column metadata in order.
 * @return A list of {@link ColumnMetadata}
 */
@Override public List<ColumnMetadata> getColumnMetadata(){
  return columnMetadata;
}
Program: 33611
Project: 33611
Buggy source:
/** 
 * Set the list of rows.
 * @param rows The list.
 */
@Override public void setRows(List<Row> rows){
  this.rows=rows;
}

Fixed version (ground truth):
/** 
 * Set the list of rows.
 * @param rows The list
 */
@Override public void setRows(List<Row> rows){
  this.rows=rows;
}
Program: 33612
Project: 33612
Buggy source:
/** 
 * Get the size of the Result Set.
 * @return Size.
 */
@Override public int size(){
  return rows.size();
}

Fixed version (ground truth):
/** 
 * Get the size of the Result Set.
 * @return The size
 */
@Override public int size(){
  return rows.size();
}
Program: 33613
Project: 33613
Buggy source:
/** 
 * Set the list of column metadata.
 * @param columnMetadata A list of  {@link ColumnMetadata} in order.
 */
@Override public void setColumnMetadata(List<ColumnMetadata> columnMetadata){
  this.columnMetadata=columnMetadata;
}

Fixed version (ground truth):
/** 
 * Set the list of column metadata.
 * @param columnMetadata A list of  {@link ColumnMetadata} in order
 */
@Override public void setColumnMetadata(List<ColumnMetadata> columnMetadata){
  this.columnMetadata=columnMetadata;
}
Program: 33614
Project: 33614
Buggy source:
public DeepStorageEngine(DeepConnectionHandler connectionHandler){
  super(connectionHandler);
}

Fixed version (ground truth):
/** 
 * Basic constructor.
 * @param connectionHandler The connection handler
 */
public DeepStorageEngine(DeepConnectionHandler connectionHandler){
  super(connectionHandler);
}
Program: 33615
Project: 33615
Buggy source:
public QueryResult execute(ClusterName targetCluster,LogicalWorkflow workflow,Connection connection) throws UnsupportedException {
  throw new UnsupportedException(DeepConnectorConstants.METHOD_NOT_SUPPORTED);
}

Fixed version (ground truth):
/** 
 * Method responsible for performing a query.
 * @param targetCluster The cluster name
 * @param workflow The logical workflow
 * @param connection The connection
 * @return The Query result
 * @throws UnsupportedException
 */
public QueryResult execute(ClusterName targetCluster,LogicalWorkflow workflow,Connection connection) throws UnsupportedException {
  throw new UnsupportedException(DeepConnectorConstants.METHOD_NOT_SUPPORTED);
}
Program: 33616
Project: 33616
Buggy source:
public DeepQueryEngine(DeepSparkContext deepContext,DeepConnectionHandler deepConnectionHandler){
  super(deepConnectionHandler);
  this.deepContext=deepContext;
  this.deepConnectionHandler=deepConnectionHandler;
}

Fixed version (ground truth):
/** 
 * Basic constructor.
 * @param deepContext The Deep Context
 * @param deepConnectionHandler The connection handler
 */
public DeepQueryEngine(DeepSparkContext deepContext,DeepConnectionHandler deepConnectionHandler){
  super(deepConnectionHandler);
  this.deepContext=deepContext;
  this.deepConnectionHandler=deepConnectionHandler;
}
Program: 33617
Project: 33617
Buggy source:
/** 
 * Joins the left   {@link JavaRDD} to the right one based on the given list of relations.
 * @param leftRdd Left  {@link JavaRDD}.
 * @param rdd right  {@link JavaRDD}.
 * @param joinRelations List of relations to take into account when joining.
 * @return Joined {@link JavaRDD}.
 */
private JavaRDD<Cells> executeJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rdd,List<Relation> joinRelations){
  return QueryFilterUtils.doJoin(leftRdd,rdd,joinRelations);
}

Fixed version (ground truth):
/** 
 * Joins the left   {@link JavaRDD} to the right one based on the given list of relations.
 * @param leftRdd Left  {@link JavaRDD}.
 * @param rdd right  {@link JavaRDD}.
 * @param joinRelations List of relations to take into account when joining.
 * @return Joined {@link JavaRDD}.
 */
private JavaRDD<Cells> executeJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rdd,List<Relation> joinRelations,boolean reversed){
  return QueryFilterUtils.doJoin(leftRdd,rdd,joinRelations,reversed);
}
Program: 33619
Project: 33619
Buggy source:
static JavaRDD<Cells> doJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rightRdd,List<Relation> joinRelations){
  JavaRDD<Cells> joinedResult=null;
  List<ColumnName> leftTables=new ArrayList<>();
  List<ColumnName> rightTables=new ArrayList<>();
  for (  Relation relation : joinRelations) {
    ColumnSelector selectorRight=(ColumnSelector)relation.getRightTerm();
    ColumnSelector selectorLeft=(ColumnSelector)relation.getLeftTerm();
    if (relation.getOperator().equals(Operator.EQ)) {
      leftTables.add(selectorLeft.getName());
      rightTables.add(selectorRight.getName());
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + selectorRight.getName().getName() + "String_Node_Str"+ selectorLeft.getName().getName());
      }
    }
  }
  JavaPairRDD<List<Object>,Cells> rddLeft=leftRdd.mapToPair(new MapKeyForJoin(leftTables));
  JavaPairRDD<List<Object>,Cells> rddRight=rightRdd.mapToPair(new MapKeyForJoin(rightTables));
  if (rddLeft != null && rddRight != null) {
    JavaPairRDD<List<Object>,Tuple2<Cells,Cells>> joinRDD=rddLeft.join(rddRight);
    joinedResult=joinRDD.map(new JoinCells());
  }
  return joinedResult;
}

Fixed version (ground truth):
static JavaRDD<Cells> doJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rightRdd,List<Relation> joinRelations,boolean reversed){
  JavaRDD<Cells> joinedResult=null;
  List<ColumnName> firstTables=new ArrayList<>();
  List<ColumnName> secondTables=new ArrayList<>();
  for (  Relation relation : joinRelations) {
    ColumnSelector selectorRight=(ColumnSelector)relation.getRightTerm();
    ColumnSelector selectorLeft=(ColumnSelector)relation.getLeftTerm();
    if (relation.getOperator().equals(Operator.EQ)) {
      firstTables.add(selectorLeft.getName());
      secondTables.add(selectorRight.getName());
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + selectorRight.getName().getName() + "String_Node_Str"+ selectorLeft.getName().getName());
      }
    }
  }
  JavaPairRDD<List<Object>,Cells> rddLeft=leftRdd.mapToPair(new MapKeyForJoin(reversed ? secondTables : firstTables));
  JavaPairRDD<List<Object>,Cells> rddRight=rightRdd.mapToPair(new MapKeyForJoin(reversed ? firstTables : secondTables));
  if (rddLeft != null && rddRight != null) {
    JavaPairRDD<List<Object>,Tuple2<Cells,Cells>> joinRDD=rddLeft.join(rddRight);
    joinedResult=joinRDD.map(new JoinCells());
  }
  return joinedResult;
}