nus-yam/ex-repair huggingface dataset:
Program: 186065
Project: 186065
Buggy source:
/** 
 * @param node
 */
private void internalVisitConstructorOrMethod(MethodNode node){
  if (!doTest(node)) {
    return;
  }
  currentDeclaration=node;
  internalVisitParameters(node.getParameters(),node);
  if (node.getExceptions() != null) {
    for (    ClassNode excep : node.getExceptions()) {
      if (doTest(excep)) {
        createContext(null,node,EXCEPTIONS);
      }
    }
  }
  blockStack.push(node);
  visitAnnotations(node);
  blockStack.pop();
  Statement code=node.getCode();
  visitClassCodeContainer(code);
  if (completionOffset < node.getCode().getStart()) {
    createContext(null,node,PARAMETER);
  }
  createContext(node.getCode(),node.getCode(),expressionScriptOrStatement(node));
}

Fixed version (ground truth):
/** 
 * @param node
 */
private void internalVisitConstructorOrMethod(MethodNode node){
  if (!doTest(node)) {
    return;
  }
  if (!(node.getName().equals("String_Node_Str") && (node.getParameters() == null || node.getParameters().length == 0))) {
    currentDeclaration=node;
  }
  internalVisitParameters(node.getParameters(),node);
  if (node.getExceptions() != null) {
    for (    ClassNode excep : node.getExceptions()) {
      if (doTest(excep)) {
        createContext(null,node,EXCEPTIONS);
      }
    }
  }
  blockStack.push(node);
  visitAnnotations(node);
  blockStack.pop();
  Statement code=node.getCode();
  visitClassCodeContainer(code);
  if (completionOffset < node.getCode().getStart()) {
    createContext(null,node,PARAMETER);
  }
  createContext(node.getCode(),node.getCode(),expressionScriptOrStatement(node));
}
Program: 186066
Project: 186066
Buggy source:
public static Test suite() throws Exception {
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DefaultGroovyMethodCompletionTests.class);
  suite.addTestSuite(LocalVariableCompletionTests.class);
  suite.addTestSuite(InferencingCompletionTests.class);
  suite.addTestSuite(FieldCompletionTests.class);
  suite.addTestSuite(TypeCompletionTests.class);
  suite.addTestSuite(GroovyLikeCompletionTests.class);
  suite.addTestSuite(OtherCompletionTests.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite() throws Exception {
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(DefaultGroovyMethodCompletionTests.class);
  suite.addTestSuite(LocalVariableCompletionTests.class);
  suite.addTestSuite(InferencingCompletionTests.class);
  suite.addTestSuite(FieldCompletionTests.class);
  suite.addTestSuite(MethodCompletionTests.class);
  suite.addTestSuite(TypeCompletionTests.class);
  suite.addTestSuite(GroovyLikeCompletionTests.class);
  suite.addTestSuite(OtherCompletionTests.class);
  return suite;
}
Program: 186067
Project: 186067
Buggy source:
public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  GroovyCompletionProposal proposal=new GroovyCompletionProposal(CompletionProposal.METHOD_REF,context.completionLocation);
  proposal.setCompletion(completionName());
  proposal.setDeclarationSignature(ProposalUtils.createTypeSignature(method.getDeclaringClass()));
  proposal.setName(method.getName().toCharArray());
  proposal.setParameterNames(removeFirst(createParameterNames(method)));
  proposal.setParameterTypeNames(removeFirst(createParameterTypeNames(method)));
  proposal.setReplaceRange(context.completionLocation - context.completionExpression.length(),context.completionLocation - context.completionExpression.length());
  proposal.setFlags(method.getModifiers() & ~Opcodes.ACC_STATIC);
  proposal.setAdditionalFlags(CompletionFlags.Default);
  char[] methodSignature=ProposalUtils.createMethodSignature(method,1);
  proposal.setKey(methodSignature);
  proposal.setSignature(methodSignature);
  proposal.setRelevance(getRelevance(proposal.getName()));
  return new GroovyJavaMethodProposal(proposal,javaContext);
}

Fixed version (ground truth):
public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  GroovyCompletionProposal proposal=new GroovyCompletionProposal(CompletionProposal.METHOD_REF,context.completionLocation);
  proposal.setCompletion(completionName());
  proposal.setDeclarationSignature(ProposalUtils.createTypeSignature(method.getDeclaringClass()));
  proposal.setName(method.getName().toCharArray());
  proposal.setParameterNames(removeFirst(createParameterNames(method)));
  proposal.setParameterTypeNames(removeFirst(createParameterTypeNames(method)));
  proposal.setReplaceRange(context.completionLocation - context.completionExpression.length(),context.completionLocation - context.completionExpression.length());
  proposal.setFlags(method.getModifiers() & ~Opcodes.ACC_STATIC);
  proposal.setAdditionalFlags(CompletionFlags.Default);
  char[] methodSignature=ProposalUtils.createMethodSignature(method,1);
  proposal.setKey(methodSignature);
  proposal.setSignature(methodSignature);
  proposal.setRelevance(getRelevance(proposal.getName()));
  return new GroovyJavaMethodCompletionProposal(proposal,javaContext);
}
Program: 186068
Project: 186068
Buggy source:
public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  return new JavaCompletionProposal(field.getName(),context.completionLocation - context.completionExpression.length(),field.getName().length(),getImageFor(field),createDisplayString(field),getRelevance(field.getName().toCharArray()));
}

Fixed version (ground truth):
public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  return new GroovyJavaFieldCompletionProposal(createProposal(context),getImageFor(field),createDisplayString(field));
}
Program: 186069
Project: 186069
Buggy source:
public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  GroovyCompletionProposal proposal=new GroovyCompletionProposal(CompletionProposal.METHOD_REF,context.completionLocation);
  proposal.setCompletion(completionName());
  proposal.setDeclarationSignature(ProposalUtils.createTypeSignature(method.getDeclaringClass()));
  proposal.setName(method.getName().toCharArray());
  char[][] parameterTypeNames=createParameterTypeNames(method);
  proposal.setParameterTypeNames(parameterTypeNames);
  proposal.setParameterNames(createParameterNames(method,parameterTypeNames));
  proposal.setReplaceRange(context.completionLocation - context.completionExpression.length(),context.completionLocation - context.completionExpression.length());
  proposal.setFlags(method.getModifiers());
  proposal.setAdditionalFlags(CompletionFlags.Default);
  char[] methodSignature=ProposalUtils.createMethodSignature(method);
  proposal.setKey(methodSignature);
  proposal.setSignature(methodSignature);
  proposal.setRelevance(getRelevance(proposal.getName()));
  return new GroovyJavaMethodProposal(proposal,javaContext);
}

