nus-yam/ex-repair huggingface dataset:
Program: 32697
Project: 32697
Buggy source:
@Test public void query(){
  try {
    db.createCollection(COLLECTION_NAME,null);
    for (int i=0; i < 10; i++) {
      db.collection(COLLECTION_NAME).insertDocument(new BaseDocument(),null);
    }
    final ArangoCursor<String> cursor=db.query("String_Node_Str",null,null,String.class);
    assertThat(cursor,is(notNullValue()));
    final Iterator<String> iterator=cursor.iterator();
    assertThat(iterator,is(notNullValue()));
    for (int i=0; i < 10; i++) {
      assertThat(iterator.hasNext(),is(i != 10));
    }
  }
  finally {
    db.collection(COLLECTION_NAME).drop();
  }
}

Fixed version (ground truth):
@Test public void query(){
  try {
    db.createCollection(COLLECTION_NAME,null);
    for (int i=0; i < 10; i++) {
      db.collection(COLLECTION_NAME).insertDocument(new BaseDocument(),null);
    }
    final ArangoCursor<String> cursor=db.query("String_Node_Str",null,null,String.class);
    assertThat(cursor,is(notNullValue()));
    final Iterator<String> iterator=cursor.iterator();
    assertThat(iterator,is(notNullValue()));
    for (int i=0; i < 10; i++, iterator.next()) {
      assertThat(iterator.hasNext(),is(i != 10));
    }
  }
  finally {
    db.collection(COLLECTION_NAME).drop();
  }
}
Program: 32698
Project: 32698
Buggy source:
/** 
 * Revokes access to the database dbname for user user. You need permission to the _system database in order to execute this call.
 * @see <a href=
	 *      "https://docs.arangodb.com/current/HTTP/UserManagement/index.html#grant-or-revoke-database-access">API
	 *      Documentation</a>
 * @param user The name of the user
 * @return void
 */
public CompletableFuture<Void> revokeAccessAsync(final String user){
  final Request request=new Request(ArangoDBConstants.SYSTEM,RequestType.PUT,createPath(ArangoDBConstants.PATH_API_USER,user,ArangoDBConstants.DATABASE,name));
  request.setBody(serialize(OptionsBuilder.build(new UserAccessOptions(),ArangoDBConstants.NONE)));
  return execute(Void.class,request);
}

Fixed version (ground truth):
/** 
 * Revokes access to the database dbname for user user. You need permission to the _system database in order to execute this call.
 * @see <a href= "https://docs.arangodb.com/current/HTTP/UserManagement/index.html#grant-or-revoke-database-access">
	 *      API Documentation</a>
 * @param user The name of the user
 * @return void
 */
public CompletableFuture<Void> revokeAccessAsync(final String user){
  final Request request=new Request(ArangoDBConstants.SYSTEM,RequestType.PUT,createPath(ArangoDBConstants.PATH_API_USER,user,ArangoDBConstants.DATABASE,name));
  request.setBody(serialize(OptionsBuilder.build(new UserAccessOptions(),ArangoDBConstants.NONE)));
  return execute(Void.class,request);
}
Program: 32699
Project: 32699
Buggy source:
/** 
 * Create a cursor and return the first results
 * @see <a href="https://docs.arangodb.com/current/HTTP/AqlQueryCursor/AccessingCursors.html#create-cursor">API
	 *      Documentation</a>
 * @param query contains the query string to be executed
 * @param bindVars key/value pairs representing the bind parameters
 * @param options Additional options, can be null
 * @param type The type of the result (POJO class, VPackSlice, String for Json, or Collection/List/Map)
 * @return cursor of the results
 */
public <T>CompletableFuture<ArangoCursor<T>> queryAsync(final String query,final Map<String,Object> bindVars,final AqlQueryOptions options,final Class<T> type) throws ArangoDBException {
  final Request request=new Request(name,RequestType.POST,ArangoDBConstants.PATH_API_CURSOR);
  request.setBody(serialize(options));
  final CompletableFuture<CursorResult> execution=execute(CursorResult.class,request);
  final CompletableFuture<ArangoCursor<T>> cursor=execution.thenApply(result -> {
    return new ArangoCursor<>(this,type,result);
  }
);
  return cursor;
}

Fixed version (ground truth):
/** 
 * Create a cursor and return the first results
 * @see <a href="https://docs.arangodb.com/current/HTTP/AqlQueryCursor/AccessingCursors.html#create-cursor">API
	 *      Documentation</a>
 * @param query contains the query string to be executed
 * @param bindVars key/value pairs representing the bind parameters
 * @param options Additional options, can be null
 * @param type The type of the result (POJO class, VPackSlice, String for Json, or Collection/List/Map)
 * @return cursor of the results
 */
public <T>CompletableFuture<ArangoCursor<T>> queryAsync(final String query,final Map<String,Object> bindVars,final AqlQueryOptions options,final Class<T> type) throws ArangoDBException {
  final Request request=new Request(name,RequestType.POST,ArangoDBConstants.PATH_API_CURSOR);
  AqlQueryOptions queryOptions=OptionsBuilder.build(options != null ? options : new AqlQueryOptions(),query,bindVars);
  request.setBody(serialize(queryOptions));
  final CompletableFuture<CursorResult> execution=execute(CursorResult.class,request);
  final CompletableFuture<ArangoCursor<T>> cursor=execution.thenApply(result -> {
    return new ArangoCursor<>(this,type,result);
  }
);
  return cursor;
}
Program: 32700
Project: 32700
Buggy source:
/** 
 * Grants access to the database dbname for user user. You need permission to the _system database in order to execute this call.
 * @see <a href=
	 *      "https://docs.arangodb.com/current/HTTP/UserManagement/index.html#grant-or-revoke-database-access">API
	 *      Documentation</a>
 * @param user The name of the user
 * @return void
 */
public CompletableFuture<Void> grandAccessAync(final String user){
  final Request request=new Request(ArangoDBConstants.SYSTEM,RequestType.PUT,createPath(ArangoDBConstants.PATH_API_USER,user,ArangoDBConstants.DATABASE,name));
  request.setBody(serialize(OptionsBuilder.build(new UserAccessOptions(),ArangoDBConstants.RW)));
  return execute(Void.class,request);
}

