nus-yam/ex-repair huggingface dataset:
Program: 33667
Project: 33667
Buggy source:
/** 
 * @param clusterName
 * @return
 * @throws ExecutionException
 */
private ExtractorConfig<Cells> retrieveConfiguration(ClusterName clusterName) throws ExecutionException {
  DeepConnection deepConnection=null;
  try {
    deepConnection=(DeepConnection)deepConnectionHandler.getConnection(clusterName.getName());
  }
 catch (  HandlerConnectionException ex) {
    throw new ExecutionException("String_Node_Str" + clusterName.toString() + "String_Node_Str",ex);
  }
  ExtractorConfig<Cells> extractorConfig=null;
  if (deepConnection != null) {
    extractorConfig=deepConnection.getExtractorConfig();
  }
 else {
    throw new ExecutionException("String_Node_Str" + clusterName.toString() + "String_Node_Str");
  }
  return extractorConfig;
}

Fixed version (ground truth):
/** 
 * @param clusterName
 * @return
 * @throws ExecutionException
 */
private ExtractorConfig<Cells> retrieveConfiguration(ClusterName clusterName) throws ExecutionException {
  DeepConnection deepConnection=null;
  try {
    deepConnection=(DeepConnection)deepConnectionHandler.getConnection(clusterName.getName());
  }
 catch (  HandlerConnectionException ex) {
    throw new ExecutionException("String_Node_Str" + clusterName.toString() + "String_Node_Str",ex);
  }
  ExtractorConfig<Cells> extractorConfig=null;
  if (deepConnection != null) {
    extractorConfig=deepConnection.getExtractorConfig().clone();
  }
 else {
    throw new ExecutionException("String_Node_Str" + clusterName.toString() + "String_Node_Str");
  }
  return extractorConfig;
}
Program: 33668
Project: 33668
Buggy source:
@Override public Tuple2<List<Object>,Cells> call(Cells cells){
  List<Object> cellsValues=new LinkedList<>();
  for (  ColumnName columnKey : keys) {
    String tableName=columnKey.getTableName().getName();
    Cell cell=cells.getCellByName(tableName,columnKey.getName());
    cellsValues.add(cell.getCellValue());
  }
  return new Tuple2<>(cellsValues,cells);
}

Fixed version (ground truth):
@Override public Tuple2<List<Object>,Cells> call(Cells cells){
  List<Object> cellsValues=new LinkedList<>();
  for (  ColumnName columnKey : keys) {
    String tableName=columnKey.getTableName().getQualifiedName();
    Cell cell=cells.getCellByName(tableName,columnKey.getName());
    cellsValues.add(cell.getCellValue());
  }
  return new Tuple2<>(cellsValues,cells);
}
Program: 33669
Project: 33669
Buggy source:
@Override public QueryResult executeWorkFlow(LogicalWorkflow workflow) throws UnsupportedException, ExecutionException {
  List<LogicalStep> initialSteps=workflow.getInitialSteps();
  JavaRDD<Cells> partialResultRdd=null;
  for (  LogicalStep initialStep : initialSteps) {
    Project project=(Project)initialStep;
    ExtractorConfig<Cells> extractorConfig=retrieveConfiguration(project.getClusterName());
    JavaRDD<Cells> initialRdd=createRDD(project,extractorConfig);
    partialResultRdd=executeInitialStep(initialStep.getNextStep(),initialRdd,project.getTableName().toString());
  }
  return buildQueryResult(partialResultRdd,(Select)workflow.getLastStep());
}

Fixed version (ground truth):
@Override public QueryResult executeWorkFlow(LogicalWorkflow workflow) throws UnsupportedException, ExecutionException {
  QueryExecutor executor=new QueryExecutor(deepContext,deepConnectionHandler);
  return executor.executeWorkFlow(workflow);
}
Program: 33670
Project: 33670
Buggy source:
/** 
 * @param filterStep
 * @param rdd
 * @throws UnsupportedException
 */
