nus-yam/ex-repair huggingface dataset:
Program: 21701
Project: 21701
Buggy source:
public FiniteStateSpace(List<String> statesNames1){
  super(StateSpaceType.FINITE_SET);
  this.numberOfStates=statesNames1.size();
  this.statesNames=new ArrayList<>();
  this.mapStatesNames=new HashMap<>();
  for (int i=0; i < statesNames.size(); i++) {
    this.statesNames.add(statesNames.get(i));
    this.mapStatesNames.put(statesNames.get(i),i);
  }
}

Fixed version (ground truth):
public FiniteStateSpace(List<String> statesNames1){
  super(StateSpaceType.FINITE_SET);
  this.numberOfStates=statesNames1.size();
  this.statesNames=new ArrayList<>();
  this.mapStatesNames=new HashMap<>();
  for (int i=0; i < statesNames1.size(); i++) {
    this.statesNames.add(statesNames1.get(i));
    this.mapStatesNames.put(statesNames1.get(i),i);
  }
}
Program: 21702
Project: 21702
Buggy source:
public DataRowWeka(Attributes atts,String line){
  data=new double[atts.getNumberOfAttributes()];
  String[] parts=line.split("String_Node_Str");
  for (int i=0; i < parts.length; i++) {
switch (atts.getList().get(i).getStateSpace().getStateSpaceType()) {
case REAL:
      data[i]=Double.parseDouble(parts[i]);
    break;
case FINITE_SET:
  FiniteStateSpace finiteStateSpace=atts.getList().get(i).getStateSpace();
data[i]=finiteStateSpace.getIndexOfState(parts[i]);
}
}
}