Fixed version (ground truth):
/** 
 * Grants access to the database dbname for user user. You need permission to the _system database in order to execute this call.
 * @see <a href= "https://docs.arangodb.com/current/HTTP/UserManagement/index.html#grant-or-revoke-database-access">
	 *      API Documentation</a>
 * @param user The name of the user
 * @return void
 */
public CompletableFuture<Void> grandAccessAync(final String user){
  final Request request=new Request(ArangoDBConstants.SYSTEM,RequestType.PUT,createPath(ArangoDBConstants.PATH_API_USER,user,ArangoDBConstants.DATABASE,name));
  request.setBody(serialize(OptionsBuilder.build(new UserAccessOptions(),ArangoDBConstants.RW)));
  return execute(Void.class,request);
}
Program: 32701
Project: 32701
Buggy source:
/** 
 * Revokes access to the database dbname for user user. You need permission to the _system database in order to execute this call.
 * @see <a href=
	 *      "https://docs.arangodb.com/current/HTTP/UserManagement/index.html#grant-or-revoke-database-access">API
	 *      Documentation</a>
 * @param user The name of the user
 * @throws ArangoDBException
 */
public void revokeAccess(final String user) throws ArangoDBException {
  unwrap(revokeAccessAsync(user));
}

Fixed version (ground truth):
/** 
 * Revokes access to the database dbname for user user. You need permission to the _system database in order to execute this call.
 * @see <a href= "https://docs.arangodb.com/current/HTTP/UserManagement/index.html#grant-or-revoke-database-access">
	 *      API Documentation</a>
 * @param user The name of the user
 * @throws ArangoDBException
 */
public void revokeAccess(final String user) throws ArangoDBException {
  unwrap(revokeAccessAsync(user));
}
Program: 32702
Project: 32702
Buggy source:
/** 
 * Grants access to the database dbname for user user. You need permission to the _system database in order to execute this call.
 * @see <a href=
	 *      "https://docs.arangodb.com/current/HTTP/UserManagement/index.html#grant-or-revoke-database-access">API
	 *      Documentation</a>
 * @param user The name of the user
 * @throws ArangoDBException
 */
public void grandAccess(final String user) throws ArangoDBException {
  unwrap(grandAccessAync(user));
}

Fixed version (ground truth):
/** 
 * Grants access to the database dbname for user user. You need permission to the _system database in order to execute this call.
 * @see <a href= "https://docs.arangodb.com/current/HTTP/UserManagement/index.html#grant-or-revoke-database-access">
	 *      API Documentation</a>
 * @param user The name of the user
 * @throws ArangoDBException
 */
public void grandAccess(final String user) throws ArangoDBException {
  unwrap(grandAccessAync(user));
}
Program: 32703
Project: 32703
Buggy source:
public BaseDocument(final Map<String,Object> properties){
  final Object id=properties.remove(DocumentField.Type.ID.getSerializeName());
  if (id != null) {
    documentHandle=id.toString();
  }
  final Object key=properties.remove(DocumentField.Type.KEY.getSerializeName());
  if (key != null) {
    documentKey=key.toString();
  }
  final Object rev=properties.remove(DocumentField.Type.REV.getSerializeName());
  if (rev != null) {
    documentRevision=rev.toString();
  }
  this.properties=properties;
}

Fixed version (ground truth):
public BaseDocument(final Map<String,Object> properties){
  final Object tmpId=properties.remove(DocumentField.Type.ID.getSerializeName());
  if (tmpId != null) {
    id=tmpId.toString();
  }
  final Object tmpKey=properties.remove(DocumentField.Type.KEY.getSerializeName());
  if (tmpKey != null) {
    key=tmpKey.toString();
  }
  final Object tmpRev=properties.remove(DocumentField.Type.REV.getSerializeName());
  if (tmpRev != null) {
    revision=tmpRev.toString();
  }
  this.properties=properties;
}
Program: 32704
Project: 32704
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + documentRevision + "String_Node_Str"+ documentHandle+ "String_Node_Str"+ documentKey+ "String_Node_Str"+ properties+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + revision + "String_Node_Str"+ id+ "String_Node_Str"+ key+ "String_Node_Str"+ properties+ "String_Node_Str";
}
Program: 32705
Project: 32705
Buggy source:
private void deserializeField(final VPackSlice parent,final VPackSlice vpack,final Object entity,final FieldInfo fieldInfo) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, VPackException {
  final VPackSlice attr=new VPackSlice(vpack.getVpack(),vpack.getStart() + vpack.getByteSize());
  if (!attr.isNone()) {
    final Object value=getValue(parent,attr,fieldInfo.getType(),fieldInfo);
    fieldInfo.set(entity,value);
  }
}

Fixed version (ground truth):
private void deserializeField(final VPackSlice parent,final VPackSlice vpack,final Object entity,final FieldInfo fieldInfo) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, VPackException {
  final VPackSlice attr=new VPackSlice(vpack.getVpack(),vpack.getStart() + vpack.getByteSize());
  if (!attr.isNone()) {
    final Object value=getValue(parent,attr,fieldInfo.getType(),fieldInfo.getFieldName());
    fieldInfo.set(entity,value);
  }
}
Program: 32706
Project: 32706
Buggy source:
private VPackDeserializer<?> getDeserializer(final FieldInfo fieldInfo,final Type type){
  VPackDeserializer<?> deserializer=null;
  if (fieldInfo != null) {
    final Map<Type,VPackDeserializer<?>> byName=deserializersByName.get(fieldInfo.getFieldName());
    if (byName != null) {
      deserializer=byName.get(type);
    }
  }
  if (deserializer == null) {
    deserializer=deserializers.get(type);
  }
  return deserializer;
}

