nus-yam/ex-repair huggingface dataset:
Program: 93554
Project: 93554
Buggy source:
@Test public void testHandleRequest() throws Exception {
  System.out.println("String_Node_Str");
  String url=DB_URL + "String_Node_Str" + BUCKET+ "String_Node_Str"+ OID+ "String_Node_Str";
  System.out.println("String_Node_Str" + url);
  Response resp=executor.execute(Request.Get(url));
  File tempFile=tempFolder.newFile(FILENAME);
  resp.saveContent(tempFile);
  assertTrue(tempFile.length() > 0);
}

Fixed version (ground truth):
@Test public void testHandleRequest() throws Exception {
  System.out.println("String_Node_Str");
  createFile();
  String url=dbTmpUri + "String_Node_Str" + BUCKET+ "String_Node_Str"+ OID+ "String_Node_Str";
  System.out.println("String_Node_Str" + url);
  Response resp=adminExecutor.execute(Request.Get(url));
  File tempFile=tempFolder.newFile(FILENAME);
  resp.saveContent(tempFile);
  assertTrue(tempFile.length() > 0);
}
Program: 93555
Project: 93555
Buggy source:
private String replaceObjectIdsInFilters(BSONObject source){
  if (source == null) {
    return null;
  }
  BasicDBObject ret=new BasicDBObject();
  source.keySet().stream().forEach((key) -> {
    Object value=source.get(key);
    if (value instanceof BSONObject) {
      ret.append(key,replaceObjectIdsInFilters((BSONObject)value));
    }
 else     if (ObjectId.isValid(value.toString())) {
      ret.append(key,new ObjectId(value.toString()));
    }
 else {
      ret.append(key,value);
    }
  }
);
  return ret.toString();
}

Fixed version (ground truth):
private void replaceObjectIdsInFilters(BSONObject source){
  if (source == null) {
    return;
  }
  source.keySet().stream().forEach((key) -> {
    Object value=source.get(key);
    if (value instanceof BSONObject) {
      replaceObjectIdsInFilters((BSONObject)value);
    }
 else     if (ObjectId.isValid(value.toString())) {
      source.put(key,new ObjectId(value.toString()));
    }
  }
);
}
Program: 93558
Project: 93558
Buggy source:
/** 
 * @param context
 * @param dbName
 * @param collName
 * @param referenceField
 * @param id
 * @param detectOids if false adds the detect_oids=false query parameter
 * @return
 */