private void executeFilter(Filter filterStep,JavaRDD<Cells> rdd) throws ExecutionException, UnsupportedException {
  Relation relation=filterStep.getRelation();
  if (relation.getOperator().isInGroup(Operator.Group.COMPARATOR)) {
    QueryFilterUtils.doWhere(rdd,relation);
  }
 else {
    throw new ExecutionException("String_Node_Str" + filterStep.getRelation().getOperator().toString() + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @param filterStep
 * @param rdd
 * @throws UnsupportedException
 */
private void executeFilter(Filter filterStep,JavaRDD<Cells> rdd) throws ExecutionException, UnsupportedException {
  Relation relation=filterStep.getRelation();
  if (relation.getOperator().isInGroup(Operator.Group.COMPARATOR)) {
    SelectTerms selectTerms=filterFromWhereRelation(relation);
    QueryFilterUtils.doWhere(rdd,selectTerms);
  }
 else {
    throw new ExecutionException("String_Node_Str" + filterStep.getRelation().getOperator().toString() + "String_Node_Str");
  }
}
Program: 33671
Project: 33671
Buggy source:
/** 
 * Build JavaRDD<Cells> from list of Cells and select Columns.
 * @param rdd Cells RDD
 * @param selectedCols Set of fields selected in the SelectStatement.
 * @return JavaRDD<Cells>
 */
static JavaRDD<Cells> filterSelectedColumns(JavaRDD<Cells> rdd,final Set<ColumnName> selectedCols){
  return rdd.map(new Function<Cells,Cells>(){
    private static final long serialVersionUID=-5704730871386839898L;
    @Override public Cells call(    Cells cells) throws Exception {
      Cells cellsOut=new Cells();
      for (      ColumnName columnName : selectedCols) {
        Cell cell=cells.getCellByName(columnName.getTableName().getQualifiedName(),columnName.getName());
        cellsOut.add(cell);
      }
      return cellsOut;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Build JavaRDD<Cells> from list of Cells and select Columns.
 * @param rdd Cells RDD
 * @param selectedCols Set of fields selected in the SelectStatement.
 * @return JavaRDD<Cells>
 */
static JavaRDD<Cells> filterSelectedColumns(JavaRDD<Cells> rdd,final Set<ColumnName> selectedCols){
  List<ColumnName> list=new ArrayList<>(selectedCols);
  JavaRDD<Cells> rddResult=rdd.map(new FilterColumns(list));
  return rddResult;
}
Program: 33672
Project: 33672
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());
      logger.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){
  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());
      logger.debug("String_Node_Str" + selectorRight.getName().getName() + "String_Node_Str"+ selectorLeft.getName().getName());
    }
  }
  JavaPairRDD<List<Object>,Cells> rddLeft=leftRdd.mapToPair(new MapKeyForJoin(leftTables));
  List<Tuple2<List<Object>,Cells>> t=rddLeft.collect();
  JavaPairRDD<List<Object>,Cells> rddRight=rightRdd.mapToPair(new MapKeyForJoin(rightTables));
  List<Tuple2<List<Object>,Cells>> t2=rddRight.collect();
  if (rddLeft != null && rddRight != null) {
    JavaPairRDD<List<Object>,Tuple2<Cells,Cells>> joinRDD=rddLeft.join(rddRight);
    joinedResult=joinRDD.map(new JoinCells());
  }
  return joinedResult;
}
Program: 33673
Project: 33673
Buggy source:
@Test public void doWhereTest() throws UnsupportedException {
  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);
  JavaRDD<Cells> rdd=QueryFilterUtils.doWhere(leftRdd,relation);
  logger.info("String_Node_Str" + rdd.first().toString());
  rdd.collect();
  assertEquals(true,true);
}

Fixed version (ground truth):
@Test public void doWhereTest() throws UnsupportedException {
  ColumnSelector leftSelector=new ColumnSelector(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT));
  String rightSelector=new String(DATA_CONSTANT);
  SelectTerms selectTerms=new SelectTerms(leftSelector.getName().getName(),Operator.EQ.toString(),rightSelector);
  JavaRDD<Cells> rdd=QueryFilterUtils.doWhere(leftRdd,selectTerms);
  logger.info("String_Node_Str" + rdd.first().toString());
  rdd.collect();
}
Program: 33674
Project: 33674
Buggy source:
@Test public void filterSelectedColumns(){
  Map<ColumnName,String> columnsAliases=new HashMap<>();
  columnsAliases.put(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT),"String_Node_Str");
  Map<String,ColumnType> columnsTypes=new HashMap<>();
  columnsTypes.put("String_Node_Str",ColumnType.TEXT);
  Select select=new Select(Operations.SELECT_OPERATOR,columnsAliases,columnsTypes);
  JavaRDD<Cells> rdd=QueryFilterUtils.filterSelectedColumns(leftRdd,columnsAliases.keySet());
  logger.info("String_Node_Str" + rdd.first().toString());
  rdd.collect();
  assertEquals(true,true);
}

Fixed version (ground truth):
@Test public void filterSelectedColumns(){
  Map<ColumnName,String> columnsAliases=new HashMap<>();
  columnsAliases.put(new ColumnName(CATALOG_CONSTANT,TABLE1_CONSTANT.getName(),COLUMN1_CONSTANT),"String_Node_Str");
  List<Cells> cells=leftRdd.collect();
  JavaRDD<Cells> rdd=QueryFilterUtils.filterSelectedColumns(leftRdd,columnsAliases.keySet());
  logger.info("String_Node_Str" + rdd.first().toString());
  rdd.collect();
  assertEquals(true,true);
}
Program: 33676
Project: 33676
Buggy source:
/** 
 * Constructor.
 * @param credentials the credentials.
 * @param config The cluster configuration.
 */