Fixed version (ground truth):
private VPackDeserializer<?> getDeserializer(final String fieldName,final Type type){
  VPackDeserializer<?> deserializer=null;
  final Map<Type,VPackDeserializer<?>> byName=deserializersByName.get(fieldName);
  if (byName != null) {
    deserializer=byName.get(type);
  }
  if (deserializer == null) {
    deserializer=deserializers.get(type);
  }
  return deserializer;
}
Program: 32707
Project: 32707
Buggy source:
private <T>Object deserializeArray(final VPackSlice parent,final VPackSlice vpack,final Type type,final FieldInfo fieldInfo) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final int length=(int)vpack.getLength();
  final Class<?> componentType=((Class<?>)type).getComponentType();
  final Object value=Array.newInstance(componentType,length);
  for (int i=0; i < length; i++) {
    Array.set(value,i,getValue(parent,vpack.get(i),componentType,null));
  }
  return value;
}

Fixed version (ground truth):
private <T>Object deserializeArray(final VPackSlice parent,final VPackSlice vpack,final Type type) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final int length=(int)vpack.getLength();
  final Class<?> componentType=((Class<?>)type).getComponentType();
  final Object value=Array.newInstance(componentType,length);
  for (int i=0; i < length; i++) {
    Array.set(value,i,getValue(parent,vpack.get(i),componentType,null));
  }
  return value;
}
Program: 32709
Project: 32709
Buggy source:
private <T>T deserializeObject(final VPackSlice parent,final VPackSlice vpack,final Type type,final FieldInfo fieldInfo) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final T entity;
  final VPackDeserializer<?> deserializer=getDeserializer(fieldInfo,type);
  if (deserializer != null) {
    entity=((VPackDeserializer<T>)deserializer).deserialize(parent,vpack,deserializationContext);
  }
 else   if (type == Object.class) {
    entity=(T)getValue(parent,vpack,getType(vpack),fieldInfo);
  }
 else {
    entity=createInstance(type);
    deserializeFields(entity,vpack);
  }
  return entity;
}

Fixed version (ground truth):
private <T>T deserializeObject(final VPackSlice parent,final VPackSlice vpack,final Type type,final String fieldName) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final T entity;
  final VPackDeserializer<?> deserializer=getDeserializer(fieldName,type);
  if (deserializer != null) {
    entity=((VPackDeserializer<T>)deserializer).deserialize(parent,vpack,deserializationContext);
  }
 else   if (type == Object.class) {
    entity=(T)getValue(parent,vpack,getType(vpack),fieldName);
  }
 else {
    entity=createInstance(type);
    deserializeFields(entity,vpack);
  }
  return entity;
}
Program: 32710
Project: 32710
Buggy source:
private Type getType(final VPackSlice vpack){
  final Type type;
  if (vpack.isObject()) {
    type=Map.class;
  }
 else   if (vpack.isString()) {
    type=String.class;
  }
 else   if (vpack.isBoolean()) {
    type=Boolean.class;
  }
 else   if (vpack.isArray()) {
    type=Collection.class;
  }
 else   if (vpack.isDate()) {
    type=Date.class;
  }
 else   if (vpack.isDouble()) {
    type=Double.class;
  }
 else   if (vpack.isNumber()) {
    type=Number.class;
  }
 else {
    type=null;
  }
  return type;
}

Fixed version (ground truth):
private Type getType(final VPackSlice vpack){
  final Type type;
  if (vpack.isObject()) {
    type=Map.class;
  }
 else   if (vpack.isString()) {
    type=String.class;
  }
 else   if (vpack.isBoolean()) {
    type=Boolean.class;
  }
 else   if (vpack.isArray()) {
    type=Collection.class;
  }
 else   if (vpack.isDate()) {
    type=Date.class;
  }
 else   if (vpack.isDouble()) {
    type=Double.class;
  }
 else   if (vpack.isNumber()) {
    type=Number.class;
  }
 else   if (vpack.isCustom()) {
    type=String.class;
  }
 else {
    type=null;
  }
  return type;
}
Program: 32711
Project: 32711
Buggy source:
private <T,K,C>Object deserializeMap(final VPackSlice parent,final VPackSlice vpack,final Type type,final Type keyType,final Type valueType) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final int length=(int)vpack.getLength();
  final Map value=(Map)createInstance(type);
  if (length > 0) {
    final VPackKeyMapAdapter<Object> keyMapAdapter=getKeyMapAdapter(keyType);
    if (keyMapAdapter != null) {
      for (final Iterator<VPackSlice> iterator=vpack.iterator(); iterator.hasNext(); ) {
        final VPackSlice key=iterator.next();
        final VPackSlice valueAt=new VPackSlice(key.getVpack(),key.getStart() + key.getByteSize());
        value.put(keyMapAdapter.deserialize(key.makeKey().getAsString()),getValue(parent,valueAt,valueType,null));
      }
    }
 else {
      for (int i=0; i < vpack.getLength(); i++) {
        final VPackSlice entry=vpack.get(i);
        final Object mapKey=getValue(parent,entry.get(ATTR_KEY),keyType,null);
        final Object mapValue=getValue(parent,entry.get(ATTR_VALUE),valueType,null);
        value.put(mapKey,mapValue);
      }
    }
  }
  return value;
}

Fixed version (ground truth):
private <T,K,C>Object deserializeMap(final VPackSlice parent,final VPackSlice vpack,final Type type,final Type keyType,final Type valueType) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final int length=(int)vpack.getLength();
  final Map value=(Map)createInstance(type);
  if (length > 0) {
    final VPackKeyMapAdapter<Object> keyMapAdapter=getKeyMapAdapter(keyType);
    if (keyMapAdapter != null) {
      for (final Iterator<VPackSlice> iterator=vpack.iterator(); iterator.hasNext(); ) {
        final VPackSlice key=iterator.next();
        final VPackSlice valueAt=new VPackSlice(key.getVpack(),key.getStart() + key.getByteSize());
        final Object name=keyMapAdapter.deserialize(key.makeKey().getAsString());
        value.put(name,getValue(vpack,valueAt,valueType,name.toString()));
      }
    }
 else {
      for (int i=0; i < vpack.getLength(); i++) {
        final VPackSlice entry=vpack.get(i);
        final Object mapKey=getValue(parent,entry.get(ATTR_KEY),keyType,null);
        final Object mapValue=getValue(parent,entry.get(ATTR_VALUE),valueType,null);
        value.put(mapKey,mapValue);
      }
    }
  }
  return value;
}
Program: 32712
Project: 32712
Buggy source:
@Test public void readDocumentIfNoneMatchFail(){
  final DocumentCreateResult<TestEntity> createResult=db.collection(COLLECTION_NAME).createDocument(new TestEntity(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final DocumentRead.Options options=new DocumentRead.Options().ifMatch(createResult.getRev());
  try {
    db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),TestEntity.class,options).execute();
    fail();
  }
 catch (  final ArangoDBException e) {
  }
}