Fixed version (ground truth):
public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  GroovyCompletionProposal proposal=new GroovyCompletionProposal(CompletionProposal.METHOD_REF,context.completionLocation);
  proposal.setCompletion(completionName());
  proposal.setDeclarationSignature(ProposalUtils.createTypeSignature(method.getDeclaringClass()));
  proposal.setName(method.getName().toCharArray());
  char[][] parameterTypeNames=createParameterTypeNames(method);
  proposal.setParameterTypeNames(parameterTypeNames);
  proposal.setParameterNames(createParameterNames(method,parameterTypeNames));
  proposal.setReplaceRange(context.completionLocation - context.completionExpression.length(),context.completionLocation - context.completionExpression.length());
  proposal.setFlags(method.getModifiers());
  proposal.setAdditionalFlags(CompletionFlags.Default);
  char[] methodSignature=ProposalUtils.createMethodSignature(method);
  proposal.setKey(methodSignature);
  proposal.setSignature(methodSignature);
  proposal.setRelevance(getRelevance(proposal.getName()));
  return new GroovyJavaMethodCompletionProposal(proposal,javaContext);
}
Program: 186070
Project: 186070
Buggy source:
public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  return new JavaCompletionProposal(property.getName(),context.completionLocation - context.completionExpression.length(),property.getName().length(),getImageFor(property),createDisplayString(property),2000);
}

Fixed version (ground truth):
public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  return new GroovyJavaFieldCompletionProposal(createProposal(context),getImageFor(property),createDisplayString(property));
}
Program: 186071
Project: 186071
Buggy source:
public void methodNameClash(MethodBinding currentMethod,MethodBinding inheritedMethod){
  this.handle(IProblem.MethodNameClash,new String[]{new String(currentMethod.selector),typesAsString(currentMethod.isVarargs(),currentMethod.parameters,false),new String(currentMethod.declaringClass.readableName()),typesAsString(inheritedMethod.isVarargs(),inheritedMethod.parameters,false),new String(inheritedMethod.declaringClass.readableName())},new String[]{new String(currentMethod.selector),typesAsString(currentMethod.isVarargs(),currentMethod.parameters,true),new String(currentMethod.declaringClass.shortReadableName()),typesAsString(inheritedMethod.isVarargs(),inheritedMethod.parameters,true),new String(inheritedMethod.declaringClass.shortReadableName())},currentMethod.sourceStart(),currentMethod.sourceEnd());
}

Fixed version (ground truth):
public void methodNameClash(MethodBinding currentMethod,MethodBinding inheritedMethod){
  if (currentMethod.declaringClass instanceof SourceTypeBinding) {
    SourceTypeBinding stb=(SourceTypeBinding)currentMethod.declaringClass;
    if (stb.scope != null && !stb.scope.shouldReport(IProblem.MethodNameClash)) {
      return;
    }
  }
  this.handle(IProblem.MethodNameClash,new String[]{new String(currentMethod.selector),typesAsString(currentMethod.isVarargs(),currentMethod.parameters,false),new String(currentMethod.declaringClass.readableName()),typesAsString(inheritedMethod.isVarargs(),inheritedMethod.parameters,false),new String(inheritedMethod.declaringClass.readableName())},new String[]{new String(currentMethod.selector),typesAsString(currentMethod.isVarargs(),currentMethod.parameters,true),new String(currentMethod.declaringClass.shortReadableName()),typesAsString(inheritedMethod.isVarargs(),inheritedMethod.parameters,true),new String(inheritedMethod.declaringClass.shortReadableName())},currentMethod.sourceStart(),currentMethod.sourceEnd());
}
Program: 186074
Project: 186074
Buggy source:
public MultiplexingSourceElementRequestorParser(ProblemReporter problemReporter,ISourceElementRequestor requestor,IProblemFactory problemFactory,CompilerOptions options,boolean reportLocalDeclarations,boolean optimizeStringLiterals){
  super(requestor,problemFactory,options,reportLocalDeclarations,optimizeStringLiterals);
  this.groovyRequestor=requestor;
  this.notifier=new SourceElementNotifier(requestor,reportLocalDeclarations);
}