public DeepConnection(ICredentials credentials,ConnectorClusterConfig config){
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getOptions();
  ExtractorConfig<Cells> extractorconfig=new ExtractorConfig<>(Cells.class);
  Map<String,Serializable> values=new HashMap<String,Serializable>();
  values.put(ExtractorConnectConstants.PORT,clusterOptions.get(ExtractorConnectConstants.PORT));
  String[] hosts=clusterOptions.get(ExtractorConnectConstants.HOSTS).substring(1,clusterOptions.get(ExtractorConnectConstants.HOSTS).length() - 1).split("String_Node_Str");
  values.put(ExtractorConnectConstants.HOST,hosts[0]);
  values.put(ExtractorConnectConstants.HOSTS,clusterOptions.get(ExtractorConnectConstants.HOSTS).substring(1,clusterOptions.get(ExtractorConnectConstants.HOSTS).length() - 1));
  extractorconfig.setValues(values);
  extractorConfig=extractorconfig;
  deepSparkContext=ConnectionConfiguration.getDeepContext();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param credentials the credentials.
 * @param config The cluster configuration.
 */
public DeepConnection(ICredentials credentials,ConnectorClusterConfig config){
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getOptions();
  ExtractorConfig<Cells> extractorconfig=new ExtractorConfig<>(Cells.class);
  Map<String,Serializable> values=new HashMap<>();
  if (clusterOptions.get(ExtractorConnectConstants.HOSTS) != null) {
    values.put(ExtractorConnectConstants.HOSTS,clusterOptions.get(ExtractorConnectConstants.HOSTS));
    String[] hosts=clusterOptions.get(ExtractorConnectConstants.HOSTS).substring(1,clusterOptions.get(ExtractorConnectConstants.HOSTS).length() - 1).split("String_Node_Str");
    values.put(ExtractorConnectConstants.HOST,hosts[0]);
  }
 else {
    values.put(ExtractorConnectConstants.HOST,clusterOptions.get(ExtractorConnectConstants.HOST));
  }
  if (clusterOptions.get(ExtractorConnectConstants.PORTS) != null) {
    values.put(ExtractorConnectConstants.PORTS,clusterOptions.get(ExtractorConnectConstants.PORTS));
    String[] ports=clusterOptions.get(ExtractorConnectConstants.PORTS).substring(1,clusterOptions.get(ExtractorConnectConstants.PORTS).length() - 1).split("String_Node_Str");
    values.put(ExtractorConnectConstants.PORT,ports[0]);
  }
 else {
    values.put(ExtractorConnectConstants.PORT,clusterOptions.get(ExtractorConnectConstants.PORT));
  }
  values.put(ExtractorConnectConstants.CQLPORT,clusterOptions.get(ExtractorConnectConstants.CQLPORT));
  values.put(ExtractorConnectConstants.RCPPORT,clusterOptions.get(ExtractorConnectConstants.RCPPORT));
  values.put(ExtractorConnectConstants.INNERCLASS,clusterOptions.get(ExtractorConnectConstants.INNERCLASS));
  extractorconfig.setValues(values);
  extractorConfig=extractorconfig;
  deepSparkContext=ConnectionConfiguration.getDeepContext();
}
Program: 33677
Project: 33677
Buggy source:
/** 
 * Build a   {@link com.stratio.meta.common.data.CResultSetIterator} from a{@link com.stratio.meta.common.data.CassandraResultSet}.
 * @param cResultSet Cassandra Result Set.
 */
public DeepResultSetIterator(DeepResultSet deepResultSet){
  this.deepResultSet=deepResultSet;
  this.current=0;
}

Fixed version (ground truth):
/** 
 * Build a   {@link com.stratio.meta.common.data.CResultSetIterator} from a{@link com.stratio.meta.common.data.CassandraResultSet}.
 * @param deepResultSet Cassandra Result Set.
 */
public DeepResultSetIterator(DeepResultSet deepResultSet){
  this.deepResultSet=deepResultSet;
  this.current=0;
}
Program: 33678
Project: 33678
Buggy source:
@Override public Cells call(Cells cells) throws Exception {
  Cells cellsOut=new Cells();
  for (  ColumnName columnName : columns) {
    Cell cell=cells.getCellByName(columnName.getTableName().getName(),columnName.getName());
    cellsOut.add(cell);
  }
  return cellsOut;
}

Fixed version (ground truth):
@Override public Cells call(Cells cells) throws Exception {
  Cells cellsOut=new Cells(cells.getDefaultTableName());
  for (  ColumnName columnName : columns) {
    Cell cell=cells.getCellByName(columnName.getTableName().getName(),columnName.getName());
    cellsOut.add(cell);
  }
  return cellsOut;
}
Program: 33679
Project: 33679
Buggy source:
static JavaRDD<Cells> doJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rightRdd,List<Relation> joinRelations){
  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());
      System.out.println("String_Node_Str" + selectorRight.getName().getName() + "String_Node_Str"+ selectorLeft.getName().getName());
    }
  }
  JavaPairRDD<Cells,Cells> rddLeft=leftRdd.mapToPair(new MapKeyForJoin<Cells>(leftTables));
  logger.debug("String_Node_Str" + rddLeft.count());
  List<Tuple2<Cells,Cells>> lista=rddLeft.collect();
  logger.debug("String_Node_Str");
  logger.debug("String_Node_Str" + rddLeft.first()._1());
  logger.debug("String_Node_Str" + rddLeft.first()._2());
  logger.debug("String_Node_Str");
  JavaPairRDD<Cells,Cells> rddRight=rightRdd.mapToPair(new MapKeyForJoin<Cells>(rightTables));
  logger.debug("String_Node_Str" + rddRight.count());
  List<Tuple2<Cells,Cells>> lista2=rddRight.collect();
  logger.debug("String_Node_Str");
  logger.debug("String_Node_Str" + rddRight.first()._1());
  logger.debug("String_Node_Str" + rddRight.first()._2());
  logger.debug("String_Node_Str");
  JavaPairRDD<Cells,Tuple2<Cells,Cells>> joinRDD=rddLeft.join(rddRight);
  logger.debug("String_Node_Str" + joinRDD.count() + "String_Node_Str");
  JavaRDD<Cells> joinedResult=joinRDD.map(new JoinCells<Cells>());
  return joinedResult;
}