Fixed version (ground truth):
public DataRowWeka(Attributes atts,String line){
  data=new double[atts.getNumberOfAttributes()];
  String[] parts=line.split("String_Node_Str");
  if (parts.length != atts.getNumberOfAttributes())   throw new IllegalStateException("String_Node_Str");
  for (int i=0; i < parts.length; i++) {
switch (atts.getList().get(i).getStateSpace().getStateSpaceType()) {
case REAL:
      data[i]=Double.parseDouble(parts[i]);
    break;
case FINITE_SET:
  FiniteStateSpace finiteStateSpace=atts.getList().get(i).getStateSpace();
data[i]=finiteStateSpace.getIndexOfState(parts[i]);
}
}
}
Program: 21703
Project: 21703
Buggy source:
@Override public Stream<DataRow> stream(){
  Stream<String> streamString=null;
  try {
    streamString=Files.lines(pathFile);
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
  return streamString.skip(this.dataLineCount).map(line -> new DataRowWeka(this.attributes,line));
}

Fixed version (ground truth):
@Override public Stream<DataRow> stream(){
  Stream<String> streamString=null;
  try {
    streamString=Files.lines(pathFile);
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
  return streamString.filter(w -> !w.isEmpty()).skip(this.dataLineCount).filter(w -> !w.isEmpty()).map(line -> new DataRowWeka(this.attributes,line));
}
Program: 21704
Project: 21704
Buggy source:
private static Attribute createAttributeFromLine(int index,String line){
  String[] parts=line.split("String_Node_Str");
  if (!parts[0].trim().startsWith("String_Node_Str"))   throw new IllegalArgumentException("String_Node_Str");
  String name=parts[1].trim();
  parts[2]=parts[2].trim();
  if (parts[2].equals("String_Node_Str")) {
    return new Attribute(index,name,new RealStateSpace());
  }
 else   if (parts[2].startsWith("String_Node_Str")) {
    String[] states=parts[2].substring(1,parts[2].length() - 1).split("String_Node_Str");
    List<String> statesNames=Arrays.stream(states).map(String::trim).collect(Collectors.toList());
    return new Attribute(index,name,new FiniteStateSpace(statesNames));
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str" + line);
  }
}

Fixed version (ground truth):
private static Attribute createAttributeFromLine(int index,String line){
  String[] parts=line.split("String_Node_Str");
  if (!parts[0].trim().startsWith("String_Node_Str"))   throw new IllegalArgumentException("String_Node_Str");
  String name=parts[1].trim();
  parts[2]=line.substring(parts[0].length() + parts[1].length() + 2);
  parts[2]=parts[2].trim();
  if (parts[2].equals("String_Node_Str")) {
    return new Attribute(index,name,new RealStateSpace());
  }
 else   if (parts[2].startsWith("String_Node_Str")) {
    String[] states=parts[2].substring(1,parts[2].length() - 1).split("String_Node_Str");
    List<String> statesNames=Arrays.stream(states).map(String::trim).collect(Collectors.toList());
    return new Attribute(index,name,new FiniteStateSpace(statesNames));
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str" + line);
  }
}
Program: 21705
Project: 21705
Buggy source:
public ARFFDataReader(String pathString){
  pathFile=Paths.get(pathString);
  try {
    Optional<String> atRelation=Files.lines(pathFile).map(String::trim).limit(0).filter(line -> line.startsWith("String_Node_Str")).findFirst();
    if (!atRelation.isPresent())     throw new IllegalArgumentException("String_Node_Str");
    relationName=atRelation.get().split("String_Node_Str")[1];
    final int[] count={0};
    Optional<String> atData=Files.lines(pathFile).map(String::trim).peek(line -> count[0]++).filter(line -> line.startsWith("String_Node_Str")).findFirst();
    if (!atData.isPresent())     throw new IllegalArgumentException("String_Node_Str");
    dataLineCount=count[0] + 1;
    List<String> attLines=Files.lines(pathFile).map(String::trim).limit(count[0]).filter(line -> line.startsWith("String_Node_Str")).collect(Collectors.toList());
    List<Attribute> atts=IntStream.range(0,attLines.size()).mapToObj(i -> createAttributeFromLine(i,attLines.get(i))).collect(Collectors.toList());
    this.attributes=new Attributes(atts);
    stateSpace=new StateSpaceType[atts.size()];
    for (    Attribute att : atts) {
      stateSpace[att.getIndex()]=att.getStateSpace().getStateSpaceType();
    }
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
}

Fixed version (ground truth):
public ARFFDataReader(String pathString){
  pathFile=Paths.get(pathString);
  try {
    Optional<String> atRelation=Files.lines(pathFile).map(String::trim).filter(w -> !w.isEmpty()).limit(1).filter(line -> line.startsWith("String_Node_Str")).findFirst();
    if (!atRelation.isPresent())     throw new IllegalArgumentException("String_Node_Str");
    relationName=atRelation.get().split("String_Node_Str")[1];
    final int[] count={0};
    Optional<String> atData=Files.lines(pathFile).map(String::trim).filter(w -> !w.isEmpty()).peek(line -> count[0]++).filter(line -> line.startsWith("String_Node_Str")).findFirst();
    if (!atData.isPresent())     throw new IllegalArgumentException("String_Node_Str");
    dataLineCount=count[0];
    List<String> attLines=Files.lines(pathFile).map(String::trim).filter(w -> !w.isEmpty()).limit(dataLineCount).filter(line -> line.startsWith("String_Node_Str")).collect(Collectors.toList());
    List<Attribute> atts=IntStream.range(0,attLines.size()).mapToObj(i -> createAttributeFromLine(i,attLines.get(i))).collect(Collectors.toList());
    this.attributes=new Attributes(atts);
    stateSpace=new StateSpaceType[atts.size()];
    for (    Attribute att : atts) {
      stateSpace[att.getIndex()]=att.getStateSpace().getStateSpaceType();
    }
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
}
Program: 21706
Project: 21706
Buggy source:
public DataRowWeka(Attributes atts,String line){
  data=new double[atts.getNumberOfAttributes()];
  String[] parts=line.split("String_Node_Str");
  for (int i=0; i < parts.length; i++) {
switch (atts.getList().get(i).getStateSpace().getStateSpaceType()) {
case REAL:
      data[i]=Double.parseDouble(parts[i]);
    break;
case FINITE_SET:
  FiniteStateSpace finiteStateSpace=atts.getList().get(i).getStateSpace();
data[i]=finiteStateSpace.getIndexOfState(parts[i]);
}
}
}

Fixed version (ground truth):
public DataRowWeka(Attributes atts,String line){
  data=new double[atts.getNumberOfAttributes()];
  String[] parts=line.split("String_Node_Str");
  if (parts.length != atts.getNumberOfAttributes())   throw new IllegalStateException("String_Node_Str");
  for (int i=0; i < parts.length; i++) {
switch (atts.getList().get(i).getStateSpace().getStateSpaceType()) {
case REAL:
      data[i]=Double.parseDouble(parts[i]);
    break;
case FINITE_SET:
  FiniteStateSpace finiteStateSpace=atts.getList().get(i).getStateSpace();
data[i]=finiteStateSpace.getIndexOfState(parts[i]);
}
}
}
Program: 21707
Project: 21707
Buggy source:
@Override public Stream<DataRow> stream(){
  Stream<String> streamString=null;
  try {
    streamString=Files.lines(pathFile);
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
  return streamString.skip(this.dataLineCount).map(line -> new DataRowWeka(this.attributes,line));
}

Fixed version (ground truth):
@Override public Stream<DataRow> stream(){
  Stream<String> streamString=null;
  try {
    streamString=Files.lines(pathFile);
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
  return streamString.filter(w -> !w.isEmpty()).skip(this.dataLineCount).filter(w -> !w.isEmpty()).map(line -> new DataRowWeka(this.attributes,line));
}
Program: 21708
Project: 21708
Buggy source:
private static Attribute createAttributeFromLine(int index,String line){
  String[] parts=line.split("String_Node_Str");
  if (!parts[0].trim().startsWith("String_Node_Str"))   throw new IllegalArgumentException("String_Node_Str");
  String name=parts[1].trim();
  parts[2]=parts[2].trim();
  if (parts[2].equals("String_Node_Str")) {
    return new Attribute(index,name,new RealStateSpace());
  }
 else   if (parts[2].startsWith("String_Node_Str")) {
    String[] states=parts[2].substring(1,parts[2].length() - 1).split("String_Node_Str");
    List<String> statesNames=Arrays.stream(states).map(String::trim).collect(Collectors.toList());
    return new Attribute(index,name,new FiniteStateSpace(statesNames));
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str" + line);
  }
}

Fixed version (ground truth):
private static Attribute createAttributeFromLine(int index,String line){
  String[] parts=line.split("String_Node_Str");
  if (!parts[0].trim().startsWith("String_Node_Str"))   throw new IllegalArgumentException("String_Node_Str");
  String name=parts[1].trim();
  parts[2]=line.substring(parts[0].length() + parts[1].length() + 2);
  parts[2]=parts[2].trim();
  if (parts[2].equals("String_Node_Str")) {
    return new Attribute(index,name,new RealStateSpace());
  }
 else   if (parts[2].startsWith("String_Node_Str")) {
    String[] states=parts[2].substring(1,parts[2].length() - 1).split("String_Node_Str");
    List<String> statesNames=Arrays.stream(states).map(String::trim).collect(Collectors.toList());
    return new Attribute(index,name,new FiniteStateSpace(statesNames));
  }
 else {
    throw new UnsupportedOperationException("String_Node_Str" + line);
  }
}
Program: 21709
Project: 21709
Buggy source:
public ARFFDataReader(String pathString){
  pathFile=Paths.get(pathString);
  try {
    Optional<String> atRelation=Files.lines(pathFile).map(String::trim).limit(0).filter(line -> line.startsWith("String_Node_Str")).findFirst();
    if (!atRelation.isPresent())     throw new IllegalArgumentException("String_Node_Str");
    relationName=atRelation.get().split("String_Node_Str")[1];
    final int[] count={0};
    Optional<String> atData=Files.lines(pathFile).map(String::trim).peek(line -> count[0]++).filter(line -> line.startsWith("String_Node_Str")).findFirst();
    if (!atData.isPresent())     throw new IllegalArgumentException("String_Node_Str");
    dataLineCount=count[0] + 1;
    List<String> attLines=Files.lines(pathFile).map(String::trim).limit(count[0]).filter(line -> line.startsWith("String_Node_Str")).collect(Collectors.toList());
    List<Attribute> atts=IntStream.range(0,attLines.size()).mapToObj(i -> createAttributeFromLine(i,attLines.get(i))).collect(Collectors.toList());
    this.attributes=new Attributes(atts);
    stateSpace=new StateSpaceType[atts.size()];
    for (    Attribute att : atts) {
      stateSpace[att.getIndex()]=att.getStateSpace().getStateSpaceType();
    }
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
}

Fixed version (ground truth):
public ARFFDataReader(String pathString){
  pathFile=Paths.get(pathString);
  try {
    Optional<String> atRelation=Files.lines(pathFile).map(String::trim).filter(w -> !w.isEmpty()).limit(1).filter(line -> line.startsWith("String_Node_Str")).findFirst();
    if (!atRelation.isPresent())     throw new IllegalArgumentException("String_Node_Str");
    relationName=atRelation.get().split("String_Node_Str")[1];
    final int[] count={0};
    Optional<String> atData=Files.lines(pathFile).map(String::trim).filter(w -> !w.isEmpty()).peek(line -> count[0]++).filter(line -> line.startsWith("String_Node_Str")).findFirst();
    if (!atData.isPresent())     throw new IllegalArgumentException("String_Node_Str");
    dataLineCount=count[0];
    List<String> attLines=Files.lines(pathFile).map(String::trim).filter(w -> !w.isEmpty()).limit(dataLineCount).filter(line -> line.startsWith("String_Node_Str")).collect(Collectors.toList());
    List<Attribute> atts=IntStream.range(0,attLines.size()).mapToObj(i -> createAttributeFromLine(i,attLines.get(i))).collect(Collectors.toList());
    this.attributes=new Attributes(atts);
    stateSpace=new StateSpaceType[atts.size()];
    for (    Attribute att : atts) {
      stateSpace[att.getIndex()]=att.getStateSpace().getStateSpaceType();
    }
  }
 catch (  IOException ex) {
    throw new UncheckedIOException(ex);
  }
}
Program: 21714
Project: 21714
Buggy source:
public SequenceData nextSequenceData();

Fixed version (ground truth):
public DynamicDataInstance nextSequenceData();
Program: 21715
Project: 21715
Buggy source:
public SequenceData nextSequenceData();

Fixed version (ground truth):
public DynamicDataInstance nextSequenceData();
Program: 21716
Project: 21716
Buggy source:
public SequenceData getSequenceData(int indexInWindow);

Fixed version (ground truth):
public DynamicDataInstance getSequenceData(int indexInWindow);
Program: 21717
Project: 21717
Buggy source:
public SequenceData nextSequenceData();

Fixed version (ground truth):
public DynamicDataInstance nextSequenceData();
Program: 21718
Project: 21718
Buggy source:
public SequenceData nextSequenceData();

Fixed version (ground truth):
public DynamicDataInstance nextSequenceData();
Program: 21719
Project: 21719
Buggy source:
public SequenceData getSequenceData(int indexInWindow);

Fixed version (ground truth):
public DynamicDataInstance getSequenceData(int indexInWindow);
Program: 21720
Project: 21720
Buggy source:
public SequenceData nextSequenceData();

Fixed version (ground truth):
public DynamicDataInstance nextSequenceData();
Program: 21721
Project: 21721
Buggy source:
public SequenceData nextSequenceData();

Fixed version (ground truth):
public DynamicDataInstance nextSequenceData();
Program: 21722
Project: 21722
Buggy source:
public SequenceData getSequenceData(int indexInWindow);

Fixed version (ground truth):
public DynamicDataInstance getSequenceData(int indexInWindow);
Program: 21723
Project: 21723
Buggy source:
public SequenceData nextSequenceData();

Fixed version (ground truth):
public DynamicDataInstance nextSequenceData();
Program: 21724
Project: 21724
Buggy source:
public SequenceData nextSequenceData();

Fixed version (ground truth):
public DynamicDataInstance nextSequenceData();
Program: 21725
Project: 21725
Buggy source:
public SequenceData getSequenceData(int indexInWindow);

Fixed version (ground truth):
public DynamicDataInstance getSequenceData(int indexInWindow);
Program: 21726
Project: 21726
Buggy source:
/** 
 * Tries to auto associate hosts to host groups.
 * @return prints the auto assignments
 */
@CliCommand(value="String_Node_Str",help="String_Node_Str") public String autoAssign(){
  hostGroups=client.recommendAssignments(context.getFocusValue());
  return showAssignments();
}

Fixed version (ground truth):
/** 
 * Tries to auto associate hosts to host groups.
 * @return prints the auto assignments
 */
@CliCommand(value="String_Node_Str",help="String_Node_Str") public String autoAssign(){
  Map<String,List<String>> assignments=client.recommendAssignments(context.getFocusValue());
  if (!assignments.isEmpty()) {
    hostGroups=assignments;
  }
  return showAssignments();
}
Program: 21727
Project: 21727
Buggy source:
private CassandraUtils setUpSuite2(String nowValue){
  SchemaBuilder schemaBuilder=schema().mapper("String_Node_Str",bitemporalMapper("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").pattern("String_Node_Str").nowValue(nowValue));
  CassandraUtils cu=CassandraUtils.builder().withHost(TestingConstants.CASSANDRA_LOCALHOST_CONSTANT).withTable(TestingConstants.TABLE_NAME_CONSTANT).withIndexColumn(TestingConstants.INDEX_COLUMN_CONSTANT).withPartitionKey("String_Node_Str").withClusteringKey().withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").build();
  cu.createKeyspace().createTable().createIndex(TestingConstants.INDEX_NAME_CONSTANT,schemaBuilder);
  return cu;
}

Fixed version (ground truth):
private CassandraUtils setUpSuite2(Object nowValue){
  SchemaBuilder schemaBuilder=schema().mapper("String_Node_Str",bitemporalMapper("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").pattern("String_Node_Str").nowValue(nowValue));
  CassandraUtils cu=CassandraUtils.builder().withHost(TestingConstants.CASSANDRA_LOCALHOST_CONSTANT).withTable(TestingConstants.TABLE_NAME_CONSTANT).withIndexColumn(TestingConstants.INDEX_COLUMN_CONSTANT).withPartitionKey("String_Node_Str").withClusteringKey().withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").withColumn("String_Node_Str","String_Node_Str").build();
  cu.createKeyspace().createTable().createIndex(TestingConstants.INDEX_NAME_CONSTANT,schemaBuilder);
  return cu;
}
Program: 21728
Project: 21728
Buggy source:
@Test public void biTemporalQueryIsWithInNowValueToLongTest(){
  String nowValue="String_Node_Str";
  CassandraUtils cu=this.setUpSuite2(nowValue);
  cu.insert(data1).insert(data2).insert(data3).insert(data4).insert(data5);
  CassandraUtilsSelect select=cu.query(biTemporalSearch("String_Node_Str").operation("String_Node_Str").vtFrom("String_Node_Str").vtTo("String_Node_Str").ttFrom("String_Node_Str").ttTo("String_Node_Str"));
  assertEquals("String_Node_Str",1,select.count());
  assertTrue("String_Node_Str" + fromInteger(select.intColumn("String_Node_Str")),isThisAndOnlyThis(select.intColumn("String_Node_Str"),new int[]{3}));
  tearDown(cu);
}

Fixed version (ground truth):
@Test public void biTemporalQueryIsWithInNowValueToLongTest(){
  Long nowValue=1456876800000l;
  CassandraUtils cu=this.setUpSuite2(nowValue);
  cu.insert(data1).insert(data2).insert(data3).insert(data4).insert(data5);
  CassandraUtilsSelect select=cu.query(biTemporalSearch("String_Node_Str").operation("String_Node_Str").vtFrom("String_Node_Str").vtTo("String_Node_Str").ttFrom("String_Node_Str").ttTo("String_Node_Str"));
  assertEquals("String_Node_Str",1,select.count());
  assertTrue("String_Node_Str" + fromInteger(select.intColumn("String_Node_Str")),isThisAndOnlyThis(select.intColumn("String_Node_Str"),new int[]{3}));
  tearDown(cu);
}
Program: 21729
Project: 21729
Buggy source:
@Test(expected=WriteTimeoutException.class) public void biTemporalQueryIsWithInNowValueToLongTest2(){
  String nowValue="String_Node_Str";
  CassandraUtils cu=this.setUpSuite2(nowValue);
  cu.insert(data6);
}

Fixed version (ground truth):
@Test(expected=WriteTimeoutException.class) public void biTemporalQueryIsWithInNowValueToLongTest2(){
  Long nowValue=1456876800000l;
  CassandraUtils cu=this.setUpSuite2(nowValue);
  cu.insert(data6);
}
Program: 21730
Project: 21730
Buggy source:
@Test(expected=InvalidQueryException.class) public void biTemporalQueryIsWithInNowValueToLongTest3(){
  String nowValue="String_Node_Str";
  CassandraUtils cu=this.setUpSuite2(nowValue);
  cu.insert(data1);
  cu.insert(data2);
  cu.insert(data3);
  cu.insert(data4);
  cu.insert(data5);
  cu.query(biTemporalSearch("String_Node_Str").operation("String_Node_Str").vtFrom("String_Node_Str").vtTo("String_Node_Str").ttFrom("String_Node_Str").ttTo("String_Node_Str")).count();
  tearDown(cu);
}

Fixed version (ground truth):
@Test(expected=InvalidQueryException.class) public void biTemporalQueryIsWithInNowValueToLongTest3(){
  Long nowValue=1456876800000l;
  CassandraUtils cu=this.setUpSuite2(nowValue);
  cu.insert(data1);
  cu.insert(data2);
  cu.insert(data3);
  cu.insert(data4);
  cu.insert(data5);
  cu.query(biTemporalSearch("String_Node_Str").operation("String_Node_Str").vtFrom("String_Node_Str").vtTo("String_Node_Str").ttFrom("String_Node_Str").ttTo("String_Node_Str")).count();
  tearDown(cu);
}
Program: 21731
Project: 21731
Buggy source:
@Test public void fuzzyMapFieldTest2(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",4,rows.size());
}

Fixed version (ground truth):
@Test public void fuzzyMapFieldTest2(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}
Program: 21732
Project: 21732
Buggy source:
@Test public void fuzzyMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",4,rows.size());
}

Fixed version (ground truth):
@Test public void fuzzyMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}
Program: 21733
Project: 21733
Buggy source:
@Test public void fuzzyMapFieldTest4(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",4,rows.size());
}

Fixed version (ground truth):
@Test public void fuzzyMapFieldTest4(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}
Program: 21734
Project: 21734
Buggy source:
@Test public void wildcardMapFieldTest4(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",4,rows.size());
}

Fixed version (ground truth):
@Test public void wildcardMapFieldTest4(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}
Program: 21735
Project: 21735
Buggy source:
@Test public void wildcardMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",4,rows.size());
}

Fixed version (ground truth):
@Test public void wildcardMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",0,rows.size());
}
Program: 21736
Project: 21736
Buggy source:
@Test public void fuzzyListFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",4,rows.size());
}

Fixed version (ground truth):
@Test public void fuzzyListFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getFuzzyQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}
Program: 21737
Project: 21737
Buggy source:
@Test public void matchMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getMatchQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}