Fixed version (ground truth):
@Test public void readDocumentIfNoneMatchFail(){
  final DocumentCreateResult<BaseDocument> createResult=db.collection(COLLECTION_NAME).createDocument(new BaseDocument(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final DocumentRead.Options options=new DocumentRead.Options().ifNoneMatch(createResult.getRev());
  try {
    db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),BaseDocument.class,options).execute();
    fail();
  }
 catch (  final ArangoDBException e) {
  }
}
Program: 32713
Project: 32713
Buggy source:
@Test public void readDocumentIfMatch(){
  final DocumentCreateResult<TestEntity> createResult=db.collection(COLLECTION_NAME).createDocument(new TestEntity(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final DocumentRead.Options options=new DocumentRead.Options().ifMatch(createResult.getRev());
  final TestEntity readResult=db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),TestEntity.class,options).execute();
  assertThat(readResult.getKey(),is(createResult.getKey()));
  assertThat(readResult.getId(),is(COLLECTION_NAME + "String_Node_Str" + createResult.getKey()));
}

Fixed version (ground truth):
@Test public void readDocumentIfMatch(){
  final DocumentCreateResult<BaseDocument> createResult=db.collection(COLLECTION_NAME).createDocument(new BaseDocument(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final DocumentRead.Options options=new DocumentRead.Options().ifMatch(createResult.getRev());
  final BaseDocument readResult=db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),BaseDocument.class,options).execute();
  assertThat(readResult.getKey(),is(createResult.getKey()));
  assertThat(readResult.getId(),is(COLLECTION_NAME + "String_Node_Str" + createResult.getKey()));
}
Program: 32714
Project: 32714
Buggy source:
@Test public void createDocument(){
  final DocumentCreateResult<TestEntity> doc=db.collection(COLLECTION_NAME).createDocument(new TestEntity(),null).execute();
  assertThat(doc,is(notNullValue()));
  assertThat(doc.getId(),is(notNullValue()));
  assertThat(doc.getKey(),is(notNullValue()));
  assertThat(doc.getRev(),is(notNullValue()));
  assertThat(doc.getNew().isPresent(),is(false));
  assertThat(doc.getId(),is(COLLECTION_NAME + "String_Node_Str" + doc.getKey()));
}

Fixed version (ground truth):
@Test public void createDocument(){
  final DocumentCreateResult<BaseDocument> doc=db.collection(COLLECTION_NAME).createDocument(new BaseDocument(),null).execute();
  assertThat(doc,is(notNullValue()));
  assertThat(doc.getId(),is(notNullValue()));
  assertThat(doc.getKey(),is(notNullValue()));
  assertThat(doc.getRev(),is(notNullValue()));
  assertThat(doc.getNew().isPresent(),is(false));
  assertThat(doc.getId(),is(COLLECTION_NAME + "String_Node_Str" + doc.getKey()));
}
Program: 32715
Project: 32715
Buggy source:
@Test public void readDocument(){
  final DocumentCreateResult<TestEntity> createResult=db.collection(COLLECTION_NAME).createDocument(new TestEntity(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final TestEntity readResult=db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),TestEntity.class,null).execute();
  assertThat(readResult.getKey(),is(createResult.getKey()));
  assertThat(readResult.getId(),is(COLLECTION_NAME + "String_Node_Str" + createResult.getKey()));
}

Fixed version (ground truth):
@Test public void readDocument(){
  final DocumentCreateResult<BaseDocument> createResult=db.collection(COLLECTION_NAME).createDocument(new BaseDocument(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final BaseDocument readResult=db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),BaseDocument.class,null).execute();
  assertThat(readResult.getKey(),is(createResult.getKey()));
  assertThat(readResult.getId(),is(COLLECTION_NAME + "String_Node_Str" + createResult.getKey()));
}
Program: 32716
Project: 32716
Buggy source:
@Test public void readDocumentIfMatchFail(){
  final DocumentCreateResult<TestEntity> createResult=db.collection(COLLECTION_NAME).createDocument(new TestEntity(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final DocumentRead.Options options=new DocumentRead.Options().ifMatch("String_Node_Str");
  try {
    db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),TestEntity.class,options).execute();
    fail();
  }
 catch (  final ArangoDBException e) {
  }
}

Fixed version (ground truth):
@Test public void readDocumentIfMatchFail(){
  final DocumentCreateResult<BaseDocument> createResult=db.collection(COLLECTION_NAME).createDocument(new BaseDocument(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final DocumentRead.Options options=new DocumentRead.Options().ifMatch("String_Node_Str");
  try {
    db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),BaseDocument.class,options).execute();
    fail();
  }
 catch (  final ArangoDBException e) {
  }
}
Program: 32717
Project: 32717
Buggy source:
@Test public void createDocumentAsync() throws InterruptedException, ExecutionException {
  final CompletableFuture<DocumentCreateResult<TestEntity>> f=db.collection(COLLECTION_NAME).createDocument(new TestEntity(),null).executeAsync();
  assertThat(f,is(notNullValue()));
  f.whenComplete((doc,ex) -> {
    assertThat(ex,is(nullValue()));
    assertThat(doc.getId(),is(notNullValue()));
    assertThat(doc.getKey(),is(notNullValue()));
    assertThat(doc.getRev(),is(notNullValue()));
    assertThat(doc.getNew().isPresent(),is(false));
  }
);
  f.get();
}