static public String getUriWithFilterManyInverse(RequestContext context,String dbName,String collName,String referenceField,Object id,boolean detectOids) throws UnsupportedDocumentIdException {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(dbName).append("String_Node_Str").append(collName).append("String_Node_Str").append("String_Node_Str").append(referenceField).append("String_Node_Str").append("String_Node_Str").append(getIdString(id)).append("String_Node_Str");
  if (!detectOids) {
    sb.append("String_Node_Str");
  }
  return context.mapUri(sb.toString().replaceAll("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @param context
 * @param dbName
 * @param collName
 * @param referenceField
 * @param id
 * @param detectOids if false adds the detect_oids=false query parameter
 * @return
 * @throws org.restheart.utils.UnsupportedDocumentIdException
 */
static public String getUriWithFilterManyInverse(RequestContext context,String dbName,String collName,String referenceField,Object id,boolean detectOids) throws UnsupportedDocumentIdException {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(dbName).append("String_Node_Str").append(collName).append("String_Node_Str").append("String_Node_Str").append(referenceField).append("String_Node_Str").append("String_Node_Str").append(getIdString(id)).append("String_Node_Str");
  if (!detectOids) {
    sb.append("String_Node_Str");
  }
  return context.mapUri(sb.toString().replaceAll("String_Node_Str","String_Node_Str"));
}
Program: 93559
Project: 93559
Buggy source:
/** 
 * @param context
 * @param dbName
 * @param collName
 * @param referenceField
 * @param ids
 * @param detectOids if false adds the detect_oids=false query parameter
 * @return
 */
static public String getUriWithFilterMany(RequestContext context,String dbName,String collName,String referenceField,Object[] ids,boolean detectOids) throws UnsupportedDocumentIdException {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(dbName).append("String_Node_Str").append(collName).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(referenceField).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(getIdsString(ids)).append("String_Node_Str");
  if (!detectOids) {
    sb.append("String_Node_Str");
  }
  return context.mapUri(sb.toString().replaceAll("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @param context
 * @param dbName
 * @param collName
 * @param ids
 * @param detectOids if false adds the detect_oids=false query parameter
 * @return
 * @throws org.restheart.utils.UnsupportedDocumentIdException
 */
static public String getUriWithFilterMany(RequestContext context,String dbName,String collName,Object[] ids,boolean detectOids) throws UnsupportedDocumentIdException {
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str").append(dbName).append("String_Node_Str").append(collName).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(getIdsString(ids)).append("String_Node_Str");
  if (!detectOids) {
    sb.append("String_Node_Str");
  }
  return context.mapUri(sb.toString().replaceAll("String_Node_Str","String_Node_Str"));
}
Program: 93560
Project: 93560
Buggy source:
@Test public void testGetUriWithFilterManyString(){
  System.out.println("String_Node_Str");
  Object[] ids=new Object[]{1,20.0f,"String_Node_Str"};
  RequestContext context=prepareRequestContext();
  String expResult="String_Node_Str";
  String result;
  try {
    result=URLUtils.getUriWithFilterMany(context,"String_Node_Str","String_Node_Str","String_Node_Str",ids,false);
    assertEquals(expResult,result);
  }
 catch (  UnsupportedDocumentIdException ex) {
    fail(ex.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testGetUriWithFilterManyString(){
  System.out.println("String_Node_Str");
  Object[] ids=new Object[]{1,20.0f,"String_Node_Str"};
  RequestContext context=prepareRequestContext();
  String expResult="String_Node_Str";
  String result;
  try {
    result=URLUtils.getUriWithFilterMany(context,"String_Node_Str","String_Node_Str",ids,false);
    assertEquals(expResult,result);
  }
 catch (  UnsupportedDocumentIdException ex) {
    fail(ex.getMessage());
  }
}
Program: 93561
Project: 93561
Buggy source:
@Test public void testGetUriWithFilterMany(){
  System.out.println("String_Node_Str");
  Object[] ids=new Object[]{1,20.0f,"String_Node_Str"};
  RequestContext context=prepareRequestContext();
  String expResult="String_Node_Str";
  String result;
  try {
    result=URLUtils.getUriWithFilterMany(context,"String_Node_Str","String_Node_Str","String_Node_Str",ids,true);
    assertEquals(expResult,result);
  }
 catch (  UnsupportedDocumentIdException ex) {
    fail(ex.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testGetUriWithFilterMany(){
  System.out.println("String_Node_Str");
  Object[] ids=new Object[]{1,20.0f,"String_Node_Str"};
  RequestContext context=prepareRequestContext();
  String expResult="String_Node_Str";
  String result;
  try {
    result=URLUtils.getUriWithFilterMany(context,"String_Node_Str","String_Node_Str",ids,true);
    assertEquals(expResult,result);
  }
 catch (  UnsupportedDocumentIdException ex) {
    fail(ex.getMessage());
  }
}
Program: 93563
Project: 93563
Buggy source:
int upsertDocumentPost(HttpServerExchange exchange,String dbName,String collName,Object documentId,DBObject content,ObjectId requestEtag);

Fixed version (ground truth):
int upsertDocumentPost(String dbName,String collName,Object documentId,DBObject content,ObjectId requestEtag);
Program: 93564
Project: 93564
Buggy source:
/** 
 * @return the docIdType
 */
public URLUtils.DOC_ID_TYPE getDocIdType(){
  return docIdType;
}

Fixed version (ground truth):
/** 
 * @return the docIdType
 */
public DOC_ID_TYPE getDocIdType(){
  return docIdType;
}
Program: 93565
Project: 93565
Buggy source:
/** 
 * @param docIdType the docIdType to set
 */
public void setDocIdType(URLUtils.DOC_ID_TYPE docIdType){
  this.docIdType=docIdType;
}

Fixed version (ground truth):
/** 
 * @param docIdType the docIdType to set
 */
public void setDocIdType(DOC_ID_TYPE docIdType){
  this.docIdType=docIdType;
}
Program: 93570
Project: 93570
Buggy source:
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  if (context.getCollectionName().isEmpty() || context.getCollectionName().startsWith("String_Node_Str")) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  DBObject content=context.getContent();
  if (content == null) {
    content=new BasicDBObject();
  }
  if (content instanceof BasicDBList) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  if (content.containsField(Relationship.RELATIONSHIPS_ELEMENT_NAME)) {
    try {
      Relationship.getFromJson(content);
    }
 catch (    InvalidMetadataException ex) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + ex.getMessage(),ex);
      return;
    }
  }
  ObjectId etag=RequestHelper.getWriteEtag(exchange);
  boolean updating=context.getCollectionProps() != null;
  int SC=CollectionDAO.upsertCollection(context.getDBName(),context.getCollectionName(),content,etag,updating,false);
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    sendWarnings(SC,exchange,context);
  }
 else {
    exchange.setResponseCode(SC);
  }
  exchange.endExchange();
  LocalCachesSingleton.getInstance().invalidateCollection(context.getDBName(),context.getCollectionName());
}

Fixed version (ground truth):
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  if (context.getCollectionName().isEmpty() || context.getCollectionName().startsWith("String_Node_Str")) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  DBObject content=context.getContent();
  if (content == null) {
    content=new BasicDBObject();
  }
  if (content instanceof BasicDBList) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  if (content.containsField(Relationship.RELATIONSHIPS_ELEMENT_NAME)) {
    try {
      Relationship.getFromJson(content);
    }
 catch (    InvalidMetadataException ex) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + ex.getMessage(),ex);
      return;
    }
  }
  ObjectId etag=RequestHelper.getWriteEtag(exchange);
  boolean updating=context.getCollectionProps() != null;
  final CollectionDAO collectionDAO=new CollectionDAO();
  int httpCode=collectionDAO.upsertCollection(context.getDBName(),context.getCollectionName(),content,etag,updating,false);
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    sendWarnings(httpCode,exchange,context);
  }
 else {
    exchange.setResponseCode(httpCode);
  }
  exchange.endExchange();
  LocalCachesSingleton.getInstance().invalidateCollection(context.getDBName(),context.getCollectionName());
}
Program: 93571
Project: 93571
Buggy source:
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  ObjectId oid;
  String sid;
  if (ObjectId.isValid(context.getDocumentId())) {
    sid=null;
    oid=new ObjectId(context.getDocumentId());
  }
 else {
    sid=context.getDocumentId();
    oid=null;
  }
  BasicDBObject query;
  if (oid != null) {
    query=new BasicDBObject("String_Node_Str",oid);
  }
 else {
    query=new BasicDBObject("String_Node_Str",sid);
  }
  DBObject document=CollectionDAO.getCollection(context.getDBName(),context.getCollectionName()).findOne(query);
  if (document == null) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_FOUND,"String_Node_Str");
    return;
  }
  Object etag=document.get("String_Node_Str");
  if (etag != null && ObjectId.isValid("String_Node_Str" + etag)) {
    ObjectId _etag=new ObjectId("String_Node_Str" + etag);
    document.put("String_Node_Str",Instant.ofEpochSecond(_etag.getTimestamp()).toString());
    if (RequestHelper.checkReadEtag(exchange,etag.toString())) {
      ResponseHelper.endExchange(exchange,HttpStatus.SC_NOT_MODIFIED);
      return;
    }
  }
  String requestPath=URLUtilis.removeTrailingSlashes(exchange.getRequestPath());
  ResponseHelper.injectEtagHeader(exchange,document);
  exchange.setResponseCode(HttpStatus.SC_OK);
  DocumentRepresentationFactory.sendDocument(requestPath,exchange,context,document);
  exchange.endExchange();
}

Fixed version (ground truth):
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  ObjectId oid;
  String sid;
  if (ObjectId.isValid(context.getDocumentId())) {
    sid=null;
    oid=new ObjectId(context.getDocumentId());
  }
 else {
    sid=context.getDocumentId();
    oid=null;
  }
  BasicDBObject query;
  if (oid != null) {
    query=new BasicDBObject("String_Node_Str",oid);
  }
 else {
    query=new BasicDBObject("String_Node_Str",sid);
  }
  final CollectionDAO collectionDAO=new CollectionDAO();
  DBObject document=collectionDAO.getCollection(context.getDBName(),context.getCollectionName()).findOne(query);
  if (document == null) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_FOUND,"String_Node_Str");
    return;
  }
  Object etag=document.get("String_Node_Str");
  if (etag != null && ObjectId.isValid("String_Node_Str" + etag)) {
    ObjectId _etag=new ObjectId("String_Node_Str" + etag);
    document.put("String_Node_Str",Instant.ofEpochSecond(_etag.getTimestamp()).toString());
    if (RequestHelper.checkReadEtag(exchange,etag.toString())) {
      ResponseHelper.endExchange(exchange,HttpStatus.SC_NOT_MODIFIED);
      return;
    }
  }
  String requestPath=URLUtilis.removeTrailingSlashes(exchange.getRequestPath());
  ResponseHelper.injectEtagHeader(exchange,document);
  exchange.setResponseCode(HttpStatus.SC_OK);
  DocumentRepresentationFactory.sendDocument(requestPath,exchange,context,document);
  exchange.endExchange();
}
Program: 93572
Project: 93572
Buggy source:
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  if (context.getDBName() != null && context.getCollectionName() != null) {
    DBObject collProps;
    if (!LocalCachesSingleton.isEnabled()) {
      collProps=CollectionDAO.getCollectionProps(context.getDBName(),context.getCollectionName());
      if (collProps != null) {
        collProps.put("String_Node_Str",false);
      }
 else       if (!(context.getType() == RequestContext.TYPE.COLLECTION && context.getMethod() == RequestContext.METHOD.PUT) && context.getType() != RequestContext.TYPE.ROOT && context.getType() != RequestContext.TYPE.DB) {
        ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_FOUND,"String_Node_Str");
        return;
      }
    }
 else {
      collProps=LocalCachesSingleton.getInstance().getCollectionProps(context.getDBName(),context.getCollectionName());
    }
    if (collProps == null && !(context.getType() == RequestContext.TYPE.COLLECTION && context.getMethod() == RequestContext.METHOD.PUT) && context.getType() != RequestContext.TYPE.ROOT && context.getType() != RequestContext.TYPE.DB) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_FOUND,"String_Node_Str");
      return;
    }
    context.setCollectionProps(collProps);
  }
  next.handleRequest(exchange,context);
}