Fixed version (ground truth):
@Test public void matchMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getMatchQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",0,rows.size());
}
Program: 21738
Project: 21738
Buggy source:
@Test public void prefixMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getPrefixQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}

Fixed version (ground truth):
@Test public void prefixMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getPrefixQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",0,rows.size());
}
Program: 21739
Project: 21739
Buggy source:
@Test public void phraseMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getPhraseQuery("String_Node_Str",Arrays.asList("String_Node_Str"),null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}

Fixed version (ground truth):
@Test public void phraseMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getPhraseQuery("String_Node_Str",Arrays.asList("String_Node_Str"),null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",0,rows.size());
}
Program: 21740
Project: 21740
Buggy source:
@Test public void regexpMapFieldTest4(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getMatchQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",4,rows.size());
}

Fixed version (ground truth):
@Test public void regexpMapFieldTest4(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getMatchQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}
Program: 21741
Project: 21741
Buggy source:
@Test public void regexpMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getMatchQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",4,rows.size());
}

Fixed version (ground truth):
@Test public void regexpMapFieldTest3(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getMatchQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}
Program: 21742
Project: 21742
Buggy source:
@Test public void prefixMapFieldTest1(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getPrefixQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",0,rows.size());
}

Fixed version (ground truth):
@Test public void prefixMapFieldTest1(){
  ResultSet queryResult=cassandraUtils.executeQuery(queryUtils.getPrefixQuery("String_Node_Str","String_Node_Str",null));
  List<Row> rows=queryResult.all();
  assertEquals("String_Node_Str",2,rows.size());
}
Program: 21743
Project: 21743
Buggy source:
@Override protected void loadMetadata(){
}