Fixed version (ground truth):
@Test public void createDocumentAsync() throws InterruptedException, ExecutionException {
  final CompletableFuture<DocumentCreateResult<BaseDocument>> f=db.collection(COLLECTION_NAME).createDocument(new BaseDocument(),null).executeAsync();
  assertThat(f,is(notNullValue()));
  f.whenComplete((doc,ex) -> {
    assertThat(ex,is(nullValue()));
    assertThat(doc.getId(),is(notNullValue()));
    assertThat(doc.getKey(),is(notNullValue()));
    assertThat(doc.getRev(),is(notNullValue()));
    assertThat(doc.getNew().isPresent(),is(false));
  }
);
  f.get();
}
Program: 32718
Project: 32718
Buggy source:
@Test public void createDocumentWaitForSync(){
  final DocumentCreate.Options options=new DocumentCreate.Options().waitForSync(true);
  final DocumentCreateResult<TestEntity> doc=db.collection(COLLECTION_NAME).createDocument(new TestEntity(),options).execute();
  assertThat(doc,is(notNullValue()));
  assertThat(doc.getId(),is(notNullValue()));
  assertThat(doc.getKey(),is(notNullValue()));
  assertThat(doc.getRev(),is(notNullValue()));
  assertThat(doc.getNew().isPresent(),is(false));
}

Fixed version (ground truth):
@Test public void createDocumentWaitForSync(){
  final DocumentCreate.Options options=new DocumentCreate.Options().waitForSync(true);
  final DocumentCreateResult<BaseDocument> doc=db.collection(COLLECTION_NAME).createDocument(new BaseDocument(),options).execute();
  assertThat(doc,is(notNullValue()));
  assertThat(doc.getId(),is(notNullValue()));
  assertThat(doc.getKey(),is(notNullValue()));
  assertThat(doc.getRev(),is(notNullValue()));
  assertThat(doc.getNew().isPresent(),is(false));
}
Program: 32719
Project: 32719
Buggy source:
@Test public void createDocumentReturnNew(){
  final DocumentCreate.Options options=new DocumentCreate.Options().returnNew(true);
  final DocumentCreateResult<TestEntity> doc=db.collection(COLLECTION_NAME).createDocument(new TestEntity(),options).execute();
  assertThat(doc,is(notNullValue()));
  assertThat(doc.getId(),is(notNullValue()));
  assertThat(doc.getKey(),is(notNullValue()));
  assertThat(doc.getRev(),is(notNullValue()));
  assertThat(doc.getNew().isPresent(),is(true));
}

Fixed version (ground truth):
@Test public void createDocumentReturnNew(){
  final DocumentCreate.Options options=new DocumentCreate.Options().returnNew(true);
  final DocumentCreateResult<BaseDocument> doc=db.collection(COLLECTION_NAME).createDocument(new BaseDocument(),options).execute();
  assertThat(doc,is(notNullValue()));
  assertThat(doc.getId(),is(notNullValue()));
  assertThat(doc.getKey(),is(notNullValue()));
  assertThat(doc.getRev(),is(notNullValue()));
  assertThat(doc.getNew().isPresent(),is(true));
}
Program: 32720
Project: 32720
Buggy source:
@Test public void readDocumentIfNoneMatch(){
  final DocumentCreateResult<TestEntity> createResult=db.collection(COLLECTION_NAME).createDocument(new TestEntity(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final DocumentRead.Options options=new DocumentRead.Options().ifNoneMatch("String_Node_Str");
  final TestEntity readResult=db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),TestEntity.class,options).execute();
  assertThat(readResult.getKey(),is(createResult.getKey()));
  assertThat(readResult.getId(),is(COLLECTION_NAME + "String_Node_Str" + createResult.getKey()));
}

Fixed version (ground truth):
@Test public void readDocumentIfNoneMatch(){
  final DocumentCreateResult<BaseDocument> createResult=db.collection(COLLECTION_NAME).createDocument(new BaseDocument(),null).execute();
  assertThat(createResult.getKey(),is(notNullValue()));
  final DocumentRead.Options options=new DocumentRead.Options().ifNoneMatch("String_Node_Str");
  final BaseDocument readResult=db.collection(COLLECTION_NAME).readDocument(createResult.getKey(),BaseDocument.class,options).execute();
  assertThat(readResult.getKey(),is(createResult.getKey()));
  assertThat(readResult.getId(),is(COLLECTION_NAME + "String_Node_Str" + createResult.getKey()));
}
Program: 32721
Project: 32721
Buggy source:
private <T>Object getValue(final VPackSlice vpack,final Type type,final FieldInfo fieldInfo) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final Object value;
  if (vpack.isNull()) {
    value=null;
  }
 else {
    final VPackDeserializer<?> deserializer=deserializers.get(type);
    if (deserializer != null) {
      value=((VPackDeserializer<Object>)deserializer).deserialize(vpack,deserializationContext);
    }
 else     if (type instanceof ParameterizedType) {
      final ParameterizedType pType=ParameterizedType.class.cast(type);
      final Type rawType=pType.getRawType();
      if (Collection.class.isAssignableFrom((Class<?>)rawType)) {
        value=deserializeCollection(vpack,type,pType.getActualTypeArguments()[0]);
      }
 else       if (Map.class.isAssignableFrom((Class<?>)rawType)) {
        final Type[] parameterizedTypes=pType.getActualTypeArguments();
        value=deserializeMap(vpack,type,parameterizedTypes[0],parameterizedTypes[1]);
      }
 else {
        value=deserializeObject(vpack,type);
      }
    }
 else     if (((Class)type).isArray()) {
      value=deserializeArray(vpack,type,fieldInfo);
    }
 else     if (((Class)type).isEnum()) {
      value=Enum.valueOf((Class<? extends Enum>)type,vpack.getAsString());
    }
 else {
      value=deserializeObject(vpack,type);
    }
  }
  return value;
}