Fixed version (ground truth):
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  if (context.getDBName() != null && context.getCollectionName() != null) {
    DBObject collProps;
    if (!LocalCachesSingleton.isEnabled()) {
      final CollectionDAO collectionDAO=new CollectionDAO();
      collProps=collectionDAO.getCollectionProps(context.getDBName(),context.getCollectionName());
      if (collProps != null) {
        collProps.put("String_Node_Str",false);
      }
 else       if (!(context.getType() == RequestContext.TYPE.COLLECTION && context.getMethod() == RequestContext.METHOD.PUT) && context.getType() != RequestContext.TYPE.ROOT && context.getType() != RequestContext.TYPE.DB) {
        ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_FOUND,"String_Node_Str");
        return;
      }
    }
 else {
      collProps=LocalCachesSingleton.getInstance().getCollectionProps(context.getDBName(),context.getCollectionName());
    }
    if (collProps == null && !(context.getType() == RequestContext.TYPE.COLLECTION && context.getMethod() == RequestContext.METHOD.PUT) && context.getType() != RequestContext.TYPE.ROOT && context.getType() != RequestContext.TYPE.DB) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_FOUND,"String_Node_Str");
      return;
    }
    context.setCollectionProps(collProps);
  }
  next.handleRequest(exchange,context);
}
Program: 93573
Project: 93573
Buggy source:
@Override public Optional<DBObject> load(String key) throws Exception {
  String[] dbNameAndCollectionName=key.split(SEPARATOR);
  return Optional.ofNullable(CollectionDAO.getCollectionProps(dbNameAndCollectionName[0],dbNameAndCollectionName[1]));
}

Fixed version (ground truth):
@Override public Optional<DBObject> load(String key) throws Exception {
  String[] dbNameAndCollectionName=key.split(SEPARATOR);
  return Optional.ofNullable(collectionDAO.getCollectionProps(dbNameAndCollectionName[0],dbNameAndCollectionName[1]));
}
Program: 93574
Project: 93574
Buggy source:
private void setup(){
  if (!initialized) {
    throw new IllegalStateException("String_Node_Str");
  }
  CacheBuilder builder=CacheBuilder.newBuilder();
  builder.maximumSize(maxCacheSize);
  if (ttl > 0) {
    builder.expireAfterWrite(ttl,TimeUnit.MILLISECONDS);
  }
  if (enabled) {
    this.dbPropsCache=builder.build(new CacheLoader<String,Optional<DBObject>>(){
      @Override public Optional<DBObject> load(      String key) throws Exception {
        return Optional.ofNullable(DBDAO.getDbProps(key));
      }
    }
);
    this.collectionPropsCache=builder.build(new CacheLoader<String,Optional<DBObject>>(){
      @Override public Optional<DBObject> load(      String key) throws Exception {
        String[] dbNameAndCollectionName=key.split(SEPARATOR);
        return Optional.ofNullable(CollectionDAO.getCollectionProps(dbNameAndCollectionName[0],dbNameAndCollectionName[1]));
      }
    }
);
  }
}