Fixed version (ground truth):
@Override protected void loadMetadata(){
  setUuid(UUID.randomUUID());
}
Program: 21744
Project: 21744
Buggy source:
public File getLocation(){
  return location;
}

Fixed version (ground truth):
/** 
 * Returns the location where this persistence store is saved.
 * @return the file where this persistence store is saved
 */
public URL getLocation(){
  return location;
}
Program: 21745
Project: 21745
Buggy source:
protected abstract void loadMetadata();

Fixed version (ground truth):
/** 
 * Called when the PersistentStore is first loaded in order to load the store's metadata (e.g. store UUID, type, etc.). A store's metadata must at minimum contain the store's UUID, which can be set by calling   {@link #setUuid(UUID)}.
 */
protected abstract void loadMetadata();
Program: 21746
Project: 21746
Buggy source:
PersistentStore(File location){
  this.location=location;
}

Fixed version (ground truth):
PersistentStore(File location){
  URL url;
  try {
    url=location.toURI().toURL();
  }
 catch (  MalformedURLException e) {
    throw new RuntimeException(e);
  }
  this.location=url;
}
Program: 21747
Project: 21747
Buggy source:
protected void setUuid(UUID uuid){
  metadata.put(UUID_KEY,uuid);
}

Fixed version (ground truth):
/** 
 * Sets the store's unique identifier. This is used by the Store itself when loading its metadata. Once it's set, it must not change throughout the lifetime of the Store.
 * @param uuid  the UUID to use.
 */