Fixed version (ground truth):
private <T>Object getValue(final VPackSlice vpack,final Type type,final FieldInfo fieldInfo) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final Object value;
  if (vpack.isNull()) {
    value=null;
  }
 else {
    final VPackDeserializer<?> deserializer=deserializers.get(type);
    if (deserializer != null) {
      value=((VPackDeserializer<Object>)deserializer).deserialize(vpack,deserializationContext);
    }
 else     if (type instanceof ParameterizedType) {
      final ParameterizedType pType=ParameterizedType.class.cast(type);
      final Type rawType=pType.getRawType();
      if (Collection.class.isAssignableFrom((Class<?>)rawType)) {
        value=deserializeCollection(vpack,type,pType.getActualTypeArguments()[0]);
      }
 else       if (Map.class.isAssignableFrom((Class<?>)rawType)) {
        final Type[] parameterizedTypes=pType.getActualTypeArguments();
        value=deserializeMap(vpack,type,parameterizedTypes[0],parameterizedTypes[1]);
      }
 else {
        value=deserializeObject(vpack,type);
      }
    }
 else     if (Collection.class.isAssignableFrom((Class<?>)type)) {
      value=deserializeCollection(vpack,type,Object.class);
    }
 else     if (Map.class.isAssignableFrom((Class<?>)type)) {
      value=deserializeMap(vpack,type,String.class,Object.class);
    }
 else     if (((Class)type).isArray()) {
      value=deserializeArray(vpack,type,fieldInfo);
    }
 else     if (((Class)type).isEnum()) {
      value=Enum.valueOf((Class<? extends Enum>)type,vpack.getAsString());
    }
 else {
      value=deserializeObject(vpack,type);
    }
  }
  return value;
}
Program: 32722
Project: 32722
Buggy source:
private <T>T deserializeObject(final VPackSlice vpack,final Type type) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final T entity;
  final VPackDeserializer<?> deserializer=deserializers.get(type);
  if (deserializer != null) {
    entity=((VPackDeserializer<T>)deserializer).deserialize(vpack,deserializationContext);
  }
 else {
    entity=createInstance(type);
    deserializeFields(entity,vpack);
  }
  return entity;
}

Fixed version (ground truth):
private <T>T deserializeObject(final VPackSlice vpack,final Type type) throws InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, VPackException {
  final T entity;
  final VPackDeserializer<?> deserializer=deserializers.get(type);
  if (deserializer != null) {
    entity=((VPackDeserializer<T>)deserializer).deserialize(vpack,deserializationContext);
  }
 else   if (type == Object.class) {
    entity=(T)vpack.getAsString();
  }
 else {
    entity=createInstance(type);
    deserializeFields(entity,vpack);
  }
  return entity;
}
Program: 32724
Project: 32724
Buggy source:
public int size(){
  return innerMap.size();
}

Fixed version (ground truth):
@Override public int size(){
  return innerMap.size();
}
Program: 32725
Project: 32725
Buggy source:
public Set<java.util.Map.Entry<K,V>> entrySet(){
  return innerMap.entrySet();
}

Fixed version (ground truth):
@Override public Set<java.util.Map.Entry<K,V>> entrySet(){
  return innerMap.entrySet();
}
Program: 32726
Project: 32726
Buggy source:
public boolean containsKey(Object key){
  return innerMap.containsKey(key);
}

Fixed version (ground truth):
@Override public boolean containsKey(Object key){
  return innerMap.containsKey(key);
}
Program: 32727
Project: 32727
Buggy source:
public V get(Object key){
  return innerMap.get(key);
}

Fixed version (ground truth):
@Override public V get(Object key){
  return innerMap.get(key);
}
Program: 32728
Project: 32728
Buggy source:
public void putAll(Map<? extends K,? extends V> t){
  innerMap.putAll(t);
}

Fixed version (ground truth):
@Override public void putAll(Map<? extends K,? extends V> t){
  innerMap.putAll(t);
}
Program: 32729
Project: 32729
Buggy source:
public Collection<V> values(){
  return innerMap.values();
}

Fixed version (ground truth):
@Override public Collection<V> values(){
  return innerMap.values();
}
Program: 32730
Project: 32730
Buggy source:
public boolean isEmpty(){
  return innerMap.isEmpty();
}

Fixed version (ground truth):
@Override public boolean isEmpty(){
  return innerMap.isEmpty();
}
Program: 32731
Project: 32731
Buggy source:
public void clear(){
  innerMap.clear();
}

Fixed version (ground truth):
@Override public void clear(){
  innerMap.clear();
}
Program: 32732
Project: 32732
Buggy source:
public Set<K> keySet(){
  return innerMap.keySet();
}

Fixed version (ground truth):
@Override public Set<K> keySet(){
  return innerMap.keySet();
}
Program: 32733
Project: 32733
Buggy source:
public boolean containsValue(Object value){
  return innerMap.containsValue(value);
}

Fixed version (ground truth):
@Override public boolean containsValue(Object value){
  return innerMap.containsValue(value);
}
Program: 32734
Project: 32734
Buggy source:
public V put(K key,V value){
  return innerMap.put(key,value);
}

Fixed version (ground truth):
@Override public V put(K key,V value){
  return innerMap.put(key,value);
}
Program: 32735
Project: 32735
Buggy source:
public V remove(Object key){
  return innerMap.remove(key);
}

Fixed version (ground truth):
@Override public V remove(Object key){
  return innerMap.remove(key);
}
Program: 32736
Project: 32736
Buggy source:
public static void log(String url,HttpRequestEntity requestEntity,String userAgent,Credentials credencials){
  boolean includeBody=(requestEntity.type == RequestType.POST || requestEntity.type == RequestType.PUT || requestEntity.type == RequestType.PATCH) && (requestEntity.bodyText != null && requestEntity.bodyText.length() != 0);
  StringBuilder buffer=new StringBuilder();
  if (includeBody) {
    buffer.append("String_Node_Str");
    buffer.append("String_Node_Str");
  }
  buffer.append("String_Node_Str").append(requestEntity.type);
  buffer.append("String_Node_Str");
  if (requestEntity.headers != null && !requestEntity.headers.isEmpty()) {
    for (    Entry<String,Object> header : requestEntity.headers.entrySet()) {
      buffer.append("String_Node_Str").append(header.getKey()).append("String_Node_Str").append(header.getValue()).append("String_Node_Str");
    }
  }
  if (credencials != null) {
    buffer.append("String_Node_Str").append(credencials.getUserPrincipal().getName()).append("String_Node_Str").append(credencials.getPassword());
  }
  if (includeBody) {
    buffer.append("String_Node_Str");
  }
  buffer.append("String_Node_Str").append(url).append("String_Node_Str");
  if (includeBody) {
    buffer.append("String_Node_Str");
    buffer.append(requestEntity.bodyText);
    buffer.append("String_Node_Str");
    buffer.append("String_Node_Str");
  }
  logger.debug("String_Node_Str",buffer);
}