Fixed version (ground truth):
private void setup(){
  if (!initialized) {
    throw new IllegalStateException("String_Node_Str");
  }
  CacheBuilder builder=CacheBuilder.newBuilder();
  builder.maximumSize(maxCacheSize);
  if (ttl > 0) {
    builder.expireAfterWrite(ttl,TimeUnit.MILLISECONDS);
  }
  if (enabled) {
    this.dbPropsCache=builder.build(new CacheLoader<String,Optional<DBObject>>(){
      @Override public Optional<DBObject> load(      String key) throws Exception {
        return Optional.ofNullable(DBDAO.getDbProps(key));
      }
    }
);
    this.collectionPropsCache=builder.build(new CacheLoader<String,Optional<DBObject>>(){
      final CollectionDAO collectionDAO=new CollectionDAO();
      @Override public Optional<DBObject> load(      String key) throws Exception {
        String[] dbNameAndCollectionName=key.split(SEPARATOR);
        return Optional.ofNullable(collectionDAO.getCollectionProps(dbNameAndCollectionName[0],dbNameAndCollectionName[1]));
      }
    }
);
  }
}
Program: 93575
Project: 93575
Buggy source:
private void createTestData(){
  DBDAO.upsertDB(dbName,dbProps,new ObjectId(),false);
  CollectionDAO.upsertCollection(dbName,collection1Name,coll1Props,new ObjectId(),false,false);
  CollectionDAO.upsertCollection(dbName,collection2Name,coll2Props,new ObjectId(),false,false);
  CollectionDAO.upsertCollection(dbName,docsCollectionName,docsCollectionProps,new ObjectId(),false,false);
  for (  String index : docsCollectionIndexesStrings) {
    IndexDAO.createIndex(dbName,docsCollectionName,((DBObject)JSON.parse(index)),null);
  }
  final DocumentDAO documentDAO=new DocumentDAO();
  documentDAO.put(new PutDocumentEntity(dbName,collection1Name,document1Id,document1Props,new ObjectId(),false));
  documentDAO.put(new PutDocumentEntity(dbName,collection2Name,document2Id,document2Props,new ObjectId(),false));
  for (  String doc : docsPropsStrings) {
    documentDAO.put(new PutDocumentEntity(dbName,docsCollectionName,new ObjectId().toString(),((DBObject)JSON.parse(doc)),new ObjectId(),false));
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
private void createTestData(){
  DBDAO.upsertDB(dbName,dbProps,new ObjectId(),false);
  final CollectionDAO collectionDAO=new CollectionDAO();
  collectionDAO.upsertCollection(dbName,collection1Name,coll1Props,new ObjectId(),false,false);
  collectionDAO.upsertCollection(dbName,collection2Name,coll2Props,new ObjectId(),false,false);
  collectionDAO.upsertCollection(dbName,docsCollectionName,docsCollectionProps,new ObjectId(),false,false);
  for (  String index : docsCollectionIndexesStrings) {
    IndexDAO.createIndex(dbName,docsCollectionName,((DBObject)JSON.parse(index)),null);
  }
  final DocumentDAO documentDAO=new DocumentDAO();
  documentDAO.put(new PutDocumentEntity(dbName,collection1Name,document1Id,document1Props,new ObjectId(),false));
  documentDAO.put(new PutDocumentEntity(dbName,collection2Name,document2Id,document2Props,new ObjectId(),false));
  for (  String doc : docsPropsStrings) {
    documentDAO.put(new PutDocumentEntity(dbName,docsCollectionName,new ObjectId().toString(),((DBObject)JSON.parse(doc)),new ObjectId(),false));
  }
  LOG.info("String_Node_Str");
}
Program: 93576
Project: 93576
Buggy source:
/** 
 */
public void dbdirect(){
  DBCollection dbcoll=CollectionDAO.getCollection(db,coll);
  Deque<String> _filter;
  if (filter == null) {
    _filter=null;
  }
 else {
    _filter=new ArrayDeque<>();
    _filter.add(filter);
  }
  ArrayList<DBObject> data;
  try {
    data=CollectionDAO.getCollectionData(dbcoll,page,pagesize,null,_filter,DBCursorPool.EAGER_CURSOR_ALLOCATION_POLICY.NONE);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e.getMessage());
    return;
  }
  assertNotNull(data);
  assertFalse(data.isEmpty());
  if (printData) {
    System.out.println(data);
  }
}

Fixed version (ground truth):
/** 
 */
public void dbdirect(){
  final CollectionDAO collectionDAO=new CollectionDAO();
  DBCollection dbcoll=collectionDAO.getCollection(db,coll);
  Deque<String> _filter;
  if (filter == null) {
    _filter=null;
  }
 else {
    _filter=new ArrayDeque<>();
    _filter.add(filter);
  }
  ArrayList<DBObject> data;
  try {
    data=collectionDAO.getCollectionData(dbcoll,page,pagesize,null,_filter,DBCursorPool.EAGER_CURSOR_ALLOCATION_POLICY.NONE);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e.getMessage());
    return;
  }
  assertNotNull(data);
  assertFalse(data.isEmpty());
  if (printData) {
    System.out.println(data);
  }
}
Program: 93577
Project: 93577
Buggy source:
/** 
 * given a mapped uri (/some/mapping/coll) returns the canonical uri (/db/coll) URLs are mapped to mongodb resources by using the mongo-mounts configuration properties
 * @param mappedUri
 * @return
 */
