nus-yam/ex-repair huggingface dataset:
Program: 32765
Project: 32765
Buggy source:
@Override public <T>DocumentEntity<T> getDocument(String database,String documentHandle,Class<T> clazz,Long ifNoneMatchRevision,Long ifMatchRevision) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str",documentHandle),new MapBuilder().put("String_Node_Str",ifNoneMatchRevision,true).put("String_Node_Str",ifMatchRevision).get(),null);
  @SuppressWarnings("String_Node_Str") DocumentEntity<T> entity=createEntity(res,DocumentEntity.class,clazz);
  if (entity == null) {
    entity=new DocumentEntity<T>();
  }
  return entity;
}

Fixed version (ground truth):
@Override public <T>DocumentEntity<T> getDocument(String database,String documentHandle,Class<T> clazz,Long ifNoneMatchRevision,Long ifMatchRevision) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doGet(createDocumentEndpointUrl(database,documentHandle),new MapBuilder().put("String_Node_Str",ifNoneMatchRevision,true).put("String_Node_Str",ifMatchRevision).get(),null);
  @SuppressWarnings("String_Node_Str") DocumentEntity<T> entity=createEntity(res,DocumentEntity.class,clazz);
  if (entity == null) {
    entity=new DocumentEntity<T>();
  }
  return entity;
}
Program: 32766
Project: 32766
Buggy source:
@Override public List<String> getDocuments(String database,String collectionName,boolean handleConvert) throws ArangoException {
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str"),new MapBuilder("String_Node_Str",collectionName).get());
  DocumentsEntity entity=createEntity(res,DocumentsEntity.class);
  List<String> documents=CollectionUtils.safety(entity.getDocuments());
  if (handleConvert && !documents.isEmpty()) {
    ListIterator<String> lit=documents.listIterator();
    while (lit.hasNext()) {
      String d=lit.next();
      if (d.startsWith(API_DOCUMENT_PREFIX)) {
        lit.set(d.substring(API_DOCUMENT_PREFIX.length()));
      }
 else {
        Matcher matcher=pattern.matcher(d);
        if (matcher.find()) {
          lit.set(matcher.group(1));
        }
      }
    }
  }
  return documents;
}

Fixed version (ground truth):
@Override public List<String> getDocuments(String database,String collectionName,boolean handleConvert) throws ArangoException {
  HttpResponseEntity res=httpManager.doGet(createDocumentEndpointUrl(database),new MapBuilder("String_Node_Str",collectionName).get());
  DocumentsEntity entity=createEntity(res,DocumentsEntity.class);
  List<String> documents=CollectionUtils.safety(entity.getDocuments());
  if (handleConvert && !documents.isEmpty()) {
    ListIterator<String> lit=documents.listIterator();
    while (lit.hasNext()) {
      String d=lit.next();
      if (d.startsWith(API_DOCUMENT_PREFIX)) {
        lit.set(d.substring(API_DOCUMENT_PREFIX.length()));
      }
 else {
        Matcher matcher=pattern.matcher(d);
        if (matcher.find()) {
          lit.set(matcher.group(1));
        }
      }
    }
  }
  return documents;
}
Program: 32767
Project: 32767
Buggy source:
@Override public DocumentEntity<?> deleteDocument(String database,String documentHandle,Long rev,Policy policy) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doDelete(createEndpointUrl(database,"String_Node_Str",documentHandle),new MapBuilder().put("String_Node_Str",rev).put("String_Node_Str",policy == null ? null : policy.name().toLowerCase(Locale.US)).get());
  DocumentEntity<?> entity=createEntity(res,DocumentEntity.class);
  return entity;
}

Fixed version (ground truth):
@Override public DocumentEntity<?> deleteDocument(String database,String documentHandle,Long rev,Policy policy) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doDelete(createDocumentEndpointUrl(database,documentHandle),new MapBuilder().put("String_Node_Str",rev).put(POLICY,policy == null ? null : policy.name().toLowerCase(Locale.US)).get());
  return createEntity(res,DocumentEntity.class);
}
Program: 32768
Project: 32768
Buggy source:
@Override public long checkDocument(String database,String documentHandle) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doHead(createEndpointUrl(database,"String_Node_Str",documentHandle),null);
  DefaultEntity entity=createEntity(res,DefaultEntity.class);
  return entity.getEtag();
}

Fixed version (ground truth):
@Override public long checkDocument(String database,String documentHandle) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doHead(createDocumentEndpointUrl(database,documentHandle),null);
  DefaultEntity entity=createEntity(res,DefaultEntity.class);
  return entity.getEtag();
}
Program: 32769
Project: 32769
Buggy source:
@Override public <T>DocumentEntity<T> createDocument(String database,String collectionName,String documentKey,T value,Boolean createCollection,Boolean waitForSync) throws ArangoException {
  return _createDocument(database,collectionName,documentKey,value,createCollection,waitForSync,false);
}

Fixed version (ground truth):
@Override public <T>DocumentEntity<T> createDocument(String database,String collectionName,String documentKey,T value,Boolean createCollection,Boolean waitForSync) throws ArangoException {
  return internalCreateDocument(database,collectionName,documentKey,value,createCollection,waitForSync,false);
}
Program: 32770
Project: 32770
Buggy source:
@Override public <T>DocumentEntity<T> updateDocument(String database,String documentHandle,T value,Long rev,Policy policy,Boolean waitForSync,Boolean keepNull) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doPatch(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).put("String_Node_Str",keepNull).get(),EntityFactory.toJsonString(value,keepNull != null && !keepNull));
  @SuppressWarnings("String_Node_Str") DocumentEntity<T> result=createEntity(res,DocumentEntity.class);
  annotationHandler.updateDocumentAttributes(value,result.getDocumentRevision(),result.getDocumentHandle(),result.getDocumentKey());
  result.setEntity(value);
  return result;
}