Fixed version (ground truth):
public static void log(String url,HttpRequestEntity requestEntity,String userAgent,Credentials credencials){
  boolean includeBody=(requestEntity.type == RequestType.POST || requestEntity.type == RequestType.PUT || requestEntity.type == RequestType.PATCH) && StringUtils.isNotEmpty(requestEntity.bodyText);
  StringBuilder buffer=new StringBuilder();
  if (includeBody) {
    buffer.append("String_Node_Str");
    buffer.append("String_Node_Str");
  }
  buffer.append("String_Node_Str").append(requestEntity.type);
  buffer.append("String_Node_Str");
  if (requestEntity.hasHeaders()) {
    for (    Entry<String,Object> header : requestEntity.headers.entrySet()) {
      buffer.append("String_Node_Str").append(header.getKey()).append("String_Node_Str").append(header.getValue()).append("String_Node_Str");
    }
  }
  if (credencials != null) {
    buffer.append("String_Node_Str").append(credencials.getUserPrincipal().getName()).append("String_Node_Str").append(credencials.getPassword());
  }
  if (includeBody) {
    buffer.append("String_Node_Str");
  }
  buffer.append("String_Node_Str").append(url).append("String_Node_Str");
  if (includeBody) {
    buffer.append("String_Node_Str");
    buffer.append(requestEntity.bodyText);
    buffer.append("String_Node_Str");
    buffer.append("String_Node_Str");
  }
  logger.debug("String_Node_Str",buffer);
}
Program: 32738
Project: 32738
Buggy source:
public String getLastJobId(){
  return jobIds.size() == 0 ? null : jobIds.get(jobIds.size() - 1);
}

Fixed version (ground truth):
public String getLastJobId(){
  return jobIds.isEmpty() ? null : jobIds.get(jobIds.size() - 1);
}
Program: 32739
Project: 32739
Buggy source:
@Override public long getKeepAliveDuration(HttpResponse response,HttpContext context){
  HeaderElementIterator it=new BasicHeaderElementIterator(response.headerIterator(HTTP.CONN_KEEP_ALIVE));
  while (it.hasNext()) {
    HeaderElement he=it.nextElement();
    String param=he.getName();
    String value=he.getValue();
    if (value != null && param.equalsIgnoreCase("String_Node_Str")) {
      try {
        return Long.parseLong(value) * 1000;
      }
 catch (      NumberFormatException ignore) {
      }
    }
  }
  return 30 * 1000;
}