public final String unmapUri(String mappedUri){
  String ret=URLUtilis.removeTrailingSlashes(mappedUri);
  if (this.whatUri.equals("String_Node_Str") && !this.whereUri.equals(SLASH)) {
    ret=ret.replaceFirst("String_Node_Str" + this.whereUri,"String_Node_Str");
  }
 else {
    ret=URLUtilis.removeTrailingSlashes(ret.replaceFirst("String_Node_Str" + this.whereUri,this.whatUri));
  }
  if (ret.isEmpty()) {
    ret=SLASH;
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * given a mapped uri (/some/mapping/coll) returns the canonical uri (/db/coll) URLs are mapped to mongodb resources by using the mongo-mounts configuration properties
 * @param mappedUri
 * @return
 */
public final String unmapUri(String mappedUri){
  String ret=URLUtilis.removeTrailingSlashes(mappedUri);
  if (whatUri.equals("String_Node_Str")) {
    if (!this.whereUri.equals(SLASH)) {
      ret=ret.replaceFirst("String_Node_Str" + this.whereUri,"String_Node_Str");
    }
  }
 else {
    ret=URLUtilis.removeTrailingSlashes(ret.replaceFirst("String_Node_Str" + this.whereUri,this.whatUri));
  }
  if (ret.isEmpty()) {
    ret=SLASH;
  }
  return ret;
}
Program: 93578
Project: 93578
Buggy source:
/** 
 * given a canonical uri (/db/coll) returns the mapped uri (/db/coll) relative to this context URLs are mapped to mongodb resources by using the mongo-mounts configuration properties
 * @param unmappedUri
 * @return
 */
public final String mapUri(String unmappedUri){
  String ret=URLUtilis.removeTrailingSlashes(unmappedUri);
  if (this.whatUri.equals("String_Node_Str") && !this.whereUri.equals(SLASH)) {
    ret=this.whereUri + unmappedUri;
  }
 else {
    ret=URLUtilis.removeTrailingSlashes(ret.replaceFirst("String_Node_Str" + this.whatUri,this.whereUri));
  }
  if (ret.isEmpty()) {
    ret=SLASH;
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * given a canonical uri (/db/coll) returns the mapped uri (/db/coll) relative to this context URLs are mapped to mongodb resources by using the mongo-mounts configuration properties
 * @param unmappedUri
 * @return
 */
public final String mapUri(String unmappedUri){
  String ret=URLUtilis.removeTrailingSlashes(unmappedUri);
  if (whatUri.equals("String_Node_Str")) {
    if (!this.whereUri.equals(SLASH)) {
      return this.whereUri + unmappedUri;
    }
  }
 else {
    ret=URLUtilis.removeTrailingSlashes(ret.replaceFirst("String_Node_Str" + this.whatUri,this.whereUri));
  }
  if (ret.isEmpty()) {
    ret=SLASH;
  }
  return ret;
}
Program: 93579
Project: 93579
Buggy source:
/** 
 * Returs the DBCursor of the collection applying sorting and filtering.
 * @param coll the mongodb DBCollection object
 * @param sortBy the Deque collection of fields to use for sorting (prependfield name with - for descending sorting)
 * @param filters the filters to apply. it is a Deque collection of mongodbquery conditions.
 * @return
 * @throws JSONParseException
 */
protected static DBCursor getCollectionDBCursor(DBCollection coll,Deque<String> sortBy,Deque<String> filters) throws JSONParseException {
  DBObject sort=new BasicDBObject();
  if (sortBy == null || sortBy.isEmpty()) {
    sort.put("String_Node_Str",-1);
  }
 else {
    sortBy.stream().forEach((s) -> {
      String _s=s.trim();
      _s=_s.replaceAll("String_Node_Str","String_Node_Str");
      if (_s.startsWith("String_Node_Str")) {
        sort.put(_s.substring(1),-1);
      }
 else       if (_s.startsWith("String_Node_Str")) {
        sort.put(_s.substring(1),1);
      }
 else {
        sort.put(_s,1);
      }
    }
);
  }
  final BasicDBObject query=new BasicDBObject(DOCUMENTS_QUERY);
  if (filters != null) {
    filters.stream().forEach((    String f) -> {
      BSONObject filterQuery=(BSONObject)JSON.parse(f);
      replaceObjectIds(filterQuery);
      query.putAll(filterQuery);
    }
);
  }
  return coll.find(query).sort(sort);
}

Fixed version (ground truth):
/** 
 * Returs the DBCursor of the collection applying sorting and filtering.
 * @param coll the mongodb DBCollection object
 * @param sortBy the Deque collection of fields to use for sorting (prependfield name with - for descending sorting)
 * @param filters the filters to apply. it is a Deque collection of mongodbquery conditions.
 * @return
 * @throws JSONParseException
 */
protected static DBCursor getCollectionDBCursor(DBCollection coll,Deque<String> sortBy,Deque<String> filters) throws JSONParseException {
  DBObject sort=new BasicDBObject();
  if (sortBy == null || sortBy.isEmpty()) {
    sort.put("String_Node_Str",-1);
  }
 else {
    sortBy.stream().forEach((s) -> {
      String _s=s.trim();
      _s=_s.replaceAll("String_Node_Str","String_Node_Str");
      if (_s.startsWith("String_Node_Str")) {
        sort.put(_s.substring(1),-1);
      }
 else       if (_s.startsWith("String_Node_Str")) {
        sort.put(_s.substring(1),1);
      }
 else {
        sort.put(_s,1);
      }
    }
);
  }
  final BasicDBObject query=new BasicDBObject(DOCUMENTS_QUERY);
  if (filters != null) {
    filters.stream().forEach((    String f) -> {
      BSONObject filterQuery=(BSONObject)JSON.parse(f);
      HALUtils.replaceStringsWithObjectIds(filterQuery);
      query.putAll(filterQuery);
    }
);
  }
  return coll.find(query).sort(sort);
}
Program: 93581
Project: 93581
Buggy source:
/** 
 * @param props
 */
public void addProperties(DBObject props){
  if (props == null) {
    return;
  }
  properties.putAll(props);
}

Fixed version (ground truth):
/** 
 * @param props
 */
public void addProperties(DBObject props){
  if (props == null) {
    return;
  }
  HALUtils.replaceObjectIdsWithStrings(props);
  properties.putAll(props);
}
Program: 93582
Project: 93582
Buggy source:
/** 
 * @param key
 * @param value
 */
public void addProperty(String key,Object value){
  properties.append(key,value);
}

Fixed version (ground truth):
/** 
 * @param key
 * @param value
 */
public void addProperty(String key,Object value){
  if (value instanceof ObjectId) {
    properties.append(key,value.toString());
  }
 else   if (value instanceof BSONObject) {
    HALUtils.replaceObjectIdsWithStrings((BSONObject)value);
    properties.append(key,value);
  }
 else {
    properties.append(key,value);
  }
}
Program: 93585
Project: 93585
Buggy source:
/** 
 * @param href
 * @param exchange
 * @param context
 * @param data
 * @return
 * @throws IllegalQueryParamenterException
 */
public static Representation getDocument(String href,HttpServerExchange exchange,RequestContext context,DBObject data) throws IllegalQueryParamenterException {
  Representation rep=new Representation(href);
  rep.addProperty("String_Node_Str",context.getType().name());
  data.keySet().stream().forEach((key) -> {
    Object value=data.get(key);
    if (value instanceof ObjectId) {
      value=value.toString();
    }
    rep.addProperty(key,value);
  }
);
  TreeMap<String,String> links;
  links=getRelationshipsLinks(context,data);
  if (links != null) {
    links.keySet().stream().forEach((k) -> {
      rep.addLink(new Link(k,links.get(k)));
    }
);
  }
  String requestPath=URLUtilis.removeTrailingSlashes(exchange.getRequestPath());
  if (context.isParentAccessible()) {
    rep.addLink(new Link("String_Node_Str",URLUtilis.getPerentPath(requestPath)));
  }
  rep.addLink(new Link("String_Node_Str","String_Node_Str",Configuration.RESTHEART_ONLINE_DOC_URL + "String_Node_Str",false),true);
  ResponseHelper.injectWarnings(rep,exchange,context);
  return rep;
}

Fixed version (ground truth):
/** 
 * @param href
 * @param exchange
 * @param context
 * @param data
 * @return
 * @throws IllegalQueryParamenterException
 */
public static Representation getDocument(String href,HttpServerExchange exchange,RequestContext context,DBObject data) throws IllegalQueryParamenterException {
  Representation rep=new Representation(href);
  rep.addProperty("String_Node_Str",context.getType().name());
  data.keySet().stream().forEach((key) -> rep.addProperty(key,data.get(key)));
  TreeMap<String,String> links;
  links=getRelationshipsLinks(context,data);
  if (links != null) {
    links.keySet().stream().forEach((k) -> {
      rep.addLink(new Link(k,links.get(k)));
    }
);
  }
  String requestPath=URLUtilis.removeTrailingSlashes(exchange.getRequestPath());
  if (context.isParentAccessible()) {
    rep.addLink(new Link("String_Node_Str",URLUtilis.getPerentPath(requestPath)));
  }
  rep.addLink(new Link("String_Node_Str","String_Node_Str",Configuration.RESTHEART_ONLINE_DOC_URL + "String_Node_Str",false),true);
  ResponseHelper.injectWarnings(rep,exchange,context);
  return rep;
}
Program: 93586
Project: 93586
Buggy source:
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  DBObject content=context.getContent();
  if (content == null) {
    content=new BasicDBObject();
  }
  if (content instanceof BasicDBList) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  String id=context.getDocumentId();
  if (content.get("String_Node_Str") == null) {
    content.put("String_Node_Str",getId(id));
  }
 else   if (!content.get("String_Node_Str").equals(id)) {
    ResponseHelper.endExchange(exchange,HttpStatus.SC_NOT_ACCEPTABLE);
    logger.warn("String_Node_Str");
    return;
  }
  ObjectId etag=RequestHelper.getWriteEtag(exchange);
  int SC=DocumentDAO.upsertDocument(context.getDBName(),context.getCollectionName(),context.getDocumentId(),content,etag,false);
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    sendWarnings(SC,exchange,context);
  }
 else {
    exchange.setResponseCode(SC);
  }
  exchange.endExchange();
}

Fixed version (ground truth):
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  DBObject content=context.getContent();
  if (content == null) {
    content=new BasicDBObject();
  }
  if (content instanceof BasicDBList) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  String id=context.getDocumentId();
  if (content.get("String_Node_Str") == null) {
    content.put("String_Node_Str",getId(id));
  }
 else   if (!content.get("String_Node_Str").equals(id)) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  ObjectId etag=RequestHelper.getWriteEtag(exchange);
  int SC=DocumentDAO.upsertDocument(context.getDBName(),context.getCollectionName(),context.getDocumentId(),content,etag,false);
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    sendWarnings(SC,exchange,context);
  }
 else {
    exchange.setResponseCode(SC);
  }
  exchange.endExchange();
}
Program: 93588
Project: 93588
Buggy source:
/** 
 */