protected void setUuid(UUID uuid){
  metadata.put(UUID_KEY,uuid);
}
Program: 21748
Project: 21748
Buggy source:
abstract List<ObjectID> getPermanentIDsForObjects(List<ManagedObject> objects);

Fixed version (ground truth):
/** 
 * Returns the corresponding ObjectIDs for the specified ManagedObjects. These ObjectIDs must be permanent and must not be changed after this call. Objects that already have a permanent ObjectID must return the same one.
 * @param objects   the list of objects that shall get permanent IDs.
 * @return
 */
abstract List<ObjectID> getPermanentIDsForObjects(List<ManagedObject> objects);
Program: 21749
Project: 21749
Buggy source:
public PersistentStoreCoordinator getCoordinator(){
  return storeCoordinator;
}

Fixed version (ground truth):
/** 
 * Returns the persistent store coordinator that owns this persistent store.
 * @return the persistent store coordinator that owns this persistent store
 */
public PersistentStoreCoordinator getCoordinator(){
  return storeCoordinator;
}
Program: 21750
Project: 21750
Buggy source:
void setPersistentStoreCoordinator(PersistentStoreCoordinator coordinator){
  storeCoordinator=coordinator;
}

Fixed version (ground truth):
/** 
 * Sets the associated persistence store coordinator.
 * @param coordinator the persistence store coordinator to use
 */