Fixed version (ground truth):
public MultiplexingSourceElementRequestorParser(ProblemReporter problemReporter,ISourceElementRequestor requestor,IProblemFactory problemFactory,CompilerOptions options,boolean reportLocalDeclarations,boolean optimizeStringLiterals){
  super(requestor,problemFactory,options,reportLocalDeclarations,optimizeStringLiterals);
  this.groovyRequestor=requestor;
  this.notifier=new SourceElementNotifier(requestor,reportLocalDeclarations);
  this.parser=new GroovyParser(this.options,problemReporter);
}
Program: 186075
Project: 186075
Buggy source:
@Override public boolean shouldReport(int problem){
  if (problem == IProblem.SuperclassMustBeAClass) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean shouldReport(int problem){
  if (problem == IProblem.SuperclassMustBeAClass) {
    return false;
  }
  if (problem == IProblem.IncompatibleReturnType) {
    return false;
  }
  if (problem == IProblem.AbstractMethodMustBeImplemented) {
    return false;
  }
  if (problem == IProblem.MethodNameClash) {
    return false;
  }
  return true;
}
Program: 186076
Project: 186076
Buggy source:
private Neo4jTemplate neo4jTemplate(Neo4jConnectionCallback connection){
  GraphDatabaseService graphDatabaseService=connection.graphDatabaseService();
  Neo4jTemplate neo4jTemplate=new Neo4jTemplate(graphDatabaseService);
  return neo4jTemplate;
}

Fixed version (ground truth):
private Neo4jTemplate neo4jTemplate(Neo4jConnectionCallback connection){
  GraphDatabaseService graphDatabaseService=connection.graphDatabaseService();
  return new Neo4jTemplate(graphDatabaseService);
}
Program: 186077
Project: 186077
Buggy source:
private Long incrementAndSetValue(final byte[] key,final byte[] field,final long value,byte[] elementToUpdate){
  try {
    long longValue=incrementValue(value,elementToUpdate);
    hset(key,field,Long.toString(value).getBytes("String_Node_Str"));
    return longValue;
  }
 catch (  UnsupportedEncodingException e) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
catch (  NumberFormatException e) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
}

Fixed version (ground truth):
private Long incrementAndSetValue(final byte[] key,final byte[] field,final long value,byte[] elementToUpdate){
  try {
    long longValue=incrementValue(value,elementToUpdate);
    hset(key,field,Long.toString(longValue).getBytes("String_Node_Str"));
    return longValue;
  }
 catch (  UnsupportedEncodingException e) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
catch (  NumberFormatException e) {
    throw new UnsupportedOperationException("String_Node_Str");
  }
}
Program: 186078
Project: 186078
Buggy source:
public Node getNeoNode(){
  return graphDb.getReferenceNode().getSingleRelationship(RelTypes.NEO_NODE,Direction.OUTGOING).getEndNode();
}

Fixed version (ground truth):
public Node getNeoNode(){
  Iterable<Node> allNodes=GlobalGraphOperations.at(graphDb).getAllNodes();
  for (  Node node : allNodes) {
    if ("String_Node_Str".equals(node.getProperty("String_Node_Str"))) {
      return node;
    }
  }
  return null;
}
Program: 186079
Project: 186079
Buggy source:
public Node getNeoNode(){
  return graphDb.getReferenceNode().getSingleRelationship(RelTypes.NEO_NODE,Direction.OUTGOING).getEndNode();
}

Fixed version (ground truth):
public Node getNeoNode(){
  Iterable<Node> allNodes=GlobalGraphOperations.at(graphDb).getAllNodes();
  for (  Node node : allNodes) {
    if ("String_Node_Str".equals(node.getProperty("String_Node_Str"))) {
      return node;
    }
  }
  return null;
}
Program: 186080
Project: 186080
Buggy source:
void processInjectAnnotation(Class<?> clazz,Object testInstance,Object injectionObject){
  if (isTargetSet(testInstance)) {
    Field[] fields=clazz.getDeclaredFields();
    for (    Field field : fields) {
      Annotation injectAnnotation=field.getAnnotation(Inject.class);
      Annotation connectionManagerAnnotation=field.getAnnotation(ConnectionManager.class);
      Annotation byContainerAnnotation=field.getAnnotation(ByContainer.class);
      if (isInjectedAndNotExternallyManaged(injectAnnotation,byContainerAnnotation,connectionManagerAnnotation)) {
        Annotation namedAnnotation=field.getAnnotation(Named.class);
        if (isNamedAnnotationNotPresent(namedAnnotation) || isIdentifierValueInNamedAnnotation(namedAnnotation)) {
          if (field.getType().isInstance(injectionObject)) {
            new FieldSetter(testInstance,field).set(injectionObject);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
void processInjectAnnotation(Class<?> clazz,Object testInstance,Object injectionObject){
  if (isTargetSet(testInstance)) {
    Set<Field> fields=new HashSet<Field>();
    fields.addAll(getFieldsWithAnnotation(clazz,Inject.class));
    fields.addAll(getFieldsWithAnnotation(clazz,ConnectionManager.class));
    fields.addAll(getFieldsWithAnnotation(clazz,ByContainer.class));
    for (    Field field : fields) {
      Annotation injectAnnotation=field.getAnnotation(Inject.class);
      Annotation connectionManagerAnnotation=field.getAnnotation(ConnectionManager.class);
      Annotation byContainerAnnotation=field.getAnnotation(ByContainer.class);
      if (isInjectedAndNotExternallyManaged(injectAnnotation,byContainerAnnotation,connectionManagerAnnotation)) {
        Annotation namedAnnotation=field.getAnnotation(Named.class);
        if (isNamedAnnotationNotPresent(namedAnnotation) || isIdentifierValueInNamedAnnotation(namedAnnotation)) {
          if (field.getType().isInstance(injectionObject)) {
            new FieldSetter(testInstance,field).set(injectionObject);
          }
        }
      }
    }
  }
}
Program: 186081
Project: 186081
Buggy source:
public Long del(final String... keys){
  byte[][] arrayOfFields=with(keys).convert(toByteArray()).toArray(new byte[keys.length][]);
  return this.del(arrayOfFields);
}

Fixed version (ground truth):
@Override public Long del(String key){
  return this.del(key.getBytes());
}
Program: 186082
Project: 186082
Buggy source:
@Override public Long lpushx(String key,String string){
  return this.lpushx(toByteArray().convert(key),toByteArray().convert(string));
}

Fixed version (ground truth):
@Override public Long lpushx(String key,String... values){
  long lastSize=this.listDatatypeOperations.llen(key.getBytes());
  for (  String value : values) {
    lastSize=this.lpushx(key,value);
  }
  return lastSize;
}
Program: 186083
Project: 186083
Buggy source:
@Override public Boolean setbit(String key,long offset,boolean value){
  return this.setbit(toByteArray().convert(key),offset,toBooleanByteArray().convert(value));
}

Fixed version (ground truth):
@Override public Boolean setbit(String key,long offset,String value){
  return this.setbit(key.getBytes(),offset,value.getBytes());
}
Program: 186084
Project: 186084
Buggy source:
@Override public Long rpushx(String key,String string){
  return this.rpushx(toByteArray().convert(key),toByteArray().convert(string));
}

Fixed version (ground truth):
@Override public Long rpushx(String key,String... values){
  long lastSize=this.listDatatypeOperations.llen(key.getBytes());
  for (  String value : values) {
    lastSize=this.rpushx(key,value);
  }
  return lastSize;
}
Program: 186085
Project: 186085
Buggy source:
public Long move(final byte[] key,final int dbIndex){
  return this.move(key,dbIndex);
}

Fixed version (ground truth):
@Override public Long move(String key,int dbIndex){
  return this.move(key.getBytes(),dbIndex);
}
Program: 186086
Project: 186086
Buggy source:
/** 
 * Remove the first count occurrences of the value element from the list. If count is zero all the elements are removed. If count is negative elements are removed from tail to head, instead to go from head to tail that is the normal behaviour. So for example LREM with count -2 and hello as value to remove against the list (a,b,c,hello,x,hello,hello) will have the list (a,b,c,hello,x). The number of removed elements is returned as an integer, see below for more information about the returned value. Note that non existing keys are considered like empty lists by LREM, so LREM against non existing keys will always return 0. <p> Time complexity: O(N) (with N being the length of the list)
 * @param key
 * @param count
 * @param value
 * @return Integer Reply, specifically: The number of removed elements ifthe operation succeeded
 */
public Long lrem(final byte[] key,final int count,final byte[] value){
  ByteBuffer wrappedKey=wrap(key);
  ByteBuffer wrappedValue=wrap(value);
  long numberOfElementsRemoved=0;
  if (count < 0) {
    numberOfElementsRemoved=removeLastElements(count,wrappedKey,wrappedValue);
  }
 else {
    if (count == 0) {
      numberOfElementsRemoved=removeAllElements(wrappedKey,wrappedValue);
    }
 else {
      numberOfElementsRemoved=removeFirstElements(count,wrappedKey,wrappedValue);
    }
  }
  return numberOfElementsRemoved;
}

Fixed version (ground truth):
/** 
 * Remove the first count occurrences of the value element from the list. If count is zero all the elements are removed. If count is negative elements are removed from tail to head, instead to go from head to tail that is the normal behaviour. So for example LREM with count -2 and hello as value to remove against the list (a,b,c,hello,x,hello,hello) will have the list (a,b,c,hello,x). The number of removed elements is returned as an integer, see below for more information about the returned value. Note that non existing keys are considered like empty lists by LREM, so LREM against non existing keys will always return 0. <p> Time complexity: O(N) (with N being the length of the list)
 * @param key
 * @param count
 * @param value
 * @return Integer Reply, specifically: The number of removed elements ifthe operation succeeded
 */
public Long lrem(final byte[] key,final long count,final byte[] value){
  ByteBuffer wrappedKey=wrap(key);
  ByteBuffer wrappedValue=wrap(value);
  long numberOfElementsRemoved=0;
  if (count < 0) {
    numberOfElementsRemoved=removeLastElements((int)count,wrappedKey,wrappedValue);
  }
 else {
    if (count == 0) {
      numberOfElementsRemoved=removeAllElements(wrappedKey,wrappedValue);
    }
 else {
      numberOfElementsRemoved=removeFirstElements((int)count,wrappedKey,wrappedValue);
    }
  }
  return numberOfElementsRemoved;
}
Program: 186087
Project: 186087
Buggy source:
/** 
 * Return the specified element of the list stored at the specified key. 0 is the first element, 1 the second and so on. Negative indexes are supported, for example -1 is the last element, -2 the penultimate and so on. <p> If the value stored at key is not of list type an error is returned. If the index is out of range a 'nil' reply is returned. <p> Note that even if the average time complexity is O(n) asking for the first or the last element of the list is O(1). <p>
 * @param key
 * @param index
 * @return Bulk reply, specifically the requested element
 */
public byte[] lindex(final byte[] key,final int index){
  ByteBuffer elementAtIndex=this.blockingMultimap.getElement(wrap(key),index);
  return elementAtIndex == null ? null : elementAtIndex.array();
}

Fixed version (ground truth):
/** 
 * Return the specified element of the list stored at the specified key. 0 is the first element, 1 the second and so on. Negative indexes are supported, for example -1 is the last element, -2 the penultimate and so on. <p> If the value stored at key is not of list type an error is returned. If the index is out of range a 'nil' reply is returned. <p> Note that even if the average time complexity is O(n) asking for the first or the last element of the list is O(1). <p>
 * @param key
 * @param index
 * @return Bulk reply, specifically the requested element
 */
public byte[] lindex(final byte[] key,final long index){
  ByteBuffer elementAtIndex=this.blockingMultimap.getElement(wrap(key),(int)index);
  return elementAtIndex == null ? null : elementAtIndex.array();
}
Program: 186090
Project: 186090
Buggy source:
public EmbeddedJedis(){
  hashDatatypeOperations=new HashDatatypeOperations();
  listDatatypeOperations=new ListDatatypeOperations();
  setDatatypeOperations=new SetDatatypeOperations();
  sortsetDatatypeOperations=new SortsetDatatypeOperations();
  stringDatatypeOperations=new StringDatatypeOperations();
  pubSubServerOperations=new PubSubServerOperations();
  connectionServerOperations=new ConnectionServerOperations();
  scriptingServerOperations=new ScriptingServerOperations();
  transactionServerOperations=new TransactionServerOperations();
  keysServerOperations=KeysServerOperations.createKeysServerOperations(hashDatatypeOperations,listDatatypeOperations,setDatatypeOperations,sortsetDatatypeOperations,stringDatatypeOperations);
}

Fixed version (ground truth):
public EmbeddedJedis(){
  hashDatatypeOperations=new HashDatatypeOperations();
  listDatatypeOperations=new ListDatatypeOperations();
  setDatatypeOperations=new SetDatatypeOperations();
  sortsetDatatypeOperations=new SortsetDatatypeOperations();
  stringDatatypeOperations=new StringDatatypeOperations();
  pubSubServerOperations=new PubSubServerOperations();
  connectionServerOperations=new ConnectionServerOperations();
  scriptingServerOperations=new ScriptingServerOperations();
  transactionServerOperations=new TransactionServerOperations(this);
  keysServerOperations=KeysServerOperations.createKeysServerOperations(hashDatatypeOperations,listDatatypeOperations,setDatatypeOperations,sortsetDatatypeOperations,stringDatatypeOperations);
}
Program: 186091
Project: 186091
Buggy source:
private void insertIndexes(DB mongoDb,String collectionName,DBObject collection){
  DBCollection indexedCollection=mongoDb.getCollection(collectionName);
  BasicDBList indexes=(BasicDBList)collection.get(INDEXES);
  for (  Object object : indexes) {
    DBObject index=(DBObject)object;
    DBObject indexKeys=(DBObject)index.get(INDEX);
    if (index.containsField(INDEX_OPTIONS)) {
      DBObject indexOptions=(DBObject)index.get(INDEX_OPTIONS);
      indexedCollection.createIndex(indexKeys,indexOptions);
    }
 else {
      indexedCollection.createIndex(indexKeys);
    }
  }
}

Fixed version (ground truth):
private void insertIndexes(DB mongoDb,String collectionName,DBObject collection){
  DBCollection indexedCollection=mongoDb.getCollection(collectionName);
  BasicDBList indexes=(BasicDBList)collection.get(INDEXES);
  for (  Object object : indexes) {
    DBObject index=(DBObject)object;
    DBObject indexKeys=(DBObject)index.get(INDEX);
    if (index.containsField(INDEX_OPTIONS)) {
      DBObject indexOptions=(DBObject)index.get(INDEX_OPTIONS);
      indexedCollection.ensureIndex(indexKeys,indexOptions);
    }
 else {
      indexedCollection.ensureIndex(indexKeys);
    }
  }
}
Program: 186092
Project: 186092
Buggy source:
private void verifyIndexCreationCommand(DBObject indexDocument,DBCollection collection){
  final ArgumentCaptor<DBObject> indexCommandCaptor=ArgumentCaptor.forClass(DBObject.class);
  verify(collection,times(1)).createIndex(indexCommandCaptor.capture());
  assertThat(indexCommandCaptor.getValue(),is(indexDocument));
}

Fixed version (ground truth):
private void verifyIndexCreationCommand(DBObject indexDocument,DBCollection collection){
  final ArgumentCaptor<DBObject> indexCommandCaptor=ArgumentCaptor.forClass(DBObject.class);
  verify(collection,times(1)).ensureIndex(indexCommandCaptor.capture());
  assertThat(indexCommandCaptor.getValue(),is(indexDocument));
}
Program: 186093
Project: 186093
Buggy source:
private void verifyIndexCreationCommandAndOptions(DBObject indexDocument,DBObject indexOptions,DBCollection collection){
  final ArgumentCaptor<DBObject> indexCommandCaptor=ArgumentCaptor.forClass(DBObject.class);
  final ArgumentCaptor<DBObject> indexOptionCommandCaptor=ArgumentCaptor.forClass(DBObject.class);
  verify(collection,times(1)).createIndex(indexCommandCaptor.capture(),indexOptionCommandCaptor.capture());
  assertThat(indexCommandCaptor.getValue(),is(indexDocument));
  assertThat(indexOptionCommandCaptor.getValue(),is(indexOptions));
}

Fixed version (ground truth):
private void verifyIndexCreationCommandAndOptions(DBObject indexDocument,DBObject indexOptions,DBCollection collection){
  final ArgumentCaptor<DBObject> indexCommandCaptor=ArgumentCaptor.forClass(DBObject.class);
  final ArgumentCaptor<DBObject> indexOptionCommandCaptor=ArgumentCaptor.forClass(DBObject.class);
  verify(collection,times(1)).ensureIndex(indexCommandCaptor.capture(),indexOptionCommandCaptor.capture());
  assertThat(indexCommandCaptor.getValue(),is(indexDocument));
  assertThat(indexOptionCommandCaptor.getValue(),is(indexOptions));
}
Program: 186094
Project: 186094
Buggy source:
@Override public List<byte[]> keys(){
  return new ArrayList<byte[]>(convert(this.hashElements.columnKeySet(),ByteBuffer2ByteArrayConverter.createByteBufferConverter()));
}

Fixed version (ground truth):
@Override public List<byte[]> keys(){
  return new ArrayList<byte[]>(convert(this.hashElements.rowKeySet(),ByteBuffer2ByteArrayConverter.createByteBufferConverter()));
}
Program: 186095
Project: 186095
Buggy source:
private void writeRelationships(List<Relationship> relationships,XMLStreamWriter writer) throws XMLStreamException {
  for (  Relationship edge : relationships) {
    writer.writeStartElement(GraphMLTokens.EDGE);
    writer.writeAttribute(GraphMLTokens.ID,Long.toString(edge.getId()));
    writer.writeAttribute(GraphMLTokens.SOURCE,Long.toString(edge.getStartNode().getId()));
    writer.writeAttribute(GraphMLTokens.TARGET,Long.toString(edge.getEndNode().getId()));
    writer.writeAttribute(GraphMLTokens.LABEL,edge.getType().name());
    for (    String key : edge.getPropertyKeys()) {
      writer.writeStartElement(GraphMLTokens.DATA);
      writer.writeAttribute(GraphMLTokens.KEY,key);
      Object value=edge.getProperty(key);
      if (null != value) {
        writer.writeCharacters(value.toString());
      }
      writer.writeEndElement();
    }
    writer.writeEndElement();
  }
}

Fixed version (ground truth):
private void writeRelationships(List<Relationship> relationships,XMLStreamWriter writer) throws XMLStreamException {
  for (  Relationship edge : relationships) {
    writer.writeStartElement(GraphMLTokens.EDGE);
    writer.writeAttribute(GraphMLTokens.ID,Long.toString(edge.getId()));
    writer.writeAttribute(GraphMLTokens.SOURCE,Long.toString(edge.getStartNode().getId()));
    writer.writeAttribute(GraphMLTokens.TARGET,Long.toString(edge.getEndNode().getId()));
    writer.writeAttribute(GraphMLTokens.LABEL,edge.getType().name());
    for (    String key : edge.getPropertyKeys()) {
      writer.writeStartElement(GraphMLTokens.DATA);
      writer.writeAttribute(GraphMLTokens.KEY,key);
      Object value=edge.getProperty(key);
      if (null != value) {
        if (TypeCaster.isArray(value)) {
          writeArray(value,writer);
        }
 else {
          writer.writeCharacters(value.toString());
        }
      }
      writer.writeEndElement();
    }
    writer.writeEndElement();
  }
}
Program: 186096
Project: 186096
Buggy source:
public static Object typeCastValue(String key,String value,Map<String,String> keyTypes){
  String type=keyTypes.get(key);
  if (null == type || type.equals(GraphMLTokens.STRING))   return value;
 else   if (type.equals(GraphMLTokens.FLOAT))   return Float.valueOf(value);
 else   if (type.equals(GraphMLTokens.INT))   return Integer.valueOf(value);
 else   if (type.equals(GraphMLTokens.DOUBLE))   return Double.valueOf(value);
 else   if (type.equals(GraphMLTokens.BOOLEAN))   return Boolean.valueOf(value);
 else   if (type.equals(GraphMLTokens.LONG))   return Long.valueOf(value);
 else   return value;
}

Fixed version (ground truth):
public static Object typeCastValue(String key,String value,Map<String,String> keyTypes){
  String type=keyTypes.get(key);
  if (null == type || type.equals(GraphMLTokens.STRING))   return value;
 else   if (type.equals(GraphMLTokens.FLOAT))   return Float.valueOf(value);
 else   if (type.equals(GraphMLTokens.INT))   return Integer.valueOf(value);
 else   if (type.equals(GraphMLTokens.DOUBLE))   return Double.valueOf(value);
 else   if (type.equals(GraphMLTokens.BOOLEAN))   return Boolean.valueOf(value);
 else   if (type.equals(GraphMLTokens.LONG))   return Long.valueOf(value);
 else   if (type.contains("String_Node_Str"))   return castToArray(type,value);
 else   return value;
}
Program: 186097
Project: 186097
Buggy source:
public static String getStringType(final Object object){
  if (object instanceof String) {
    return GraphMLTokens.STRING;
  }
 else   if (object instanceof Integer) {
    return GraphMLTokens.INT;
  }
 else   if (object instanceof Long) {
    return GraphMLTokens.LONG;
  }
 else   if (object instanceof Float) {
    return GraphMLTokens.FLOAT;
  }
 else   if (object instanceof Double) {
    return GraphMLTokens.DOUBLE;
  }
 else   if (object instanceof Boolean) {
    return GraphMLTokens.BOOLEAN;
  }
 else {
    return GraphMLTokens.STRING;
  }
}

Fixed version (ground truth):
public static String getStringType(final Object object){
  if (object instanceof String) {
    return GraphMLTokens.STRING;
  }
 else   if (object instanceof Integer) {
    return GraphMLTokens.INT;
  }
 else   if (object instanceof Long) {
    return GraphMLTokens.LONG;
  }
 else   if (object instanceof Float) {
    return GraphMLTokens.FLOAT;
  }
 else   if (object instanceof Double) {
    return GraphMLTokens.DOUBLE;
  }
 else   if (object instanceof Boolean) {
    return GraphMLTokens.BOOLEAN;
  }
 else   if (isArray(object)) {
    return object.getClass().getSimpleName();
  }
 else {
    return GraphMLTokens.STRING;
  }
}
Program: 186098
Project: 186098
Buggy source:
@Test @UsingDataSet(locations="String_Node_Str",loadStrategy=LoadStrategyEnum.CLEAN_INSERT) public void neo_node_should_be_returned(){
  MatrixManager matrixManager=new MatrixManager(graphDatabaseService);
  Node neo=matrixManager.getNeoNode();
  assertThat((String)neo.getProperty("String_Node_Str"),is("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void neo_node_should_be_returned(){
  MatrixManager matrixManager=new MatrixManager(graphDatabaseService);
  Node neo=matrixManager.getNeoNode();
  assertThat((String)neo.getProperty("String_Node_Str"),is("String_Node_Str"));
}
Program: 186099
Project: 186099
Buggy source:
@Test @UsingDataSet(withSelectiveLocations={@Selective(identifier="String_Node_Str",locations="String_Node_Str")},loadStrategy=LoadStrategyEnum.CLEAN_INSERT) public void should_replicate_data_into_slave_node() throws InterruptedException {
  String theHobbitTitle=masterConnection.hget("String_Node_Str","String_Node_Str");
  assertThat(theHobbitTitle,is("String_Node_Str"));
  TimeUnit.SECONDS.sleep(5);
  theHobbitTitle=slaveConnection.hget("String_Node_Str","String_Node_Str");
  assertThat(theHobbitTitle,is("String_Node_Str"));
}

Fixed version (ground truth):
@Test @UsingDataSet(withSelectiveLocations={@Selective(identifier="String_Node_Str",locations="String_Node_Str")},loadStrategy=LoadStrategyEnum.CLEAN_INSERT) public void should_replicate_data_into_slave_node() throws InterruptedException {
  String theHobbitTitle=masterConnection.hget("String_Node_Str","String_Node_Str");
  assertThat(theHobbitTitle,is("String_Node_Str"));
  TimeUnit.SECONDS.sleep(5);
  Jedis slaveConnection=new Jedis("String_Node_Str",6380);
  theHobbitTitle=slaveConnection.hget("String_Node_Str","String_Node_Str");
  assertThat(theHobbitTitle,is("String_Node_Str"));
}
Program: 186100
Project: 186100
Buggy source:
public MongoOperation(MongoDbConfiguration mongoDbConfiguration){
  try {
    this.mongo=mongoDbConfiguration.getMongo();
    this.mongo.setWriteConcern(WriteConcern.SAFE);
    this.mongoDbConfiguration=mongoDbConfiguration;
    this.setInsertionStrategy(new DefaultInsertionStrategy());
    this.setComparisonStrategy(new DefaultComparisonStrategy());
  }
 catch (  MongoException e) {
    throw new IllegalArgumentException(e);
  }
}

Fixed version (ground truth):
public MongoOperation(MongoDbConfiguration mongoDbConfiguration){
  try {
    this.mongo=mongoDbConfiguration.getMongo();
    this.mongo.setWriteConcern(mongoDbConfiguration.getWriteConcern());
    this.mongoDbConfiguration=mongoDbConfiguration;
    this.setInsertionStrategy(new DefaultInsertionStrategy());
    this.setComparisonStrategy(new DefaultComparisonStrategy());
  }
 catch (  MongoException e) {
    throw new IllegalArgumentException(e);
  }
}
Program: 186101
Project: 186101
Buggy source:
public MongoDbConfiguration configure(){
  if (this.serverAddresses.isEmpty()) {
    addDefaultSeed();
  }
  MongoClient mongoClient=new MongoClient(this.serverAddresses);
  if (this.enableSharding) {
    enableSharding(mongoClient);
  }
  mongoClient.setWriteConcern(writeConcern);
  mongoDbConfiguration.setMongo(mongoClient);
  return mongoDbConfiguration;
}

Fixed version (ground truth):
public MongoDbConfiguration configure(){
  if (this.serverAddresses.isEmpty()) {
    addDefaultSeed();
  }
  MongoClient mongoClient=new MongoClient(this.serverAddresses);
  if (this.enableSharding) {
    enableSharding(mongoClient);
  }
  mongoDbConfiguration.setWriteConcern(writeConcern);
  mongoDbConfiguration.setMongo(mongoClient);
  return mongoDbConfiguration;
}
Program: 186102
Project: 186102
Buggy source:
@Test public void insert_opertation_should_add_indexes_into_remote_graph(){
  GraphDatabaseService newEmbeddedDatabase=new GraphDatabaseFactory().newEmbeddedDatabase(DB_PATH);
  WrappingNeoServerBootstrapper graphDb=new WrappingNeoServerBootstrapper((GraphDatabaseAPI)newEmbeddedDatabase);
  graphDb.start();
  RestGraphDatabase graphDatabaseService=new RestGraphDatabase("String_Node_Str");
  Neo4jConfiguration neo4jConfiguration=new Neo4jConfiguration();
  neo4jConfiguration.setGraphDatabaseService(graphDatabaseService);
  Neo4jOperation neo4jOperation=new Neo4jOperation(graphDatabaseService);
  neo4jOperation.insert(new ByteArrayInputStream(WELL_FORMED_GRAPH_WITH_MANUAL_INDEX.getBytes()));
  String[] nodeIndexNames=graphDatabaseService.index().nodeIndexNames();
  assertThat(nodeIndexNames,arrayContainingInAnyOrder("String_Node_Str"));
  newEmbeddedDatabase.shutdown();
}

Fixed version (ground truth):
@Test public void insert_opertation_should_add_indexes_into_remote_graph(){
  GraphDatabaseService newEmbeddedDatabase=new GraphDatabaseFactory().newEmbeddedDatabase(DB_PATH);
  WrappingNeoServerBootstrapper graphDb=new WrappingNeoServerBootstrapper((GraphDatabaseAPI)newEmbeddedDatabase);
  graphDb.start();
  RestGraphDatabase graphDatabaseService=new RestGraphDatabase("String_Node_Str");
  Neo4jConfiguration neo4jConfiguration=new Neo4jConfiguration();
  neo4jConfiguration.setGraphDatabaseService(graphDatabaseService);
  Neo4jOperation neo4jOperation=new Neo4jOperation(graphDatabaseService);
  neo4jOperation.insert(new ByteArrayInputStream(WELL_FORMED_GRAPH_WITH_MANUAL_INDEX.getBytes()));
  String[] nodeIndexNames=graphDatabaseService.index().nodeIndexNames();
  assertThat(nodeIndexNames,arrayContainingInAnyOrder("String_Node_Str"));
  neo4jOperation.deleteAll();
  graphDb.stop();
}
Program: 186104
Project: 186104
Buggy source:
@Override public void run(){
  Process pwd;
  try {
    pwd=startProcess();
    consoleOutput=getConsoleOutput(pwd);
  }
 catch (  IOException e) {
    throw prepareException(e);
  }
 finally {
    processIsReady.countDown();
  }
  try {
    pwd.waitFor();
    if (pwd.exitValue() != 0) {
      throw new IllegalStateException("String_Node_Str" + mongodPath + DBPATH_ARGUMENT_NAME+ dbRelativePath+ PORT_ARGUMENT_NAME+ port+ LOGPATH_ARGUMENT_NAME+ logRelativePath+ "String_Node_Str"+ consoleOutput);
    }
  }
 catch (  InterruptedException ie) {
    throw prepareException(ie);
  }
}

Fixed version (ground truth):
@Override public void run(){
  Process pwd;
  try {
    pwd=startProcess();
    consoleOutput=getConsoleOutput(pwd);
  }
 catch (  IOException e) {
    throw prepareException(e);
  }
 finally {
    processIsReady.countDown();
  }
  try {
    pwd.waitFor();
    if (pwd.exitValue() != 0) {
      LOGGER.info("String_Node_Str" + mongodPath + DBPATH_ARGUMENT_NAME+ dbRelativePath+ PORT_ARGUMENT_NAME+ port+ LOGPATH_ARGUMENT_NAME+ logRelativePath+ "String_Node_Str"+ consoleOutput);
    }
  }
 catch (  InterruptedException ie) {
    throw prepareException(ie);
  }
}
Program: 186105
Project: 186105
Buggy source:
@Override public void doStart() throws Throwable {
  LOGGER.info("String_Node_Str",mongodPath);
  ready=true;
  File dbPath=ensureDbPathDoesNotExitsAndReturnCompositePath();
  if (dbPath.mkdirs()) {
    startMongoDBAsADaemon();
    boolean isServerUp=assertThatConnectionToMongoDbIsPossible(NUM_RETRIES_TO_CHECK_SERVER_UP);
    if (!isServerUp) {
      throw new IllegalStateException("String_Node_Str" + this.mongodPath + "String_Node_Str"+ port);
    }
  }
 else {
    throw new IllegalStateException("String_Node_Str" + dbPath + "String_Node_Str");
  }
  LOGGER.info("String_Node_Str",mongodPath);
}

Fixed version (ground truth):
@Override public void doStart() throws Throwable {
  LOGGER.info("String_Node_Str",mongodPath);
  ready=true;
  File dbPath=ensureDbPathDoesNotExitsAndReturnCompositePath();
  if (dbPath.mkdirs()) {
    startMongoDBAsADaemon();
    boolean isServerUp=assertThatConnectionToMongoDbIsPossible();
    if (!isServerUp) {
      throw new IllegalStateException("String_Node_Str" + this.mongodPath + "String_Node_Str"+ port);
    }
  }
 else {
    throw new IllegalStateException("String_Node_Str" + dbPath + "String_Node_Str");
  }
  LOGGER.info("String_Node_Str",mongodPath);
}
Program: 186106
Project: 186106
Buggy source:
private boolean assertThatConnectionToMongoDbIsPossible(int retries) throws InterruptedException, UnknownHostException {
  return this.mongoDbLowLevelOps.assertThatConnectionIsPossible(LOCALHOST,port,retries);
}

Fixed version (ground truth):
private boolean assertThatConnectionToMongoDbIsPossible() throws InterruptedException, UnknownHostException {
  return this.mongoDbLowLevelOps.assertThatConnectionIsPossible(LOCALHOST,port);
}
Program: 186107
Project: 186107
Buggy source:
public boolean assertThatConnectionIsPossible(String host,int port,int retries) throws InterruptedException, UnknownHostException, MongoException {
  int currentRetry=0;
  boolean connectionIsPossible=false;
  Mongo server=null;
  try {
    do {
      TimeUnit.SECONDS.sleep(3);
      server=new Mongo(host,port);
      DB db=server.getDB("String_Node_Str");
      try {
        db.getStats();
        connectionIsPossible=true;
      }
 catch (      MongoException e) {
        currentRetry++;
      }
    }
 while (!connectionIsPossible && currentRetry <= retries);
  }
  finally {
    server.close();
  }
  return connectionIsPossible;
}

Fixed version (ground truth):
public boolean assertThatConnectionIsPossible(String host,int port) throws InterruptedException, UnknownHostException, MongoException {
  int currentRetry=0;
  boolean connectionIsPossible=false;
  Mongo server=null;
  try {
    do {
      TimeUnit.SECONDS.sleep(WAIT_TIME);
      server=new Mongo(host,port);
      DB db=server.getDB("String_Node_Str");
      try {
        db.getStats();
        connectionIsPossible=true;
      }
 catch (      MongoException e) {
        currentRetry++;
      }
    }
 while (!connectionIsPossible && currentRetry <= MAX_RETRIES);
  }
  finally {
    server.close();
  }
  return connectionIsPossible;
}
Program: 186111
Project: 186111
Buggy source:
@Override public void insert(InputStream dataScript){
  InputStreamJsonDataSet dataSet=new InputStreamJsonDataSet(dataScript);
  DataLoader dataLoader=new DataLoader(cassandraConfiguration.getClusterName(),getFullHost());
  dataLoader.load(dataSet);
  keyspace=HFactory.createKeyspace(dataSet.getKeyspace().getName(),cluster);
}

Fixed version (ground truth):
@Override public void insert(InputStream dataScript){
  if (this.insertationStrategy instanceof CassandraInsertationStrategy) {
    insertData(dataScript);
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 186112
Project: 186112
Buggy source:
public CassandraOperation(CassandraConfiguration cassandraConfiguration){
  this.cassandraConfiguration=cassandraConfiguration;
  cluster=HFactory.getOrCreateCluster(cassandraConfiguration.getClusterName(),getFullHost());
}

Fixed version (ground truth):
public CassandraOperation(CassandraConfiguration cassandraConfiguration){
  this.cassandraConfiguration=cassandraConfiguration;
  cluster=HFactory.getOrCreateCluster(cassandraConfiguration.getClusterName(),getFullHost());
  setInsertationStrategy(new DefaultCassandraInsertationStrategy());
  setComparisionStrategy(new DefaultCassandraComparisionStrategy());
}
Program: 186113
Project: 186113
Buggy source:
@Override public boolean databaseIs(InputStream expectedData){
  CassandraAssertion.strictAssertEquals(new InputStreamJsonDataSet(expectedData),cluster,keyspace);
  return true;
}

Fixed version (ground truth):
@Override public boolean databaseIs(InputStream expectedData){
  return compareData(expectedData);
}
Program: 186115
Project: 186115
Buggy source:
@Override public void evaluate() throws Throwable {
  target=testObject;
  defaultDataSetLocationResolver=new DefaultDataSetLocationResolver(testObject.getClass());
  UsingDataSet usingDataSet=getUsingDataSetAnnotation();
  if (isTestAnnotatedWithDataSet(usingDataSet)) {
    loadDataSet(usingDataSet,method);
  }
  injectAnnotationProcessor.processInjectAnnotation(testObject.getClass(),target,getDatabaseOperation().connectionManager());
  base.evaluate();
  ShouldMatchDataSet shouldMatchDataSet=getShouldMatchDataSetAnnotation();
  if (isTestAnnotatedWithExpectedDataSet(shouldMatchDataSet)) {
    assertExpectation(shouldMatchDataSet);
  }
}

Fixed version (ground truth):
@Override public void evaluate() throws Throwable {
  target=testObject;
  defaultDataSetLocationResolver=new DefaultDataSetLocationResolver(testObject.getClass());
  UsingDataSet usingDataSet=getUsingDataSetAnnotation();
  if (isTestAnnotatedWithDataSet(usingDataSet)) {
    createCustomInsertationStrategyIfPresent();
    loadDataSet(usingDataSet,method);
  }
  injectAnnotationProcessor.processInjectAnnotation(testObject.getClass(),target,getDatabaseOperation().connectionManager());
  base.evaluate();
  ShouldMatchDataSet shouldMatchDataSet=getShouldMatchDataSetAnnotation();
  if (isTestAnnotatedWithExpectedDataSet(shouldMatchDataSet)) {
    createCustomComparisionStrategyIfPresent();
    assertExpectation(shouldMatchDataSet);
  }
}
Program: 186116
Project: 186116
Buggy source:
public List<Book> findAll(){
  LOGGER.debug("String_Node_Str" + booksCollection.getName());
  List<Book> books=new ArrayList<Book>();
  DBCursor findAll=booksCollection.find();
  LOGGER.debug("String_Node_Str" + findAll.count());
  while (findAll.hasNext()) {
    books.add(DB_OBJECT_BOOK_CONVERTER.convert(findAll.next()));
  }
  return books;
}

Fixed version (ground truth):
public List<Book> findAll(){
  LOGGER.debug("String_Node_Str" + booksCollection.getName());
  List<Book> books=new ArrayList<Book>();
  DBCursor findAll=booksCollection.find();
  while (findAll.hasNext()) {
    books.add(DB_OBJECT_BOOK_CONVERTER.convert(findAll.next()));
  }
  return books;
}
Program: 186117
Project: 186117
Buggy source:
@Test @UsingDataSet(locations="String_Node_Str",loadStrategy=LoadStrategyEnum.CLEAN_INSERT) public void manager_should_return_all_inserted_books(){
  BookManager bookManager=new BookManager(MongoDbUtil.getCollection(Book.class.getSimpleName()));
  List<Book> books=bookManager.findAll();
  Book expectedBook=new Book("String_Node_Str",293);
  assertThat(books,hasSize(1));
  assertThat(expectedBook,isIn(books));
}

Fixed version (ground truth):
@Test @UsingDataSet(locations="String_Node_Str",loadStrategy=LoadStrategyEnum.CLEAN_INSERT) public void manager_should_return_all_inserted_books(){
  BookManager bookManager=new BookManager(bookCollection());
  List<Book> books=bookManager.findAll();
  Book expectedBook=new Book("String_Node_Str",293);
  assertThat(books,hasSize(1));
  assertThat(expectedBook,isIn(books));
}
Program: 186118
Project: 186118
Buggy source:
@Test @UsingDataSet(loadStrategy=LoadStrategyEnum.DELETE_ALL) public void manager_should_return_empty_list_when_no_books(){
  BookManager bookManager=new BookManager(MongoDbUtil.getCollection(Book.class.getSimpleName()));
  List<Book> books=bookManager.findAll();
  assertThat(books,hasSize(0));
}

Fixed version (ground truth):
@Test @UsingDataSet(loadStrategy=LoadStrategyEnum.DELETE_ALL) public void manager_should_return_empty_list_when_no_books(){
  BookManager bookManager=new BookManager(bookCollection());
  List<Book> books=bookManager.findAll();
  assertThat(books,hasSize(0));
}