public void dbdirect(){
  DBCollection dbcoll=CollectionDAO.getCollection(db,coll);
  Deque<String> _filter;
  if (filter == null) {
    _filter=null;
  }
 else {
    _filter=new ArrayDeque<>();
    _filter.add(filter);
  }
  ArrayList<DBObject> data;
  try {
    data=CollectionDAO.getCollectionData(dbcoll,page,100,null,_filter,DBCursorPool.EAGER_CURSOR_ALLOCATION_POLICY.NONE);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e.getMessage());
    return;
  }
  assertNotNull(data);
  assertFalse(data.isEmpty());
  if (printData) {
    System.out.println(data);
  }
}

Fixed version (ground truth):
/** 
 */
public void dbdirect(){
  DBCollection dbcoll=CollectionDAO.getCollection(db,coll);
  Deque<String> _filter;
  if (filter == null) {
    _filter=null;
  }
 else {
    _filter=new ArrayDeque<>();
    _filter.add(filter);
  }
  ArrayList<DBObject> data;
  try {
    data=CollectionDAO.getCollectionData(dbcoll,page,pagesize,null,_filter,DBCursorPool.EAGER_CURSOR_ALLOCATION_POLICY.NONE);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + e.getMessage());
    return;
  }
  assertNotNull(data);
  assertFalse(data.isEmpty());
  if (printData) {
    System.out.println(data);
  }
}
Program: 93589
Project: 93589
Buggy source:
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  ObjectId oid;
  String sid;
  if (ObjectId.isValid(context.getDocumentId())) {
    sid=null;
    oid=new ObjectId(context.getDocumentId());
  }
 else {
    sid=context.getDocumentId();
    oid=null;
  }
  BasicDBObject query;
  if (oid != null) {
    query=new BasicDBObject("String_Node_Str",oid);
  }
 else {
    query=new BasicDBObject("String_Node_Str",sid);
  }
  DBObject document=CollectionDAO.getCollection(context.getDBName(),context.getCollectionName()).findOne(query);
  if (document == null) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_FOUND,"String_Node_Str");
    return;
  }
  Object etag=document.get("String_Node_Str");
  if (etag != null && ObjectId.isValid("String_Node_Str" + etag)) {
    ObjectId _etag=new ObjectId("String_Node_Str" + etag);
    document.put("String_Node_Str",Instant.ofEpochSecond(_etag.getTimestamp()).toString());
    if (false && RequestHelper.checkReadEtag(exchange,etag.toString())) {
      ResponseHelper.endExchange(exchange,HttpStatus.SC_NOT_MODIFIED);
      return;
    }
  }
  String requestPath=URLUtilis.removeTrailingSlashes(exchange.getRequestPath());
  ResponseHelper.injectEtagHeader(exchange,document);
  exchange.setResponseCode(HttpStatus.SC_OK);
  DocumentRepresentationFactory.sendDocument(requestPath,exchange,context,document);
  exchange.endExchange();
}