void setPersistentStoreCoordinator(PersistentStoreCoordinator coordinator){
  storeCoordinator=coordinator;
}
Program: 21751
Project: 21751
Buggy source:
ObjectID createObjectID(Entity<?> entity,Object referenceObject){
  ObjectID id=new ObjectID(this,entity,referenceObject);
  return id;
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link ObjectID}.
 * @param entity            the entity associated with the ObjectID
 * @param referenceObject   the reference object that uniquely identifies the object. This object must implement{@link Object#hashCode()} and {@link Object#equals(Object)} appropriately, such thatfor two different instances that represent the same reference object, {@code Object#hashCode()} must return the same value and{@code Object#equals(Object)} must return true.
 * @return
 */
ObjectID createObjectID(Entity<?> entity,Object referenceObject){
  ObjectID id=new ObjectID(this,entity,referenceObject);
  return id;
}
Program: 21752
Project: 21752
Buggy source:
public UUID getUuid(){
  return (UUID)metadata.get(UUID_KEY);
}

Fixed version (ground truth):
/** 
 * Returns the store's unique identifier. This is persisted with the store, so it's useful to identify specific store instances. Note that nothing prevents a user from copying a persistence store (and thus it's associated UUID). Therefore, you may technically encounter two stores with the same UUID if one manually made a copy of the store. Store UUIDs are used to identify   {@link ManagedObject}
 * @return the store's UUID
 */
public UUID getUuid(){
  return (UUID)metadata.get(UUID_KEY);
}
Program: 21753
Project: 21753
Buggy source:
protected Object getReferenceObjectForObjectID(ObjectID objectID){
  return objectID.getReferenceObject();
}

Fixed version (ground truth):
/** 
 * Returns the associated reference object for the specified ObjectID.
 * @param objectID  the ObjectID to get its reference object
 * @return          the reference object associated with the specified ObjectID
 */
protected Object getReferenceObjectForObjectID(ObjectID objectID){
  return objectID.getReferenceObject();
}
Program: 21754
Project: 21754
Buggy source:
@Override protected void loadMetadata(){
  ObjectModel model=getCoordinator().getModel();
  databaseHelper=new DatabaseHelper(context,getLocation(),model);
  db=databaseHelper.getWritableDatabase();
  setUuid(DatabaseHelper.getDatabaseUuid(db,model.getVersion()));
}

Fixed version (ground truth):
@Override protected void loadMetadata(){
  ObjectModel model=getCoordinator().getModel();
  databaseHelper=new DatabaseHelper(context,new File(getLocation().getPath()),model);
  db=databaseHelper.getWritableDatabase();
  setUuid(DatabaseHelper.getDatabaseUuid(db,model.getVersion()));
}
Program: 21755
Project: 21755
Buggy source:
public AndroidSqlPersistentStore(Context context,File path){
  super(path);
  this.context=context;
}

Fixed version (ground truth):
public AndroidSqlPersistentStore(Context context,File location){
  super(location);
  this.context=context;
}
Program: 21757
Project: 21757
Buggy source:
@Before public void setup(){
  Assume.assumeTrue("String_Node_Str","String_Node_Str".equals(Platform.ARCH == "String_Node_Str") || "String_Node_Str".equals(Platform.ARCH));
  JnaLibraryLoader.init();
}

Fixed version (ground truth):
@Before public void setup(){
  Assume.assumeTrue("String_Node_Str","String_Node_Str".equals(Platform.ARCH) || "String_Node_Str".equals(Platform.ARCH));
  JnaLibraryLoader.init();
}
Program: 21758
Project: 21758
Buggy source:
public static StoredVideoInfoContext getVideoInfoForSession(ExternalSessionKey key) throws Exception {
  return videoStore.getVideoInformation(key.toString());
}

Fixed version (ground truth):
public static StoredVideoInfoContext getVideoInfoForSession(ExternalSessionKey key) throws Exception {
  checkVideoIsDone(key);
  return videoStore.getVideoInformation(key.toString());
}
Program: 21759
Project: 21759
Buggy source:
public static StoredVideoDownloadContext getVideoForSession(ExternalSessionKey key) throws Exception {
  return videoStore.retrieveVideo(key.toString());
}

Fixed version (ground truth):
public static StoredVideoDownloadContext getVideoForSession(ExternalSessionKey key) throws Exception {
  checkVideoIsDone(key);
  return videoStore.retrieveVideo(key.toString());
}
Program: 21760
Project: 21760
Buggy source:
public static void copyVideoToHub(TestSession session,String pathKey,URL remoteHost){
  String serviceUrl=remoteHost + "String_Node_Str";
  SessionInfoBean infoBean=new SessionInfoBean(session);
  ExternalSessionKey key=session.getExternalKey();
  HttpHost remote=new HttpHost(remoteHost.getHost(),remoteHost.getPort());
  HttpClientFactory httpClientFactory=new HttpClientFactory();
  HttpClient client=httpClientFactory.getHttpClient();
  HttpGet r=new HttpGet(serviceUrl + "String_Node_Str" + pathKey);
  try {
    HttpResponse response=client.execute(remote,r);
    if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
      log.warning("String_Node_Str" + EntityUtils.toString(response.getEntity()));
      return;
    }
    Header contentType=response.getFirstHeader("String_Node_Str");
    if (contentType != null && !"String_Node_Str".equals(contentType.getValue())) {
      log.log(Level.SEVERE,"String_Node_Str" + "String_Node_Str" + remoteHost);
    }
 else {
      videoStore.storeVideo(response.getEntity().getContent(),response.getEntity().getContentLength(),"String_Node_Str",key.toString(),infoBean);
    }
  }
 catch (  Exception e) {
    log.warning("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
 finally {
    r.releaseConnection();
  }
}

Fixed version (ground truth):
public static void copyVideoToHub(TestSession session,String pathKey,URL remoteHost){
  String serviceUrl=remoteHost + "String_Node_Str";
  SessionInfoBean infoBean=new SessionInfoBean(session);
  ExternalSessionKey key=session.getExternalKey();
  HttpHost remote=new HttpHost(remoteHost.getHost(),remoteHost.getPort());
  HttpClientFactory httpClientFactory=new HttpClientFactory();
  HttpClient client=httpClientFactory.getHttpClient();
  HttpGet r=new HttpGet(serviceUrl + "String_Node_Str" + pathKey);
  try {
    HttpResponse response=client.execute(remote,r);
    if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
      log.warning("String_Node_Str" + EntityUtils.toString(response.getEntity()));
      return;
    }
    Header contentType=response.getFirstHeader("String_Node_Str");
    if (contentType != null && !"String_Node_Str".equals(contentType.getValue())) {
      log.log(Level.SEVERE,"String_Node_Str" + "String_Node_Str" + remoteHost);
    }
 else {
      videoStore.storeVideo(response.getEntity().getContent(),response.getEntity().getContentLength(),"String_Node_Str",key.toString(),infoBean);
    }
  }
 catch (  Exception e) {
    log.warning("String_Node_Str" + e.getMessage());
    e.printStackTrace();
  }
 finally {
    r.releaseConnection();
    VideoFuture videoFuture=stoppingSessions.getIfPresent(key.getKey());
    if (videoFuture != null) {
      videoFuture.setDone();
    }
  }
}
Program: 21761
Project: 21761
Buggy source:
public VideoProxy(RegistrationRequest request,Registry registry){
  super(transformRegistration(request),registry);
  serviceUrl=getRemoteHost() + "String_Node_Str";
  remoteHost=new HttpHost(getRemoteHost().getHost(),getRemoteHost().getPort());
  HttpClientFactory httpClientFactory=new HttpClientFactory();
  client=httpClientFactory.getHttpClient();
}

Fixed version (ground truth):
public VideoProxy(RegistrationRequest request,Registry registry){
  super(transformRegistration(request),registry);
  serviceUrl=getRemoteHost() + "String_Node_Str";
  remoteHost=new HttpHost(getRemoteHost().getHost(),getRemoteHost().getPort());
  HttpClientFactory httpClientFactory=new HttpClientFactory();
  client=httpClientFactory.getHttpClient();
  HttpPost r=new HttpPost(serviceUrl + "String_Node_Str");
  try {
    HttpResponse response=client.execute(r);
    if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
      String body=EntityUtils.toString(response.getEntity());
      log.log(Level.SEVERE,"String_Node_Str" + this.getId() + "String_Node_Str"+ response.getStatusLine().getStatusCode()+ "String_Node_Str"+ body+ "String_Node_Str");
    }
  }
 catch (  Exception e) {
    log.log(Level.SEVERE,"String_Node_Str" + this.getId() + "String_Node_Str",e);
  }
 finally {
    r.releaseConnection();
  }
}
Program: 21762
Project: 21762
Buggy source:
@Override public void doStartupSanityChecks(){
  ColorModel colorModel=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getColorModel();
  int[] bitAllocations=colorModel.getComponentSize();
  int bitDepth=0;
  for (  int pixelBitSize : bitAllocations) {
    bitDepth+=pixelBitSize;
  }
  if (bitDepth != 32) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void doStartupSanityChecks(){
  ColorModel colorModel=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getColorModel();
  int[] bitAllocations=colorModel.getComponentSize();
  int bitDepth=bitAllocations[0] + bitAllocations[1] + bitAllocations[2];
  if (bitDepth != 24) {
    throw new IllegalStateException("String_Node_Str" + bitAllocations[0] + "String_Node_Str"+ bitAllocations[1]+ "String_Node_Str"+ bitAllocations[2]);
  }
}
Program: 21763
Project: 21763
Buggy source:
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String sessionId=req.getParameter("String_Node_Str");
  if (sessionId == null) {
    resp.setStatus(HttpStatus.SC_BAD_REQUEST);
    resp.getWriter().write("String_Node_Str");
    return;
  }
  if (!checkValidSessionId(sessionId,resp)) {
    return;
  }
  StoredVideoDownloadContext videoContext;
  try {
    videoContext=HubVideoRegistry.getVideoForSession(new ExternalSessionKey(sessionId));
  }
 catch (  Exception e) {
    log.log(Level.WARNING,"String_Node_Str" + sessionId,e);
    resp.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR);
    resp.getWriter().write("String_Node_Str");
    return;
  }
  if (!videoContext.isVideoFound()) {
    resp.setStatus(HttpStatus.SC_NOT_FOUND);
    resp.getWriter().write("String_Node_Str" + sessionId);
    return;
  }
  try {
    resp.setContentType("String_Node_Str");
    Long contentLength=videoContext.getContentLengthIfKnown();
    if (contentLength != null) {
      resp.setContentLength(contentLength.intValue());
    }
    new StreamPumper(videoContext.getStream(),resp.getOutputStream()).run();
    return;
  }
  finally {
    videoContext.close();
  }
}