Fixed version (ground truth):
@Override public <T>DocumentEntity<T> updateDocument(String database,String documentHandle,T value,Long rev,Policy policy,Boolean waitForSync,Boolean keepNull) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doPatch(createDocumentEndpointUrl(database,documentHandle),new MapBuilder().put("String_Node_Str",rev).put(POLICY,policy == null ? null : policy.name()).put(WAIT_FOR_SYNC,waitForSync).put("String_Node_Str",keepNull).get(),EntityFactory.toJsonString(value,keepNull != null && !keepNull));
  @SuppressWarnings("String_Node_Str") DocumentEntity<T> result=createEntity(res,DocumentEntity.class);
  annotationHandler.updateDocumentAttributes(value,result.getDocumentRevision(),result.getDocumentHandle(),result.getDocumentKey());
  result.setEntity(value);
  return result;
}
Program: 32771
Project: 32771
Buggy source:
@Override public String getDocumentRaw(String database,String documentHandle,Long ifNoneMatchRevision,Long ifMatchRevision) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str",documentHandle),new MapBuilder().put("String_Node_Str",ifNoneMatchRevision,true).put("String_Node_Str",ifMatchRevision).get(),null);
  if (res.getStatusCode() >= 400) {
    BaseDocument entity=new BaseDocument();
    entity.setError(true);
    entity.setCode(res.getStatusCode());
    entity.setStatusCode(res.getStatusCode());
    entity.setErrorNumber(res.getStatusCode());
    entity.setErrorMessage(res.getText());
    throw new ArangoException(entity);
  }
  return res.getText();
}