Fixed version (ground truth):
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  ObjectId oid;
  String sid;
  if (ObjectId.isValid(context.getDocumentId())) {
    sid=null;
    oid=new ObjectId(context.getDocumentId());
  }
 else {
    sid=context.getDocumentId();
    oid=null;
  }
  BasicDBObject query;
  if (oid != null) {
    query=new BasicDBObject("String_Node_Str",oid);
  }
 else {
    query=new BasicDBObject("String_Node_Str",sid);
  }
  DBObject document=CollectionDAO.getCollection(context.getDBName(),context.getCollectionName()).findOne(query);
  if (document == null) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_FOUND,"String_Node_Str");
    return;
  }
  Object etag=document.get("String_Node_Str");
  if (etag != null && ObjectId.isValid("String_Node_Str" + etag)) {
    ObjectId _etag=new ObjectId("String_Node_Str" + etag);
    document.put("String_Node_Str",Instant.ofEpochSecond(_etag.getTimestamp()).toString());
    if (RequestHelper.checkReadEtag(exchange,etag.toString())) {
      ResponseHelper.endExchange(exchange,HttpStatus.SC_NOT_MODIFIED);
      return;
    }
  }
  String requestPath=URLUtilis.removeTrailingSlashes(exchange.getRequestPath());
  ResponseHelper.injectEtagHeader(exchange,document);
  exchange.setResponseCode(HttpStatus.SC_OK);
  DocumentRepresentationFactory.sendDocument(requestPath,exchange,context,document);
  exchange.endExchange();
}
Program: 93590
Project: 93590
Buggy source:
/** 
 * Returns the number of documents in the given collection (taking into account the filters in case).
 * @param coll the mongodb DBCollection object.
 * @param filters the filters to apply. it is a Deque collection of mongodbquery conditions.
 * @return the number of documents in the given collection (taking intoaccount the filters in case)
 */
public static long getCollectionSize(DBCollection coll,Deque<String> filters){
  final BasicDBObject query=DOCUMENTS_QUERY;
  if (filters != null) {
    try {
      filters.stream().forEach(f -> {
        query.putAll((BSONObject)JSON.parse(f));
      }
);
    }
 catch (    JSONParseException jpe) {
      logger.warn("String_Node_Str",filters,jpe);
    }
  }
  return coll.count(query);
}

Fixed version (ground truth):
/** 
 * Returns the number of documents in the given collection (taking into account the filters in case).
 * @param coll the mongodb DBCollection object.
 * @param filters the filters to apply. it is a Deque collection of mongodbquery conditions.
 * @return the number of documents in the given collection (taking intoaccount the filters in case)
 */