Fixed version (ground truth):
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  String sessionId=req.getParameter("String_Node_Str");
  if (sessionId == null) {
    resp.setStatus(HttpStatus.SC_BAD_REQUEST);
    resp.getWriter().write("String_Node_Str");
    return;
  }
  if (!checkValidSessionId(sessionId,resp)) {
    return;
  }
  StoredVideoDownloadContext videoContext;
  try {
    videoContext=HubVideoRegistry.getVideoForSession(new ExternalSessionKey(sessionId));
  }
 catch (  Exception e) {
    log.log(Level.WARNING,"String_Node_Str" + sessionId,e);
    resp.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR);
    resp.getWriter().write("String_Node_Str");
    return;
  }
  if (!videoContext.isVideoFound()) {
    resp.setStatus(HttpStatus.SC_NOT_FOUND);
    resp.getWriter().write("String_Node_Str" + sessionId);
    videoContext.close();
    return;
  }
  try {
    resp.setContentType("String_Node_Str");
    Long contentLength=videoContext.getContentLengthIfKnown();
    if (contentLength != null) {
      resp.setContentLength(contentLength.intValue());
    }
    new StreamPumper(videoContext.getStream(),resp.getOutputStream()).run();
    return;
  }
  finally {
    videoContext.close();
  }
}
Program: 21767
Project: 21767
Buggy source:
/** 
 * checks whether the <code>String</code> passed in the <code>EditText</code> object is a valid https-url is valid if: <li>string is not empty</li> <li>string is a valid URL (according to <code>URLUtil.isValidUrl()</code></li> <li>string is a https-URL (according to <code>URLUtil.isHttpsUrl()</code>)</li> <li>string is at least 13 characters long (example for minimum url: https://ab.at)</li>
 * @param toCheck	<code>EditText</code> containing the String to be checked
 * @return	<code>true</code> iff the <code>String</code> contains a valid https-url
 */