Fixed version (ground truth):
static JavaRDD<Cells> doJoin(JavaRDD<Cells> leftRdd,JavaRDD<Cells> rightRdd,List<Relation> joinRelations){
  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());
      System.out.println("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));
  JavaPairRDD<List<Object>,Tuple2<Cells,Cells>> joinRDD=rddLeft.join(rddRight);
  JavaRDD<Cells> joinedResult=joinRDD.map(new JoinCells());
  return joinedResult;
}
Program: 33680
Project: 33680
Buggy source:
@Override public Cells call(Tuple2<T,Tuple2<Cells,Cells>> result){
  Cells left=result._2()._1();
  Cells right=result._2()._2();
  Cells joinedCells=new Cells();
  for (  Cell cell : left.getCells()) {
    joinedCells.add(cell);
  }
  for (  Cell cell : right.getCells()) {
    joinedCells.add(cell);
  }
  return joinedCells;
}

Fixed version (ground truth):
@Override public Cells call(Tuple2<List<Object>,Tuple2<Cells,Cells>> result){
  Cells left=result._2()._1();
  Cells right=result._2()._2();
  Cells joinedCells=new Cells();
  for (  Cell cell : left.getCells()) {
    joinedCells.add(cell);
  }
  for (  Cell cell : right.getCells()) {
    joinedCells.add(cell);
  }
  return joinedCells;
}
Program: 33681
Project: 33681
Buggy source:
@Override public Tuple2<Cells,Cells> call(Cells cells){
  Cells cellsvalues=new Cells();
  for (  ColumnName columnKey : keys) {
    String tableName=columnKey.getTableName().getName();
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + tableName);
    System.out.println("String_Node_Str" + columnKey.getName());
    System.out.println("String_Node_Str" + cells.getCellByName(tableName,columnKey.getName()));
    System.out.println("String_Node_Str");
    cellsvalues.add(tableName,cells.getCellByName(tableName,columnKey.getName()));
  }
  return new Tuple2<>(cellsvalues,cells);
}

Fixed version (ground truth):
@Override public Tuple2<List<Object>,Cells> call(Cells cells){
  List<Object> cellsValues=new ArrayList<>();
  for (  ColumnName columnKey : keys) {
    String tableName=columnKey.getTableName().getName();
    Cell cell=cells.getCellByName(tableName,columnKey.getName());
    cellsValues.add(cell.getCellValue());
  }
  return new Tuple2<>(cellsValues,cells);
}
Program: 33682
Project: 33682
Buggy source:
/** 
 * Constructor.
 * @param credentials the credentials.
 * @param config The cluster configuration.
 */