public static long getCollectionSize(DBCollection coll,Deque<String> filters){
  final BasicDBObject query=new BasicDBObject(DOCUMENTS_QUERY);
  if (filters != null) {
    try {
      filters.stream().forEach(f -> {
        query.putAll((BSONObject)JSON.parse(f));
      }
);
    }
 catch (    JSONParseException jpe) {
      logger.warn("String_Node_Str",filters,jpe);
    }
  }
  return coll.count(query);
}
Program: 93591
Project: 93591
Buggy source:
private static void createTestData(){
  DBDAO.upsertDB(dbName,dbProps,new ObjectId(),false);
  CollectionDAO.upsertCollection(dbName,collection1Name,coll1Props,new ObjectId(),false,false);
  CollectionDAO.upsertCollection(dbName,collection2Name,coll2Props,new ObjectId(),false,false);
  CollectionDAO.upsertCollection(dbName,docsCollectionName,docsCollectionProps,new ObjectId(),false,false);
  for (  String index : docsCollectionIndexesStrings) {
    IndexDAO.createIndex(dbName,docsCollectionName,((DBObject)JSON.parse(index)),null);
  }
  DocumentDAO.upsertDocument(dbName,collection1Name,document1Id,document1Props,new ObjectId(),false);
  DocumentDAO.upsertDocument(dbName,collection2Name,document2Id,document2Props,new ObjectId(),false);
  for (  String doc : docsPropsStrings) {
    DocumentDAO.upsertDocument(dbName,docsCollectionName,new ObjectId().toString(),((DBObject)JSON.parse(doc)),new ObjectId(),false);
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
private void createTestData(){
  DBDAO.upsertDB(dbName,dbProps,new ObjectId(),false);
  CollectionDAO.upsertCollection(dbName,collection1Name,coll1Props,new ObjectId(),false,false);
  CollectionDAO.upsertCollection(dbName,collection2Name,coll2Props,new ObjectId(),false,false);
  CollectionDAO.upsertCollection(dbName,docsCollectionName,docsCollectionProps,new ObjectId(),false,false);
  for (  String index : docsCollectionIndexesStrings) {
    IndexDAO.createIndex(dbName,docsCollectionName,((DBObject)JSON.parse(index)),null);
  }
  DocumentDAO.upsertDocument(dbName,collection1Name,document1Id,document1Props,new ObjectId(),false);
  DocumentDAO.upsertDocument(dbName,collection2Name,document2Id,document2Props,new ObjectId(),false);
  for (  String doc : docsPropsStrings) {
    DocumentDAO.upsertDocument(dbName,docsCollectionName,new ObjectId().toString(),((DBObject)JSON.parse(doc)),new ObjectId(),false);
  }
  LOG.info("String_Node_Str");
}
Program: 93592
Project: 93592
Buggy source:
@Before public void setUp(){
  initializeTestData();
}

Fixed version (ground truth):
@Before public void setUp(){
  createTestData();
}
Program: 93593
Project: 93593
Buggy source:
@After public void tearDown(){
}

Fixed version (ground truth):
@After public void tearDown(){
  deleteTestData();
}
Program: 93600
Project: 93600
Buggy source:
public static DBObject getCollectionProps(String dbName,String collName){
  DBCollection coll=CollectionDAO.getCollection(dbName,collName);
  DBObject properties=coll.findOne(PROPS_QUERY);
  if (properties != null) {
    properties.removeField("String_Node_Str");
    Object etag=properties.get("String_Node_Str");
    if (etag != null && ObjectId.isValid("String_Node_Str" + etag)) {
      ObjectId oid=new ObjectId("String_Node_Str" + etag);
      properties.put("String_Node_Str",Instant.ofEpochSecond(oid.getTimestamp()).toString());
    }
  }
  return properties;
}

Fixed version (ground truth):
public static DBObject getCollectionProps(String dbName,String collName){
  DBCollection coll=CollectionDAO.getCollection(dbName,collName);
  DBObject properties=coll.findOne(PROPS_QUERY);
  if (properties != null) {
    properties.put("String_Node_Str",collName);
    Object etag=properties.get("String_Node_Str");
    if (etag != null && ObjectId.isValid("String_Node_Str" + etag)) {
      ObjectId oid=new ObjectId("String_Node_Str" + etag);
      properties.put("String_Node_Str",Instant.ofEpochSecond(oid.getTimestamp()).toString());
    }
  }
  return properties;
}
Program: 93601
Project: 93601
Buggy source:
/** 
 * @param dbName
 * @return the db props
 */
public static DBObject getDbProps(String dbName){
  if (!DBDAO.doesDbExists(dbName))   return null;
  DBCollection propscoll=CollectionDAO.getCollection(dbName,"String_Node_Str");
  DBObject row=propscoll.findOne(METADATA_QUERY);
  if (row != null) {
    row.removeField("String_Node_Str");
    Object etag=row.get("String_Node_Str");
    if (etag != null && ObjectId.isValid("String_Node_Str" + etag)) {
      ObjectId oid=new ObjectId("String_Node_Str" + etag);
      row.put("String_Node_Str",Instant.ofEpochSecond(oid.getTimestamp()).toString());
    }
  }
  return row;
}

Fixed version (ground truth):
/** 
 * @param dbName
 * @return the db props
 */
public static DBObject getDbProps(String dbName){
  if (!DBDAO.doesDbExists(dbName))   return null;
  DBCollection propscoll=CollectionDAO.getCollection(dbName,"String_Node_Str");
  DBObject row=propscoll.findOne(METADATA_QUERY);
  if (row != null) {
    row.put("String_Node_Str",dbName);
    Object etag=row.get("String_Node_Str");
    if (etag != null && ObjectId.isValid("String_Node_Str" + etag)) {
      ObjectId oid=new ObjectId("String_Node_Str" + etag);
      row.put("String_Node_Str",Instant.ofEpochSecond(oid.getTimestamp()).toString());
    }
  }
  return row;
}