Fixed version (ground truth):
@Override public long getKeepAliveDuration(HttpResponse response,HttpContext context){
  HeaderElementIterator it=new BasicHeaderElementIterator(response.headerIterator(HTTP.CONN_KEEP_ALIVE));
  while (it.hasNext()) {
    HeaderElement he=it.nextElement();
    String param=he.getName();
    String value=he.getValue();
    if (value != null && "String_Node_Str".equalsIgnoreCase(param)) {
      try {
        return Long.parseLong(value) * 1000L;
      }
 catch (      NumberFormatException ignore) {
      }
    }
  }
  return 30L * 1000L;
}
Program: 32741
Project: 32741
Buggy source:
public boolean isRepeatable(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isRepeatable(){
  return false;
}
Program: 32742
Project: 32742
Buggy source:
public void writeTo(OutputStream outstream) throws IOException {
  if (outstream == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  BufferedWriter writer=null;
  try {
    writer=new BufferedWriter(new OutputStreamWriter(outstream,"String_Node_Str"));
    while (it.hasNext()) {
      Object value=it.next();
      gson.toJson(value,writer);
      writer.newLine();
    }
    writer.flush();
  }
  finally {
  }
}

Fixed version (ground truth):
@Override public void writeTo(OutputStream outstream) throws IOException {
  if (outstream == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(outstream,"String_Node_Str"));
  while (it.hasNext()) {
    Object value=it.next();
    gson.toJson(value,writer);
    writer.newLine();
  }
  writer.flush();
}
Program: 32743
Project: 32743
Buggy source:
public boolean isStreaming(){
  return true;
}

Fixed version (ground truth):
@Override public boolean isStreaming(){
  return true;
}
Program: 32744
Project: 32744
Buggy source:
public InputStream getContent() throws IOException, IllegalStateException {
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
@Override public InputStream getContent() throws IOException {
  throw new IllegalStateException("String_Node_Str");
}
Program: 32745
Project: 32745
Buggy source:
public long getContentLength(){
  return -1;
}

Fixed version (ground truth):
@Override public long getContentLength(){
  return -1;
}
Program: 32746
Project: 32746
Buggy source:
@Override public int size(){
  return innerMap.size();
}

Fixed version (ground truth):
public int size(){
  return innerMap.size();
}
Program: 32747
Project: 32747
Buggy source:
@Override public Set<java.util.Map.Entry<K,V>> entrySet(){
  return innerMap.entrySet();
}

Fixed version (ground truth):
public Set<java.util.Map.Entry<K,V>> entrySet(){
  return innerMap.entrySet();
}
Program: 32748
Project: 32748
Buggy source:
@Override public boolean containsKey(Object key){
  return innerMap.containsKey(key);
}

Fixed version (ground truth):
public boolean containsKey(Object key){
  return innerMap.containsKey(key);
}
Program: 32749
Project: 32749
Buggy source:
@Override public V get(Object key){
  return innerMap.get(key);
}

Fixed version (ground truth):
public V get(Object key){
  return innerMap.get(key);
}
Program: 32750
Project: 32750
Buggy source:
@Override public void putAll(Map<? extends K,? extends V> t){
  innerMap.putAll(t);
}

Fixed version (ground truth):
public void putAll(Map<? extends K,? extends V> t){
  innerMap.putAll(t);
}
Program: 32751
Project: 32751
Buggy source:
@Override public Collection<V> values(){
  return innerMap.values();
}

Fixed version (ground truth):
public Collection<V> values(){
  return innerMap.values();
}
Program: 32752
Project: 32752
Buggy source:
@Override public boolean isEmpty(){
  return innerMap.isEmpty();
}

Fixed version (ground truth):
public boolean isEmpty(){
  return innerMap.isEmpty();
}
Program: 32753
Project: 32753
Buggy source:
@Override public void clear(){
  innerMap.clear();
}

Fixed version (ground truth):
public void clear(){
  innerMap.clear();
}
Program: 32754
Project: 32754
Buggy source:
@Override public Set<K> keySet(){
  return innerMap.keySet();
}

Fixed version (ground truth):
public Set<K> keySet(){
  return innerMap.keySet();
}
Program: 32755
Project: 32755
Buggy source:
@Override public boolean containsValue(Object value){
  return innerMap.containsValue(value);
}

Fixed version (ground truth):
public boolean containsValue(Object value){
  return innerMap.containsValue(value);
}
Program: 32756
Project: 32756
Buggy source:
@Override public V put(K key,V value){
  return innerMap.put(key,value);
}

Fixed version (ground truth):
public V put(K key,V value){
  return innerMap.put(key,value);
}
Program: 32757
Project: 32757
Buggy source:
@Override public V remove(Object key){
  return innerMap.remove(key);
}

Fixed version (ground truth):
public V remove(Object key){
  return innerMap.remove(key);
}
Program: 32758
Project: 32758
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public Iterator<T> iterator(){
  return (Iterator<T>)CollectionUtils.safetyIterator(results);
}

Fixed version (ground truth):
@Override public Iterator<T> iterator(){
  return CollectionUtils.safetyIterator(results);
}
Program: 32759
Project: 32759
Buggy source:
/** 
 * Returns the DocumentEntity objects of this CursorDocumentEntity
 * @return list of DocumentEntity objects
 */
public List<? extends T> getResults(){
  return results;
}

Fixed version (ground truth):
/** 
 * Returns the DocumentEntity objects of this CursorDocumentEntity
 * @return list of DocumentEntity objects
 */
public List<T> getResults(){
  return results;
}
Program: 32761
Project: 32761
Buggy source:
private HttpResponseEntity getCursor(String database,String query,Map<String,Object> bindVars,AqlQueryOptions aqlQueryOptions) throws ArangoException {
  Map<String,Object> map=aqlQueryOptions.toMap();
  map.put("String_Node_Str",query);
  map.put("String_Node_Str",bindVars == null ? Collections.emptyMap() : bindVars);
  HttpResponseEntity res=httpManager.doPost(createEndpointUrl(database,"String_Node_Str"),null,EntityFactory.toJsonString(map));
  return res;
}

Fixed version (ground truth):
private HttpResponseEntity getCursor(String database,String query,Map<String,Object> bindVars,AqlQueryOptions aqlQueryOptions) throws ArangoException {
  Map<String,Object> map=aqlQueryOptions.toMap();
  map.put("String_Node_Str",query);
  map.put("String_Node_Str",bindVars == null ? Collections.emptyMap() : bindVars);
  return httpManager.doPost(createEndpointUrl(database,"String_Node_Str"),null,EntityFactory.toJsonString(map));
}
Program: 32762
Project: 32762
Buggy source:
@Deprecated @Override public <T>CursorResultSet<T> executeQueryWithResultSet(String database,String query,Map<String,Object> bindVars,Class<T> clazz,Boolean calcCount,Integer batchSize) throws ArangoException {
  CursorEntity<T> entity=executeQuery(database,query,bindVars,clazz,calcCount,batchSize,false);
  CursorResultSet<T> rs=new CursorResultSet<T>(database,this,entity,clazz);
  return rs;
}

Fixed version (ground truth):
@Deprecated @Override public <T>CursorResultSet<T> executeQueryWithResultSet(String database,String query,Map<String,Object> bindVars,Class<T> clazz,Boolean calcCount,Integer batchSize) throws ArangoException {
  CursorEntity<T> entity=executeQuery(database,query,bindVars,clazz,calcCount,batchSize,false);
  return new CursorResultSet<T>(database,this,entity,clazz);
}
Program: 32763
Project: 32763
Buggy source:
@Override public DocumentEntity<String> createDocumentRaw(String database,String collectionName,String rawJsonObjectString,Boolean createCollection,Boolean waitForSync) throws ArangoException {
  return _createDocument(database,collectionName,null,rawJsonObjectString,createCollection,waitForSync,true);
}

Fixed version (ground truth):
@Override public DocumentEntity<String> createDocumentRaw(String database,String collectionName,String rawJsonObjectString,Boolean createCollection,Boolean waitForSync) throws ArangoException {
  return internalCreateDocument(database,collectionName,null,rawJsonObjectString,createCollection,waitForSync,true);
}
Program: 32764
Project: 32764
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public <T>DocumentEntity<T> replaceDocument(String database,String documentHandle,T value,Long rev,Policy policy,Boolean waitForSync) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doPut(createEndpointUrl(database,"String_Node_Str",documentHandle),new MapBuilder().put("String_Node_Str",rev).put("String_Node_Str",policy == null ? null : policy.name()).put("String_Node_Str",waitForSync).get(),EntityFactory.toJsonString(value));
  DocumentEntity<T> result=createEntity(res,DocumentEntity.class);
  annotationHandler.updateDocumentRev(value,result.getDocumentRevision());
  result.setEntity(value);
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public <T>DocumentEntity<T> replaceDocument(String database,String documentHandle,T value,Long rev,Policy policy,Boolean waitForSync) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doPut(createDocumentEndpointUrl(database,documentHandle),new MapBuilder().put("String_Node_Str",rev).put(POLICY,policy == null ? null : policy.name()).put(WAIT_FOR_SYNC,waitForSync).get(),EntityFactory.toJsonString(value));
  DocumentEntity<T> result=createEntity(res,DocumentEntity.class);
  annotationHandler.updateDocumentRev(value,result.getDocumentRevision());
  result.setEntity(value);
  return result;
}