public boolean isValidURL(EditText toCheck){
  String stringToCheck=toCheck.getText().toString();
  if (stringToCheck.isEmpty() || !URLUtil.isValidUrl(stringToCheck) || !URLUtil.isHttpsUrl(stringToCheck)|| stringToCheck.length() < 13) {
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * checks whether the <code>String</code> passed in the <code>EditText</code> object is a valid https-url is valid if: <li>string is not empty</li> <li>string is a valid URL (according to <code>URLUtil.isValidUrl()</code></li> <li>string is a https-URL (according to <code>URLUtil.isHttpsUrl()</code>)</li> <li>string is at least 13 characters long (example for minimum url: https://ab.at)</li> <p>If String ends with a slash ("/"), it is removed.</p>
 * @param toCheck	<code>EditText</code> containing the String to be checked
 * @return	<code>true</code> iff the <code>String</code> contains a valid https-url
 */
public boolean isValidURL(EditText toCheck){
  String stringToCheck=toCheck.getText().toString();
  if (stringToCheck.isEmpty() || !URLUtil.isValidUrl(stringToCheck) || !URLUtil.isHttpsUrl(stringToCheck)|| stringToCheck.length() < 13) {
    return false;
  }
 else   if (stringToCheck.charAt(stringToCheck.length() - 1) == '/') {
    String newAddressWithoutSlashAtEnd=stringToCheck.substring(0,stringToCheck.length() - 1);
    toCheck.setText(newAddressWithoutSlashAtEnd);
    return isValidURL(toCheck);
  }
 else {
    return true;
  }
}
Program: 21768
Project: 21768
Buggy source:
/** 
 * Can the tank be drained
 * @param from  which direction is being checked
 * @param fluid the fluid object
 * @return boolean based on the fluid
 */
@Override public boolean canDrain(ForgeDirection from,Fluid fluid){
  if (fluid != null && fluid.getID() == tank.getFluid().fluidID) {
    return tank.getFluidAmount() > 0;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Can the tank be drained
 * @param from  which direction is being checked
 * @param fluid the fluid object
 * @return boolean based on the fluid
 */
@Override public boolean canDrain(ForgeDirection from,Fluid fluid){
  if (fluid != null && fluid.getID() == tank.getFluid().getFluidID()) {
    return tank.getFluidAmount() > 0;
  }
  return false;
}
Program: 21769
Project: 21769
Buggy source:
/** 
 * Can the tank be filled
 * @param from  which direction is being checked
 * @param fluid the fluid object
 * @return boolean based on the fluid
 */
@Override public boolean canFill(ForgeDirection from,Fluid fluid){
  if (tank != null) {
    if (tank.getFluid().fluidID == fluid.getID()) {
      return tank.getFluidAmount() < tank.getCapacity();
    }
 else     if (tank.getFluidAmount() == 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Can the tank be filled
 * @param from  which direction is being checked
 * @param fluid the fluid object
 * @return boolean based on the fluid
 */
@Override public boolean canFill(ForgeDirection from,Fluid fluid){
  if (tank != null) {
    if (tank.getFluid().getFluidID() == fluid.getID()) {
      return tank.getFluidAmount() < tank.getCapacity();
    }
 else     if (tank.getFluidAmount() == 0) {
      return true;
    }
  }
  return false;
}
Program: 21770
Project: 21770
Buggy source:
/** 
 * Concat all objects with given separator
 * @param separator eg. ", "
 * @param objects
 * @return one string
 */
public static String toString(String separator,Object... objects){
  StringBuilder result=new StringBuilder();
  for (  Object object : objects) {
    result.append(String.valueOf(object)).append(separator);
  }
  return result.substring(0,result.length() - separator.length());
}

Fixed version (ground truth):
/** 
 * Concat all objects with given separator
 * @param separator eg. ", "
 * @param objects
 * @return one string
 */
public static String toString(String separator,Object... objects){
  StringBuilder result=new StringBuilder();
  String value;
  for (  Object object : objects) {
    value=String.valueOf(object);
    if (value.equals("String_Node_Str"))     value="String_Node_Str";
    result.append(value).append(separator);
  }
  return result.substring(0,result.length() - separator.length());
}
Program: 21771
Project: 21771
Buggy source:
private void incrementPage(){
  if (displayPage < pageIndex.length - 1) {
    displayPage++;
  }
}

Fixed version (ground truth):
private void incrementPage(){
  if (displayPage < pageIndex.length) {
    displayPage++;
  }
}