public DeepConnection(ICredentials credentials,ConnectorClusterConfig config){
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getOptions();
  ExtractorConfig<Cells> extractorconfig=new ExtractorConfig();
  Map<String,String> values=new HashMap<String,String>();
  values.put(ExtractorConnectConstants.PORT,clusterOptions.get(ExtractorConnectConstants.PORT));
  String[] hosts=clusterOptions.get(ExtractorConnectConstants.HOSTS).substring(1,clusterOptions.get(ExtractorConnectConstants.HOSTS).length() - 1).split("String_Node_Str");
  values.put(ExtractorConnectConstants.HOST,hosts[0]);
  values.put(ExtractorConnectConstants.HOSTS,clusterOptions.get(ExtractorConnectConstants.HOSTS).substring(1,clusterOptions.get(ExtractorConnectConstants.HOSTS).length() - 1));
  extractorconfig.setValues(values);
  extractorConfig=extractorconfig;
  deepSparkContext=ConnectionConfiguration.getDeepContext();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param credentials the credentials.
 * @param config The cluster configuration.
 */
public DeepConnection(ICredentials credentials,ConnectorClusterConfig config){
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getOptions();
  ExtractorConfig<Cells> extractorconfig=new ExtractorConfig<>(Cells.class);
  Map<String,Serializable> values=new HashMap<String,Serializable>();
  values.put(ExtractorConnectConstants.PORT,clusterOptions.get(ExtractorConnectConstants.PORT));
  String[] hosts=clusterOptions.get(ExtractorConnectConstants.HOSTS).substring(1,clusterOptions.get(ExtractorConnectConstants.HOSTS).length() - 1).split("String_Node_Str");
  values.put(ExtractorConnectConstants.HOST,hosts[0]);
  values.put(ExtractorConnectConstants.HOSTS,clusterOptions.get(ExtractorConnectConstants.HOSTS).substring(1,clusterOptions.get(ExtractorConnectConstants.HOSTS).length() - 1));
  extractorconfig.setValues(values);
  extractorConfig=extractorconfig;
  deepSparkContext=ConnectionConfiguration.getDeepContext();
}
Program: 33683
Project: 33683
Buggy source:
@Test public void TwoProjectsJoinedAndSelectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project projectLeft=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Project projectRight=createProject(CLUSTERNAME_CONSTANT,TABLE2_CONSTANT);
  Join join=createJoin("String_Node_Str",TABLE1_CONSTANT.toString(),TABLE2_CONSTANT.toString());
  join.setNextStep(createSelect());
  projectLeft.setNextStep(join);
  projectRight.setNextStep(join);
  stepList.add(projectLeft);
  stepList.add(projectRight);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(2)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void TwoProjectsJoinedAndSelectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project projectLeft=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Project projectRight=createProject(CLUSTERNAME_CONSTANT,TABLE2_CONSTANT);
  Join join=createJoin("String_Node_Str",TABLE1_CONSTANT.toString(),TABLE2_CONSTANT.toString());
  join.setNextStep(createSelect());
  projectLeft.setNextStep(join);
  projectRight.setNextStep(join);
  stepList.add(projectLeft);
  stepList.add(projectRight);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.executeWorkFlow(logicalWorkflow);
  verify(deepContext,times(2)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33684
Project: 33684
Buggy source:
@Test public void simpleProjectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  stepList.add(createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT));
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void simpleProjectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  stepList.add(createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT));
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.executeWorkFlow(logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33685
Project: 33685
Buggy source:
@Test public void simpleProjectAndSelectWithOneFilterQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Filter filter=createFilter();
  filter.setNextStep(createSelect());
  project.setNextStep(filter);
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void simpleProjectAndSelectWithOneFilterQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Filter filter=createFilter();
  filter.setNextStep(createSelect());
  project.setNextStep(filter);
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.executeWorkFlow(logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33686
Project: 33686
Buggy source:
@Test public void simpleProjectAndSelectWithThreeFiltersQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Filter filter1=createFilter();
  Filter filter2=createFilter();
  Filter filter3=createFilter();
  filter3.setNextStep(createSelect());
  filter2.setNextStep(filter3);
  filter1.setNextStep(filter2);
  project.setNextStep(filter1);
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void simpleProjectAndSelectWithThreeFiltersQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Filter filter1=createFilter();
  Filter filter2=createFilter();
  Filter filter3=createFilter();
  filter3.setNextStep(createSelect());
  filter2.setNextStep(filter3);
  filter1.setNextStep(filter2);
  project.setNextStep(filter1);
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.executeWorkFlow(logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33687
Project: 33687
Buggy source:
@Test public void simpleProjectAndSelectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  project.setNextStep(createSelect());
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void simpleProjectAndSelectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  project.setNextStep(createSelect());
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.executeWorkFlow(logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33688
Project: 33688
Buggy source:
@Override public QueryResult execute(ClusterName targetCluster,LogicalWorkflow workflow) throws UnsupportedException, ExecutionException {
  List<LogicalStep> initialSteps=workflow.getInitialSteps();
  JavaRDD<Cells> partialResultRdd=null;
  for (  LogicalStep initialStep : initialSteps) {
    Project project=(Project)initialStep;
    ExtractorConfig<Cells> extractorConfig=retrieveConfiguration(project.getClusterName());
    JavaRDD<Cells> initialRdd=createRDD(project,extractorConfig);
    partialResultRdd=executeInitialStep(initialStep.getNextStep(),initialRdd,project.getTableName().toString());
  }
  return buildQueryResult(partialResultRdd);
}

Fixed version (ground truth):
@Override public QueryResult execute(LogicalWorkflow workflow) throws UnsupportedException, ExecutionException {
  List<LogicalStep> initialSteps=workflow.getInitialSteps();
  JavaRDD<Cells> partialResultRdd=null;
  for (  LogicalStep initialStep : initialSteps) {
    Project project=(Project)initialStep;
    ExtractorConfig<Cells> extractorConfig=retrieveConfiguration(project.getClusterName());
    JavaRDD<Cells> initialRdd=createRDD(project,extractorConfig);
    partialResultRdd=executeInitialStep(initialStep.getNextStep(),initialRdd,project.getTableName().toString());
  }
  return buildQueryResult(partialResultRdd);
}
Program: 33689
Project: 33689
Buggy source:
/** 
 * @param logicalStep
 * @param rdd
 * @return
 * @throws ExecutionException
 */
private JavaRDD<Cells> executeInitialStep(LogicalStep logicalStep,JavaRDD<Cells> rdd,String tableName) throws ExecutionException {
  LogicalStep currentStep=logicalStep;
  while (currentStep != null) {
    if (currentStep instanceof Filter) {
      executeFilter((Filter)currentStep,rdd);
    }
 else     if (currentStep instanceof Select) {
      prepareResult((Select)currentStep,rdd);
    }
 else     if (currentStep instanceof UnionStep) {
      if (!executeUnion((UnionStep)currentStep,rdd)) {
        break;
      }
    }
 else {
      throw new ExecutionException("String_Node_Str" + currentStep.getOperation().toString() + "String_Node_Str");
    }
    currentStep=currentStep.getNextStep();
  }
  partialResultsMap.put(tableName,rdd);
  return rdd;
}

Fixed version (ground truth):
/** 
 * @param logicalStep
 * @param rdd
 * @return
 * @throws ExecutionException
 */
private JavaRDD<Cells> executeInitialStep(LogicalStep logicalStep,JavaRDD<Cells> rdd,String tableName) throws ExecutionException {
  String stepId=tableName;
  LogicalStep currentStep=logicalStep;
  while (currentStep != null) {
    if (currentStep instanceof Filter) {
      executeFilter((Filter)currentStep,rdd);
    }
 else     if (currentStep instanceof Select) {
      prepareResult((Select)currentStep,rdd);
    }
 else     if (currentStep instanceof UnionStep) {
      UnionStep unionStep=(UnionStep)currentStep;
      if (!executeUnion(unionStep,rdd)) {
        break;
      }
 else {
        if (unionStep instanceof Join) {
          stepId=((Join)unionStep).getId();
        }
 else {
          throw new ExecutionException("String_Node_Str" + unionStep.getOperation().toString() + "String_Node_Str");
        }
      }
    }
 else {
      throw new ExecutionException("String_Node_Str" + currentStep.getOperation().toString() + "String_Node_Str");
    }
    currentStep=currentStep.getNextStep();
  }
  partialResultsMap.put(stepId,rdd);
  return rdd;
}
Program: 33690
Project: 33690
Buggy source:
@Test public void TwoProjectsJoinedAndSelectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project projectLeft=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Project projectRight=createProject(CLUSTERNAME_CONSTANT,TABLE2_CONSTANT);
  Join join=createJoin("String_Node_Str",TABLE1_CONSTANT.toString(),TABLE2_CONSTANT.toString());
  join.setNextStep(createSelect());
  projectLeft.setNextStep(join);
  projectRight.setNextStep(join);
  stepList.add(projectLeft);
  stepList.add(projectRight);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(2)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void TwoProjectsJoinedAndSelectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project projectLeft=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Project projectRight=createProject(CLUSTERNAME_CONSTANT,TABLE2_CONSTANT);
  Join join=createJoin("String_Node_Str",TABLE1_CONSTANT.toString(),TABLE2_CONSTANT.toString());
  join.setNextStep(createSelect());
  projectLeft.setNextStep(join);
  projectRight.setNextStep(join);
  stepList.add(projectLeft);
  stepList.add(projectRight);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(logicalWorkflow);
  verify(deepContext,times(2)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33691
Project: 33691
Buggy source:
@Test public void simpleProjectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  stepList.add(createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT));
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void simpleProjectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  stepList.add(createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT));
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33692
Project: 33692
Buggy source:
@Test public void simpleProjectAndSelectWithOneFilterQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Filter filter=createFilter();
  filter.setNextStep(createSelect());
  project.setNextStep(filter);
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void simpleProjectAndSelectWithOneFilterQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Filter filter=createFilter();
  filter.setNextStep(createSelect());
  project.setNextStep(filter);
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33693
Project: 33693
Buggy source:
@Test public void simpleProjectAndSelectWithThreeFiltersQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Filter filter1=createFilter();
  Filter filter2=createFilter();
  Filter filter3=createFilter();
  filter3.setNextStep(createSelect());
  filter2.setNextStep(filter3);
  filter1.setNextStep(filter2);
  project.setNextStep(filter1);
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void simpleProjectAndSelectWithThreeFiltersQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  Filter filter1=createFilter();
  Filter filter2=createFilter();
  Filter filter3=createFilter();
  filter3.setNextStep(createSelect());
  filter2.setNextStep(filter3);
  filter1.setNextStep(filter2);
  project.setNextStep(filter1);
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33694
Project: 33694
Buggy source:
@Test public void simpleProjectAndSelectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  project.setNextStep(createSelect());
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(CLUSTERNAME_CONSTANT,logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}

Fixed version (ground truth):
@Test public void simpleProjectAndSelectQueryTest() throws UnsupportedException, ExecutionException, HandlerConnectionException {
  List<LogicalStep> stepList=new ArrayList<>();
  Project project=createProject(CLUSTERNAME_CONSTANT,TABLE1_CONSTANT);
  project.setNextStep(createSelect());
  stepList.add(project);
  LogicalWorkflow logicalWorkflow=new LogicalWorkflow(stepList);
  deepQueryEngine.execute(logicalWorkflow);
  verify(deepContext,times(1)).createJavaRDD(any(DeepJobConfig.class));
}
Program: 33695
Project: 33695
Buggy source:
/** 
 * @param selectStep
 * @param rdd
 */
private void prepareResult(Select selectStep,JavaRDD<Cells> rdd) throws ExecutionException {
  rdd=QueryFilterUtils.filterSelectedColumns(rdd,selectStep);
}

Fixed version (ground truth):
/** 
 * @param selectStep
 * @param rdd
 */
private void prepareResult(Select selectStep,JavaRDD<Cells> rdd) throws ExecutionException {
  rdd=QueryFilterUtils.filterSelectedColumns(rdd,selectStep.getColumnMap().keySet());
}
Program: 33696
Project: 33696
Buggy source:
/** 
 * Build JavaRDD<Cells> from list of Cells and select Columns.
 * @param rdd list of JavaRDD Cells
 * @param selectedCols List of fields selected in the SelectStatement.
 * @return JavaRDD<Cells>
 */
static JavaRDD<Cells> filterSelectedColumns(JavaRDD<Cells> rdd,Select selectedCols){
  final Set<String> maps=selectedCols.getColumnMap().keySet();
  JavaRDD<Cells> cellsInRDD=rdd.map(new Function<Cells,Cells>(){
    private static final long serialVersionUID=-5704730871386839898L;
    @Override public Cells call(    Cells cells) throws Exception {
      Cells cellsout=new Cells();
      for (      Cell deepCell : cells.getCells()) {
        if (maps.contains(deepCell.getCellName())) {
          cellsout.add(deepCell);
        }
      }
      return cellsout;
    }
  }
);
  return cellsInRDD;
}

Fixed version (ground truth):
/** 
 * Build JavaRDD<Cells> from list of Cells and select Columns.
 * @param rdd Cells RDD
 * @param selectedCols Set of fields selected in the SelectStatement.
 * @return JavaRDD<Cells>
 */
static JavaRDD<Cells> filterSelectedColumns(JavaRDD<Cells> rdd,final Set<ColumnName> selectedCols){
  return rdd.map(new Function<Cells,Cells>(){
    private static final long serialVersionUID=-5704730871386839898L;
    @Override public Cells call(    Cells cells) throws Exception {
      Cells cellsOut=new Cells();
      for (      ColumnName columnName : selectedCols) {
        Cell cell=cells.getCellByName(columnName.getTableName().getQualifiedName(),columnName.getName());
        cellsOut.add(cell);
      }
      return cellsOut;
    }
  }
);
}
Program: 33697
Project: 33697
Buggy source:
@Override public Cells call(Cells cells) throws Exception {
  Cells cellsout=new Cells();
  for (  Cell deepCell : cells.getCells()) {
    if (maps.contains(deepCell.getCellName())) {
      cellsout.add(deepCell);
    }
  }
  return cellsout;
}

Fixed version (ground truth):
@Override public Cells call(Cells cells) throws Exception {
  Cells cellsOut=new Cells();
  for (  ColumnName columnName : selectedCols) {
    Cell cell=cells.getCellByName(columnName.getTableName().getQualifiedName(),columnName.getName());
    cellsOut.add(cell);
  }
  return cellsOut;
}
Program: 33698
Project: 33698
Buggy source:
/** 
 * Take a RDD and a Relation and apply suitable filter to the RDD. Execute where clause on Deep.
 * @param rdd RDD which filter must be applied.
 * @param relation {@link com.stratio.meta.common.statements.structures.relationships.Relation} to apply
 * @return A new RDD with the result.
 * @throws UnsupportedException
 */
static JavaRDD<Cells> doWhere(JavaRDD<Cells> rdd,Relation relation) throws UnsupportedException {
  Operator operator=relation.getOperator();
  JavaRDD<Cells> result=null;
  Selector leftTerm=relation.getLeftTerm();
  Selector rightTerm=relation.getRightTerm();
  ColumnSelector columnSelector=(ColumnSelector)leftTerm;
  String field=columnSelector.getName().getName();
  LOG.info("String_Node_Str" + rdd.count());
switch (operator.toString().toLowerCase()) {
case "String_Node_Str":
    result=rdd.filter(new DeepEquals(field,rightTerm));
  break;
case "String_Node_Str":
result=rdd.filter(new NotEquals(field,rightTerm));
break;
case "String_Node_Str":
result=rdd.filter(new GreaterThan(field,rightTerm));
break;
case "String_Node_Str":
result=rdd.filter(new GreaterEqualThan(field,rightTerm));
break;
case "String_Node_Str":
result=rdd.filter(new LessThan(field,rightTerm));
break;
case "String_Node_Str":
result=rdd.filter(new LessEqualThan(field,rightTerm));
break;
case "String_Node_Str":
throw new UnsupportedException("String_Node_Str");
case "String_Node_Str":
throw new UnsupportedException("String_Node_Str");
default :
LOG.error("String_Node_Str" + operator);
result=null;
}
return result;
}

Fixed version (ground truth):
/** 
 * Take a RDD and a Relation and apply suitable filter to the RDD. Execute where clause on Deep.
 * @param rdd RDD which filter must be applied.
 * @param relation {@link com.stratio.meta.common.statements.structures.relationships.Relation} to apply
 * @return A new RDD with the result.
 * @throws UnsupportedException
 */
static JavaRDD<Cells> doWhere(JavaRDD<Cells> rdd,Relation relation) throws UnsupportedException {
  Operator operator=relation.getOperator();
  JavaRDD<Cells> result=null;
  Selector leftTerm=relation.getLeftTerm();
  Selector rightTerm=relation.getRightTerm();
  ColumnSelector columnSelector=(ColumnSelector)leftTerm;
  String field=columnSelector.getName().getName();
switch (operator.toString().toLowerCase()) {
case "String_Node_Str":
    result=rdd.filter(new DeepEquals(field,rightTerm));
  break;
case "String_Node_Str":
result=rdd.filter(new NotEquals(field,rightTerm));
break;
case "String_Node_Str":
result=rdd.filter(new GreaterThan(field,rightTerm));
break;
case "String_Node_Str":
result=rdd.filter(new GreaterEqualThan(field,rightTerm));
break;
case "String_Node_Str":
result=rdd.filter(new LessThan(field,rightTerm));
break;
case "String_Node_Str":
result=rdd.filter(new LessEqualThan(field,rightTerm));
break;
case "String_Node_Str":
throw new UnsupportedException("String_Node_Str");
case "String_Node_Str":
throw new UnsupportedException("String_Node_Str");
default :
LOG.error("String_Node_Str" + operator);
result=null;
}
return result;
}
Program: 33699
Project: 33699
Buggy source:
private Select createSelect(){
  Map<String,String> columnsAliases=new HashMap<>();
  columnsAliases.put("String_Node_Str","String_Node_Str");
  Map<String,ColumnType> columnsTypes=new HashMap<>();
  columnsTypes.put("String_Node_Str",ColumnType.BIGINT);
  Select select=new Select(Operations.PROJECT,columnsAliases,columnsTypes);
  return select;
}

Fixed version (ground truth):
private Select createSelect(){
  ColumnName columnName=new ColumnName("String_Node_Str","String_Node_Str","String_Node_Str");
  Map<ColumnName,String> columnsAliases=new HashMap<>();
  columnsAliases.put(columnName,"String_Node_Str");
  Map<String,ColumnType> columnsTypes=new HashMap<>();
  columnsTypes.put("String_Node_Str",ColumnType.BIGINT);
  Select select=new Select(Operations.PROJECT,columnsAliases,columnsTypes);
  return select;
}
Program: 33700
Project: 33700
Buggy source:
/** 
 * Sets up the touch listener to allow the SnackBar to be swiped to dismissed Code from https://github.com/MrEngineer13/SnackBar
 */
private void setupGestureDetector(){
  mSnackBarView.setOnTouchListener(new View.OnTouchListener(){
    @Override public boolean onTouch(    View view,    MotionEvent event){
      if (mIsDisposed)       return false;
      float y=event.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
        int[] location=new int[2];
      view.getLocationInWindow(location);
    if (y > mPreviousY && y - mPreviousY >= 50) {
      mShouldDisposeOnCancel=false;
      mAnimator.cancel();
      createHideAnimation();
    }
}
mPreviousY=y;
return true;
}
}
);
}

Fixed version (ground truth):
/** 
 * Sets up the touch listener to allow the SnackBar to be swiped to dismissed Code from https://github.com/MrEngineer13/SnackBar
 */
private void setupGestureDetector(){
  mSnackBarView.setOnTouchListener(new View.OnTouchListener(){
    @Override public boolean onTouch(    View view,    MotionEvent event){
      if (mIsDisposed || mIsGestureAccepted)       return false;
      float y=event.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
        int[] location=new int[2];
      view.getLocationInWindow(location);
    if (y > mPreviousY && y - mPreviousY >= 50) {
      mIsGestureAccepted=true;
      mShouldDisposeOnCancel=false;
      mAnimator.cancel();
      createHideAnimation();
    }
}
mPreviousY=y;
return true;
}
}
);
}
Program: 33701
Project: 33701
Buggy source:
@Override public boolean onTouch(View view,MotionEvent event){
  if (mIsDisposed)   return false;
  float y=event.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
    int[] location=new int[2];
  view.getLocationInWindow(location);
if (y > mPreviousY && y - mPreviousY >= 50) {
  mShouldDisposeOnCancel=false;
  mAnimator.cancel();
  createHideAnimation();
}
}
mPreviousY=y;
return true;
}