Fixed version (ground truth):
@Override public String getDocumentRaw(String database,String documentHandle,Long ifNoneMatchRevision,Long ifMatchRevision) throws ArangoException {
  validateDocumentHandle(documentHandle);
  HttpResponseEntity res=httpManager.doGet(createDocumentEndpointUrl(database,documentHandle),new MapBuilder().put("String_Node_Str",ifNoneMatchRevision,true).put("String_Node_Str",ifMatchRevision).get(),null);
  if (res.getStatusCode() >= 400) {
    BaseDocument entity=new BaseDocument();
    entity.setError(true);
    entity.setCode(res.getStatusCode());
    entity.setStatusCode(res.getStatusCode());
    entity.setErrorNumber(res.getStatusCode());
    entity.setErrorMessage(res.getText());
    throw new ArangoException(entity);
  }
  return res.getText();
}
Program: 32772
Project: 32772
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public <T>VertexEntity<T> updateVertex(String databaseName,String graphName,String collectionName,String key,T vertex,Boolean keepNull,Boolean waitForSync,Long ifMatchRevision,Long ifNoneMatchRevision) throws ArangoException {
  validateCollectionName(graphName);
  HttpResponseEntity res=httpManager.doPatch(createGharialEndpointUrl(databaseName,StringUtils.encodeUrl(graphName),VERTEX,StringUtils.encodeUrl(collectionName),StringUtils.encodeUrl(key)),new MapBuilder().put(IF_MATCH,ifMatchRevision,true).put(IF_NONE_MATCH,ifNoneMatchRevision,true).get(),new MapBuilder().put("String_Node_Str",keepNull).put(WAIT_FOR_SYNC,waitForSync).get(),EntityFactory.toJsonString(vertex,keepNull != null && !keepNull));
  VertexEntity<T> result=createEntity(res,VertexEntity.class,vertex.getClass());
  if (vertex != null) {
    result.setEntity(vertex);
    annotationHandler.updateDocumentAttributes(result.getEntity(),result.getDocumentRevision(),result.getDocumentHandle(),result.getDocumentKey());
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public <T>VertexEntity<T> updateVertex(String databaseName,String graphName,String collectionName,String key,T vertex,Boolean keepNull,Boolean waitForSync,Long ifMatchRevision,Long ifNoneMatchRevision) throws ArangoException {
  validateCollectionName(graphName);
  HttpResponseEntity res=httpManager.doPatch(createGharialEndpointUrl(databaseName,StringUtils.encodeUrl(graphName),VERTEX,StringUtils.encodeUrl(collectionName),StringUtils.encodeUrl(key)),new MapBuilder().put(IF_MATCH,ifMatchRevision,true).put(IF_NONE_MATCH,ifNoneMatchRevision,true).get(),new MapBuilder().put("String_Node_Str",keepNull).put(WAIT_FOR_SYNC,waitForSync).get(),EntityFactory.toJsonString(vertex,keepNull != null && !keepNull));
  VertexEntity<T> result;
  if (vertex != null) {
    result=createEntity(res,VertexEntity.class,vertex.getClass());
    result.setEntity(vertex);
    annotationHandler.updateDocumentAttributes(result.getEntity(),result.getDocumentRevision(),result.getDocumentHandle(),result.getDocumentKey());
  }
 else {
    result=createEntity(res,VertexEntity.class);
  }
  return result;
}
Program: 32773
Project: 32773
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public <T>VertexEntity<T> createVertex(String database,String graphName,String collectionName,String key,T vertex,Boolean waitForSync) throws ArangoException {
  JsonObject obj;
  if (vertex == null) {
    obj=new JsonObject();
  }
 else {
    JsonElement elem=EntityFactory.toJsonElement(vertex,false);
    if (elem.isJsonObject()) {
      obj=elem.getAsJsonObject();
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  if (key != null) {
    obj.addProperty("String_Node_Str",key);
  }
  validateCollectionName(graphName);
  HttpResponseEntity res=httpManager.doPost(createGharialEndpointUrl(database,StringUtils.encodeUrl(graphName),VERTEX,StringUtils.encodeUrl(collectionName)),new MapBuilder().put(WAIT_FOR_SYNC,waitForSync).get(),EntityFactory.toJsonString(obj));
  if (wrongResult(res)) {
    throw new ArangoException(UNKNOWN_ERROR);
  }
  VertexEntity<T> result;
  if (isInBatchMode()) {
    result=new VertexEntity<T>();
    result.setEntity(vertex);
  }
 else {
    result=createEntity(res,VertexEntity.class,vertex.getClass());
    result.setEntity(vertex);
    annotationHandler.updateDocumentAttributes(result.getEntity(),result.getDocumentRevision(),result.getDocumentHandle(),result.getDocumentKey());
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public <T>VertexEntity<T> createVertex(String database,String graphName,String collectionName,String key,T vertex,Boolean waitForSync) throws ArangoException {
  JsonObject obj;
  if (vertex == null) {
    obj=new JsonObject();
  }
 else {
    JsonElement elem=EntityFactory.toJsonElement(vertex,false);
    if (elem.isJsonObject()) {
      obj=elem.getAsJsonObject();
    }
 else {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  if (key != null) {
    obj.addProperty("String_Node_Str",key);
  }
  validateCollectionName(graphName);
  HttpResponseEntity res=httpManager.doPost(createGharialEndpointUrl(database,StringUtils.encodeUrl(graphName),VERTEX,StringUtils.encodeUrl(collectionName)),new MapBuilder().put(WAIT_FOR_SYNC,waitForSync).get(),EntityFactory.toJsonString(obj));
  if (wrongResult(res)) {
    throw new ArangoException(UNKNOWN_ERROR);
  }
  VertexEntity<T> result;
  if (isInBatchMode()) {
    result=new VertexEntity<T>();
    result.setEntity(vertex);
  }
 else {
    if (vertex != null) {
      result=createEntity(res,VertexEntity.class,vertex.getClass());
    }
 else {
      result=createEntity(res,VertexEntity.class);
    }
    result.setEntity(vertex);
    annotationHandler.updateDocumentAttributes(result.getEntity(),result.getDocumentRevision(),result.getDocumentHandle(),result.getDocumentKey());
  }
  return result;
}
Program: 32774
Project: 32774
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public <T>VertexEntity<T> replaceVertex(String databaseName,String graphName,String collectionName,String key,T vertex,Boolean waitForSync,Long ifMatchRevision,Long ifNoneMatchRevision) throws ArangoException {
  validateCollectionName(graphName);
  HttpResponseEntity res=httpManager.doPut(createGharialEndpointUrl(databaseName,StringUtils.encodeUrl(graphName),VERTEX,StringUtils.encodeUrl(collectionName),StringUtils.encodeUrl(key)),new MapBuilder().put(IF_MATCH,ifMatchRevision,true).put(IF_NONE_MATCH,ifNoneMatchRevision,true).get(),new MapBuilder().put(WAIT_FOR_SYNC,waitForSync).get(),EntityFactory.toJsonString(vertex));
  VertexEntity<T> result=createEntity(res,VertexEntity.class,vertex.getClass());
  if (vertex != null) {
    result.setEntity(vertex);
    annotationHandler.updateDocumentAttributes(result.getEntity(),result.getDocumentRevision(),result.getDocumentHandle(),result.getDocumentKey());
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public <T>VertexEntity<T> replaceVertex(String databaseName,String graphName,String collectionName,String key,T vertex,Boolean waitForSync,Long ifMatchRevision,Long ifNoneMatchRevision) throws ArangoException {
  validateCollectionName(graphName);
  HttpResponseEntity res=httpManager.doPut(createGharialEndpointUrl(databaseName,StringUtils.encodeUrl(graphName),VERTEX,StringUtils.encodeUrl(collectionName),StringUtils.encodeUrl(key)),new MapBuilder().put(IF_MATCH,ifMatchRevision,true).put(IF_NONE_MATCH,ifNoneMatchRevision,true).get(),new MapBuilder().put(WAIT_FOR_SYNC,waitForSync).get(),EntityFactory.toJsonString(vertex));
  VertexEntity<T> result;
  if (vertex != null) {
    result=createEntity(res,VertexEntity.class,vertex.getClass());
    result.setEntity(vertex);
    annotationHandler.updateDocumentAttributes(result.getEntity(),result.getDocumentRevision(),result.getDocumentHandle(),result.getDocumentKey());
  }
 else {
    result=createEntity(res,VertexEntity.class);
  }
  return result;
}
Program: 32775
Project: 32775
Buggy source:
/** 
 * @param database
 * @param allowNull
 * @throws ArangoException
 * @see <a href=
	 *      "http://www.arangodb.com/manuals/current/NamingConventions.html#DatabaseNames">
	 *      DatabaseNames documentation</a>
 */
protected void validateDatabaseName(String database,boolean allowNull) throws ArangoException {
  boolean valid=false;
  if (database == null) {
    if (allowNull) {
      valid=true;
    }
  }
 else {
    valid=databaseNamePattern.matcher(database).matches();
    if (database.equals("String_Node_Str")) {
      valid=true;
    }
  }
  if (!valid) {
    throw new ArangoException("String_Node_Str" + database);
  }
}

Fixed version (ground truth):
/** 
 * @param database
 * @param allowNull
 * @throws ArangoException
 * @see <a href=
	 *      "https://docs.arangodb.com/NamingConventions/DatabaseNames.html">
	 *      DatabaseNames documentation</a>
 */
protected void validateDatabaseName(String database,boolean allowNull) throws ArangoException {
  boolean valid=false;
  if (database == null) {
    if (allowNull) {
      valid=true;
    }
  }
 else {
    valid=databaseNamePattern.matcher(database).matches();
    if (database.equals("String_Node_Str")) {
      valid=true;
    }
  }
  if (!valid) {
    throw new ArangoException("String_Node_Str" + database);
  }
}
Program: 32776
Project: 32776
Buggy source:
protected String createEndpointUrl(String database,Object... paths) throws ArangoException {
  List<String> list=new ArrayList<String>();
  if (database != null) {
    validateDatabaseName(database,false);
    list.add("String_Node_Str");
    list.add(database);
  }
  for (  Object path : paths) {
    if (path != null) {
      list.add(path.toString());
    }
  }
  return StringUtils.join(false,list);
}

Fixed version (ground truth):
protected String createEndpointUrl(String database,String str,Object... paths) throws ArangoException {
  if (paths == null) {
    return createEndpointUrl(database,paths);
  }
  Object[] newPaths=new Object[paths.length + 1];
  newPaths[0]=str;
  for (int i=0; i < paths.length; i++) {
    newPaths[i + 1]=paths[i];
  }
  return createEndpointUrl(database,newPaths);
}
Program: 32777
Project: 32777
Buggy source:
ReplicationSyncEntity syncReplication(String _database,String endpoint,String database,String username,String password,RestrictType restrictType,String... restrictCollections) throws ArangoException ;

Fixed version (ground truth):
ReplicationSyncEntity syncReplication(String localDatabase,String endpoint,String database,String username,String password,RestrictType restrictType,String... restrictCollections) throws ArangoException ;
Program: 32778
Project: 32778
Buggy source:
public List<String> getCollections(){
  return collections;
}

Fixed version (ground truth):
public List<String> getCollections(){
  if (collections == null) {
    collections=new ArrayList<String>();
  }
  return collections;
}
Program: 32779
Project: 32779
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public synchronized void updateEdgeAttributes(Object o,long rev,String id,String key,String from,String to){
  if (o == null) {
  }
 else   if (o instanceof java.util.Map) {
    java.util.Map m=(java.util.Map)o;
    m.put(BaseDocument.ID,id);
    m.put(BaseDocument.KEY,key);
    m.put(BaseDocument.REV,rev);
    m.put(BaseDocument.FROM,from);
    m.put(BaseDocument.TO,to);
  }
 else {
    DocumentAttributes documentAttributes=getDocumentAttributes(o);
    setAttribute(documentAttributes.id,o,id);
    setAttribute(documentAttributes.key,o,key);
    setAttribute(documentAttributes.rev,o,rev);
    setAttribute(documentAttributes.from,o,from);
    setAttribute(documentAttributes.to,o,to);
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public synchronized void updateEdgeAttributes(Object o,long rev,String id,String key,String from,String to){
  if (o != null) {
    if (o instanceof java.util.Map) {
      java.util.Map m=(java.util.Map)o;
      m.put(BaseDocument.ID,id);
      m.put(BaseDocument.KEY,key);
      m.put(BaseDocument.REV,rev);
      m.put(BaseDocument.FROM,from);
      m.put(BaseDocument.TO,to);
    }
 else {
      DocumentAttributes documentAttributes=getDocumentAttributes(o);
      setAttribute(documentAttributes.id,o,id);
      setAttribute(documentAttributes.key,o,key);
      setAttribute(documentAttributes.rev,o,rev);
      setAttribute(documentAttributes.from,o,from);
      setAttribute(documentAttributes.to,o,to);
    }
  }
}
Program: 32780
Project: 32780
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public synchronized void updateDocumentRev(Object o,long rev){
  if (o == null) {
  }
 else   if (o instanceof java.util.Map) {
    java.util.Map m=(java.util.Map)o;
    m.put(BaseDocument.REV,rev);
  }
 else {
    DocumentAttributes documentAttributes=getDocumentAttributes(o);
    setAttribute(documentAttributes.rev,o,rev);
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public synchronized void updateDocumentRev(Object o,long rev){
  if (o != null) {
    if (o instanceof java.util.Map) {
      java.util.Map m=(java.util.Map)o;
      m.put(BaseDocument.REV,rev);
    }
 else {
      DocumentAttributes documentAttributes=getDocumentAttributes(o);
      setAttribute(documentAttributes.rev,o,rev);
    }
  }
}
Program: 32781
Project: 32781
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public synchronized void updateDocumentAttributes(Object o,long rev,String id,String key){
  if (o == null) {
  }
 else   if (o instanceof java.util.Map) {
    java.util.Map m=(java.util.Map)o;
    m.put(BaseDocument.ID,id);
    m.put(BaseDocument.KEY,key);
    m.put(BaseDocument.REV,rev);
  }
 else {
    DocumentAttributes documentAttributes=getDocumentAttributes(o);
    setAttribute(documentAttributes.id,o,id);
    setAttribute(documentAttributes.key,o,key);
    setAttribute(documentAttributes.rev,o,rev);
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public synchronized void updateDocumentAttributes(Object o,long rev,String id,String key){
  if (o != null) {
    if (o instanceof java.util.Map) {
      java.util.Map m=(java.util.Map)o;
      m.put(BaseDocument.ID,id);
      m.put(BaseDocument.KEY,key);
      m.put(BaseDocument.REV,rev);
    }
 else {
      DocumentAttributes documentAttributes=getDocumentAttributes(o);
      setAttribute(documentAttributes.id,o,id);
      setAttribute(documentAttributes.key,o,key);
      setAttribute(documentAttributes.rev,o,rev);
    }
  }
}
Program: 32782
Project: 32782
Buggy source:
private void setAttribute(Field field,Object o,Object value){
  if (field != null) {
    try {
      field.setAccessible(true);
      field.set(o,value);
    }
 catch (    Throwable e) {
      logger.error("String_Node_Str" + value.getClass().getCanonicalName(),e);
    }
  }
}

Fixed version (ground truth):
private void setAttribute(Field field,Object o,Object value){
  if (field != null) {
    try {
      field.setAccessible(true);
      field.set(o,value);
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + value.getClass().getCanonicalName(),e);
    }
  }
}
Program: 32783
Project: 32783
Buggy source:
private Field getFieldByAnnotationValue(Class<?> clazz,String value){
  List<Field> fields=getAllDeclaredFields(clazz);
  for (  Field field : fields) {
    Annotation[] annotations=field.getAnnotations();
    for (    Annotation annotation : annotations) {
      if (annotation instanceof SerializedName) {
        SerializedName sn=(SerializedName)annotation;
        if (value.equals(sn.value())) {
          return field;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private Field getFieldByAnnotationValue(Class<?> clazz,String value){
  List<Field> fields=getAllDeclaredFields(clazz);
  for (  Field field : fields) {
    Annotation[] annotations=field.getAnnotations();
    for (    Annotation annotation : annotations) {
      if (annotation instanceof SerializedName && value.equals(((SerializedName)annotation).value())) {
        return field;
      }
    }
  }
  return null;
}
Program: 32784
Project: 32784
Buggy source:
@Override public CollectionEntity getCollectionRevision(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str",name,"String_Node_Str"),null);
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity getCollectionRevision(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,API_COLLECTION,name,"String_Node_Str"),null);
  return createEntity(res,CollectionEntity.class);
}
Program: 32785
Project: 32785
Buggy source:
@Override public CollectionEntity getCollectionChecksum(String database,String name,Boolean withRevisions,Boolean withData) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str",name,"String_Node_Str"),new MapBuilder().put("String_Node_Str",withRevisions).put("String_Node_Str",withData).get());
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity getCollectionChecksum(String database,String name,Boolean withRevisions,Boolean withData) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,API_COLLECTION,name,"String_Node_Str"),new MapBuilder().put("String_Node_Str",withRevisions).put("String_Node_Str",withData).get());
  return createEntity(res,CollectionEntity.class);
}
Program: 32786
Project: 32786
Buggy source:
@Override public CollectionEntity renameCollection(String database,String name,String newName) throws ArangoException {
  validateCollectionName(newName);
  HttpResponseEntity res=httpManager.doPut(createEndpointUrl(database,"String_Node_Str",name,"String_Node_Str"),null,EntityFactory.toJsonString(new MapBuilder("String_Node_Str",newName).get()));
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity renameCollection(String database,String name,String newName) throws ArangoException {
  validateCollectionName(newName);
  HttpResponseEntity res=httpManager.doPut(createEndpointUrl(database,API_COLLECTION,name,"String_Node_Str"),null,EntityFactory.toJsonString(new MapBuilder("String_Node_Str",newName).get()));
  return createEntity(res,CollectionEntity.class);
}
Program: 32787
Project: 32787
Buggy source:
@Override public CollectionEntity getCollection(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str",name),null);
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity getCollection(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,API_COLLECTION,name),null);
  return createEntity(res,CollectionEntity.class);
}
Program: 32788
Project: 32788
Buggy source:
@Override public CollectionEntity getCollectionProperties(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str",name,"String_Node_Str"),null);
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity getCollectionProperties(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,API_COLLECTION,name,"String_Node_Str"),null);
  return createEntity(res,CollectionEntity.class);
}
Program: 32789
Project: 32789
Buggy source:
@Override public CollectionEntity deleteCollection(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doDelete(createEndpointUrl(database,"String_Node_Str",name),null);
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity deleteCollection(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doDelete(createEndpointUrl(database,API_COLLECTION,name),null);
  return createEntity(res,CollectionEntity.class);
}
Program: 32790
Project: 32790
Buggy source:
@Override public CollectionEntity getCollectionFigures(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str",name,"String_Node_Str"),null);
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity getCollectionFigures(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,API_COLLECTION,name,"String_Node_Str"),null);
  return createEntity(res,CollectionEntity.class);
}
Program: 32791
Project: 32791
Buggy source:
@Override public CollectionsEntity getCollections(String database,Boolean excludeSystem) throws ArangoException {
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str"),null,new MapBuilder().put("String_Node_Str",excludeSystem).get());
  return createEntity(res,CollectionsEntity.class);
}

Fixed version (ground truth):
@Override public CollectionsEntity getCollections(String database,Boolean excludeSystem) throws ArangoException {
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,API_COLLECTION),null,new MapBuilder().put("String_Node_Str",excludeSystem).get());
  return createEntity(res,CollectionsEntity.class);
}
Program: 32792
Project: 32792
Buggy source:
@Override public CollectionEntity loadCollection(String database,String name,Boolean count) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doPut(createEndpointUrl(database,"String_Node_Str",name,"String_Node_Str"),null,EntityFactory.toJsonString(new MapBuilder("String_Node_Str",count).get()));
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity loadCollection(String database,String name,Boolean count) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doPut(createEndpointUrl(database,API_COLLECTION,name,"String_Node_Str"),null,EntityFactory.toJsonString(new MapBuilder("String_Node_Str",count).get()));
  return createEntity(res,CollectionEntity.class);
}
Program: 32793
Project: 32793
Buggy source:
@Override public CollectionEntity setCollectionProperties(String database,String name,Boolean newWaitForSync,Long journalSize) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doPut(createEndpointUrl(database,"String_Node_Str",name,"String_Node_Str"),null,EntityFactory.toJsonString(new MapBuilder().put("String_Node_Str",newWaitForSync).put("String_Node_Str",journalSize).get()));
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity setCollectionProperties(String database,String name,Boolean newWaitForSync,Long journalSize) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doPut(createEndpointUrl(database,API_COLLECTION,name,"String_Node_Str"),null,EntityFactory.toJsonString(new MapBuilder().put("String_Node_Str",newWaitForSync).put("String_Node_Str",journalSize).get()));
  return createEntity(res,CollectionEntity.class);
}
Program: 32794
Project: 32794
Buggy source:
@Override public CollectionEntity getCollectionCount(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,"String_Node_Str",name,"String_Node_Str"),null);
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity getCollectionCount(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(database,API_COLLECTION,name,"String_Node_Str"),null);
  return createEntity(res,CollectionEntity.class);
}
Program: 32795
Project: 32795
Buggy source:
@Override public CollectionEntity truncateCollection(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doPut(createEndpointUrl(database,"String_Node_Str",name,"String_Node_Str"),null,null);
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity truncateCollection(String database,String name) throws ArangoException {
  validateCollectionName(name);
  HttpResponseEntity res=httpManager.doPut(createEndpointUrl(database,API_COLLECTION,name,"String_Node_Str"),null,null);
  return createEntity(res,CollectionEntity.class);
}
Program: 32796
Project: 32796
Buggy source:
@Override public CollectionEntity createCollection(String database,String name,CollectionOptions collectionOptions) throws ArangoException {
  if (collectionOptions == null) {
    collectionOptions=new CollectionOptions();
  }
  HttpResponseEntity res=httpManager.doPost(createEndpointUrl(database,"String_Node_Str"),null,EntityFactory.toJsonString(new MapBuilder().put("String_Node_Str",name).put("String_Node_Str",collectionOptions.getWaitForSync()).put("String_Node_Str",collectionOptions.getDoCompact()).put("String_Node_Str",collectionOptions.getJournalSize()).put("String_Node_Str",collectionOptions.getIsSystem()).put("String_Node_Str",collectionOptions.getIsVolatile()).put("String_Node_Str",collectionOptions.getKeyOptions()).put("String_Node_Str",collectionOptions.getNumberOfShards()).put("String_Node_Str",collectionOptions.getShardKeys()).put("String_Node_Str",collectionOptions.getType() == null ? null : collectionOptions.getType().getType()).get()));
  return createEntity(res,CollectionEntity.class);
}

Fixed version (ground truth):
@Override public CollectionEntity createCollection(String database,String name,CollectionOptions collectionOptions) throws ArangoException {
  CollectionOptions tmpCollectionOptions=collectionOptions;
  if (tmpCollectionOptions == null) {
    tmpCollectionOptions=new CollectionOptions();
  }
  HttpResponseEntity res=httpManager.doPost(createEndpointUrl(database,API_COLLECTION),null,EntityFactory.toJsonString(new MapBuilder().put("String_Node_Str",name).put("String_Node_Str",tmpCollectionOptions.getWaitForSync()).put("String_Node_Str",tmpCollectionOptions.getDoCompact()).put("String_Node_Str",tmpCollectionOptions.getJournalSize()).put("String_Node_Str",tmpCollectionOptions.getIsSystem()).put("String_Node_Str",tmpCollectionOptions.getIsVolatile()).put("String_Node_Str",tmpCollectionOptions.getKeyOptions()).put("String_Node_Str",tmpCollectionOptions.getNumberOfShards()).put("String_Node_Str",tmpCollectionOptions.getShardKeys()).put("String_Node_Str",tmpCollectionOptions.getType() == null ? null : tmpCollectionOptions.getType().getType()).get()));
  return createEntity(res,CollectionEntity.class);
}
Program: 32797
Project: 32797
Buggy source:
@Override public BooleanResultEntity createDatabase(String database,UserEntity... users) throws ArangoException {
  validateDatabaseName(database,false);
  TreeMap<String,Object> body=new TreeMap<String,Object>();
  body.put("String_Node_Str",database);
  if (users != null && users.length > 0) {
    body.put("String_Node_Str",users);
  }
  HttpResponseEntity res=httpManager.doPost(createEndpointUrl(null,"String_Node_Str"),null,EntityFactory.toJsonString(body));
  return createEntity(res,BooleanResultEntity.class);
}

Fixed version (ground truth):
@Override public BooleanResultEntity createDatabase(String database,UserEntity... users) throws ArangoException {
  validateDatabaseName(database,false);
  TreeMap<String,Object> body=new TreeMap<String,Object>();
  body.put("String_Node_Str",database);
  if (users != null && users.length > 0) {
    body.put("String_Node_Str",users);
  }
  HttpResponseEntity res=httpManager.doPost(createEndpointUrl(null,API_DATABASE),null,EntityFactory.toJsonString(body));
  return createEntity(res,BooleanResultEntity.class);
}
Program: 32798
Project: 32798
Buggy source:
@Override public StringsResultEntity getDatabases(boolean currentUserAccessableOnly,String username,String password) throws ArangoException {
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(null,"String_Node_Str",currentUserAccessableOnly ? "String_Node_Str" : null),null,null,username,password);
  return createEntity(res,StringsResultEntity.class);
}

Fixed version (ground truth):
@Override public StringsResultEntity getDatabases(boolean currentUserAccessableOnly,String username,String password) throws ArangoException {
  HttpResponseEntity res=httpManager.doGet(createEndpointUrl(null,API_DATABASE,currentUserAccessableOnly ? "String_Node_Str" : null),null,null,username,password);
  return createEntity(res,StringsResultEntity.class);
}
Program: 32799
Project: 32799
Buggy source:
@Override public BooleanResultEntity deleteDatabase(String database) throws ArangoException {
  validateDatabaseName(database,false);
  TreeMap<String,Object> body=new TreeMap<String,Object>();
  body.put("String_Node_Str",database);
  HttpResponseEntity res=httpManager.doDelete(createEndpointUrl(null,"String_Node_Str",database),null);
  return createEntity(res,BooleanResultEntity.class);
}

Fixed version (ground truth):
@Override public BooleanResultEntity deleteDatabase(String database) throws ArangoException {
  validateDatabaseName(database,false);
  TreeMap<String,Object> body=new TreeMap<String,Object>();
  body.put("String_Node_Str",database);
  HttpResponseEntity res=httpManager.doDelete(createEndpointUrl(null,API_DATABASE,database),null);
  return createEntity(res,BooleanResultEntity.class);
}
Program: 32800
Project: 32800
Buggy source:
@Override public List<String> getDocuments(String database,String collectionName,boolean handleConvert) throws ArangoException {
  HttpResponseEntity res=httpManager.doGet(createDocumentEndpointUrl(database),new MapBuilder("String_Node_Str",collectionName).get());
  DocumentsEntity entity=createEntity(res,DocumentsEntity.class);
  List<String> documents=CollectionUtils.safety(entity.getDocuments());
  if (handleConvert && !documents.isEmpty()) {
    ListIterator<String> lit=documents.listIterator();
    while (lit.hasNext()) {
      String d=lit.next();
      if (d.startsWith(API_DOCUMENT_PREFIX)) {
        lit.set(d.substring(API_DOCUMENT_PREFIX.length()));
      }
 else {
        Matcher matcher=pattern.matcher(d);
        if (matcher.find()) {
          lit.set(matcher.group(1));
        }
      }
    }
  }
  return documents;
}

Fixed version (ground truth):
@Override public List<String> getDocuments(String database,String collectionName,boolean handleConvert) throws ArangoException {
  HttpResponseEntity res=httpManager.doGet(createDocumentEndpointUrl(database),new MapBuilder("String_Node_Str",collectionName).get());
  DocumentsEntity entity=createEntity(res,DocumentsEntity.class);
  List<String> documents=CollectionUtils.safety(entity.getDocuments());
  if (handleConvert && !documents.isEmpty()) {
    updateDocumentHandles(documents);
  }
  return documents;
}
Program: 32801
Project: 32801
Buggy source:
public int size(){
  return innerMap.size();
}

Fixed version (ground truth):
@Override public int size(){
  return innerMap.size();
}
Program: 32802
Project: 32802
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: 32803
Project: 32803
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: 32804
Project: 32804
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: 32805
Project: 32805
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: 32806
Project: 32806
Buggy source:
public Collection<V> values(){
  return innerMap.values();
}

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

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

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

Fixed version (ground truth):
@Override public Set<K> keySet(){
  return innerMap.keySet();
}
Program: 32810
Project: 32810
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: 32811
Project: 32811
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: 32812
Project: 32812
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: 32813
Project: 32813
Buggy source:
public long getDocumentRevision(){
  return documentRevision;
}

Fixed version (ground truth):
@Override public long getDocumentRevision(){
  return documentRevision;
}
Program: 32814
Project: 32814
Buggy source:
public String getDocumentKey(){
  return documentKey;
}

Fixed version (ground truth):
@Override public String getDocumentKey(){
  return documentKey;
}
Program: 32815
Project: 32815
Buggy source:
public String getDocumentHandle(){
  return documentHandle;
}

Fixed version (ground truth):
@Override public String getDocumentHandle(){
  return documentHandle;
}
Program: 32816
Project: 32816
Buggy source:
public void setDocumentHandle(String documentHandle){
  this.documentHandle=documentHandle;
}

Fixed version (ground truth):
@Override public void setDocumentHandle(String documentHandle){
  this.documentHandle=documentHandle;
}
Program: 32817
Project: 32817
Buggy source:
public void setDocumentKey(String documentKey){
  this.documentKey=documentKey;
}

Fixed version (ground truth):
@Override public void setDocumentKey(String documentKey){
  this.documentKey=documentKey;
}
Program: 32818
Project: 32818
Buggy source:
public void setDocumentRevision(long documentRevision){
  this.documentRevision=documentRevision;
}

Fixed version (ground truth):
@Override public void setDocumentRevision(long documentRevision){
  this.documentRevision=documentRevision;
}
Program: 32819
Project: 32819
Buggy source:
public Iterator<String> iterator(){
  return CollectionUtils.safetyIterator(documents);
}

Fixed version (ground truth):
@Override public Iterator<String> iterator(){
  return CollectionUtils.safetyIterator(documents);
}
Program: 32820
Project: 32820
Buggy source:
public static <T>String toImportHeaderValues(Collection<? extends Collection<?>> headerValues){
  StringWriter writer=new StringWriter();
  for (  Collection<?> array : headerValues) {
    gson.toJson(array,writer);
    writer.write('\n');
  }
  writer.flush();
  return writer.toString();
}

Fixed version (ground truth):
public static String toImportHeaderValues(Collection<? extends Collection<?>> headerValues){
  StringWriter writer=new StringWriter();
  for (  Collection<?> array : headerValues) {
    gson.toJson(array,writer);
    writer.write('\n');
  }
  writer.flush();
  return writer.toString();
}
Program: 32821
Project: 32821
Buggy source:
public T next(){
  if (hasNext()) {
    if (pos >= entity.size()) {
      try {
        updateEntity();
      }
 catch (      ArangoException e) {
        throw new IllegalStateException(e);
      }
    }
    return entity.get(pos++);
  }
  throw new NoSuchElementException();
}

Fixed version (ground truth):
@Override public T next(){
  if (hasNext()) {
    if (pos >= entity.size()) {
      try {
        updateEntity();
      }
 catch (      ArangoException e) {
        throw new IllegalStateException(e);
      }
    }
    return entity.get(pos++);
  }
  throw new NoSuchElementException();
}
Program: 32822
Project: 32822
Buggy source:
private void updateEntity() throws ArangoException {
  long cursorId=entity.getCursorId();
  this.entity=cursorDriver.continueQuery(database,cursorId,this.clazz);
  this.pos=0;
}

Fixed version (ground truth):
public void updateEntity() throws ArangoException {
  long cursorId=entity.getCursorId();
  this.entity=cursorDriver.continueQuery(database,cursorId,this.clazz);
  this.pos=0;
}
Program: 32823
Project: 32823
Buggy source:
public Iterator<T> iterator(){
  return new CursorIterator();
}

Fixed version (ground truth):
@Override public Iterator<T> iterator(){
  return new CursorIterator();
}
Program: 32824
Project: 32824
Buggy source:
public boolean hasNext(){
  if (entity == null) {
    return false;
  }
  if (pos < entity.size()) {
    return true;
  }
  if (entity.hasMore()) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  if (entity == null) {
    return false;
  }
  if (pos < entity.size()) {
    return true;
  }
  if (entity.hasMore()) {
    return true;
  }
  return false;
}
Program: 32825
Project: 32825
Buggy source:
public void remove(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void remove(){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 32826
Project: 32826
Buggy source:
/** 
 * This method executes an AQL query and returns a DocumentCursor
 * @param query an AQL query as string
 * @param bindVars a map containing all bind variables,
 * @param aqlQueryOptions AQL query options (null for default values)
 * @param clazz the expected class, the result from the server request is deserialized to an instance of this class.
 * @return DocumentCursor<T>
 * @throws ArangoException
 */
public <T>DocumentCursor<T> executeDocumentQuery(String query,Map<String,Object> bindVars,AqlQueryOptions aqlQueryOptions,Class<T> clazz) throws ArangoException {
  if (aqlQueryOptions == null) {
    aqlQueryOptions=getDefaultAqlQueryOptions();
  }
  @SuppressWarnings("String_Node_Str") DocumentCursorResult<T,DocumentEntity<T>> baseCursor=cursorDriver.executeBaseCursorQuery(getDefaultDatabase(),query,bindVars,aqlQueryOptions,DocumentEntity.class,clazz);
  return new DocumentCursor<T>(baseCursor);
}

Fixed version (ground truth):
/** 
 * This method executes an AQL query and returns a DocumentCursor
 * @param query an AQL query as string
 * @param bindVars a map containing all bind variables,
 * @param aqlQueryOptions AQL query options (null for default values)
 * @param clazz the expected class, the result from the server request is deserialized to an instance of this class.
 * @return DocumentCursor<T>
 * @throws ArangoException
 */
public <T>DocumentCursor<T> executeDocumentQuery(String query,Map<String,Object> bindVars,AqlQueryOptions aqlQueryOptions,Class<T> clazz) throws ArangoException {
  @SuppressWarnings("String_Node_Str") DocumentCursorResult<T,DocumentEntity<T>> baseCursor=cursorDriver.executeBaseCursorQuery(getDefaultDatabase(),query,bindVars,getAqlQueryOptions(aqlQueryOptions),DocumentEntity.class,clazz);
  return new DocumentCursor<T>(baseCursor);
}