Fixed version (ground truth):
@Override public boolean onTouch(View view,MotionEvent event){
  if (mIsDisposed || mIsGestureAccepted)   return false;
  float y=event.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
    int[] location=new int[2];
  view.getLocationInWindow(location);
if (y > mPreviousY && y - mPreviousY >= 50) {
  mIsGestureAccepted=true;
  mShouldDisposeOnCancel=false;
  mAnimator.cancel();
  createHideAnimation();
}
}
mPreviousY=y;
return true;
}
Program: 33702
Project: 33702
Buggy source:
/** 
 * Returns an unmodifiable view of the ItemPreset map.
 */
private Map<Id,ItemPreset> getItemPresets(){
  return Collections.unmodifiableMap(itemPresets);
}

Fixed version (ground truth):
/** 
 * Returns an unmodifiable view of the ItemPreset map.
 */
private Map<Id,ItemPreset> getItemPresets(){
  if (!refreshed) {
    refreshItemPresets();
  }
  return Collections.unmodifiableMap(itemPresets);
}
Program: 33703
Project: 33703
Buggy source:
/** 
 * Constructs a new TimeVisibilityCriterion that starts at begin and ends at end.
 * @param begin the hour when it begins, nonnegative, smaller than the number of hours in the day
 * @param end the hour when it ends, nonnegative, smaller than the number of hours in the day, not equal to begin
 */
public TimeVisibilityCriterion(final int begin,final int end){
  if (begin == end) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (end >= HOURS_IN_DAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.begin=begin;
  this.duration=Math.abs(end - begin);
}

Fixed version (ground truth):
/** 
 * Constructs a new TimeVisibilityCriterion that starts at begin and ends at end.
 * @param begin the hour when it begins, nonnegative, smaller than the number of hours in the day
 * @param end the hour when it ends, nonnegative, smaller than the number of hours in the day, not equal to begin
 */
public TimeVisibilityCriterion(final int begin,final int end){
  if (end >= HOURS_IN_DAY) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.begin=begin;
  if (begin == end) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else   if (begin < end) {
    this.duration=end - begin;
  }
 else {
    this.duration=HOURS_IN_DAY + end - begin;
  }
}