Program: 13327
Project: 13327
Buggy source:
/** 
 * Creates a new object in the object set. <p> This method sets the   {@code _id} property to the assigned identifier for the object,and the  {@code _rev} property to the revised object version (For optimistic concurrency)
 * @param id the client-generated identifier to use, or {@code null} if server-generated identifier is requested.
 * @param object the contents of the object to create in the object set.
 * @throws NotFoundException if the specified id could not be resolved. 
 * @throws ForbiddenException if access to the object or object set is forbidden.
 * @throws PreconditionFailedException if an object with the same ID already exists.
 */
@Override public void create(String fullId,Map<String,Object> obj) throws ObjectSetException {
  String localId=getLocalId(fullId);
  String type=getObjectType(fullId);
  String orientClassName=typeToOrientClassName(type);
  if (fullId == null || localId == null) {
    throw new NotFoundException("String_Node_Str" + fullId + "String_Node_Str"+ localId);
  }
 else   if (type == null) {
    throw new NotFoundException("String_Node_Str" + fullId);
  }
  obj.put(DocumentUtil.TAG_ID,localId);
  ODatabaseDocumentTx db=pool.acquire(dbURL,user,password);
  try {
    ODocument newDoc=DocumentUtil.toDocument(obj,null,db,orientClassName);
    logger.trace("String_Node_Str",fullId,newDoc);
    newDoc.save();
    newDoc.reload();
    obj.put(DocumentUtil.TAG_REV,Integer.toString(newDoc.getVersion()));
    logger.debug("String_Node_Str",fullId,newDoc);
  }
 catch (  OIndexException ex) {
    throw new PreconditionFailedException("String_Node_Str" + ex.getMessage(),ex);
  }
catch (  com.orientechnologies.orient.core.exception.ODatabaseException ex) {
    if (isCauseIndexException(ex,10)) {
      throw new PreconditionFailedException("String_Node_Str" + ex.getMessage(),ex);
    }
 else {
      throw ex;
    }
  }
catch (  RuntimeException e) {
    throw e;
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates a new object in the object set. <p> This method sets the   {@code _id} property to the assigned identifier for the object,and the  {@code _rev} property to the revised object version (For optimistic concurrency)
 * @param id the client-generated identifier to use, or {@code null} if server-generated identifier is requested.
 * @param object the contents of the object to create in the object set.
 * @throws NotFoundException if the specified id could not be resolved. 
 * @throws ForbiddenException if access to the object or object set is forbidden.
 * @throws PreconditionFailedException if an object with the same ID already exists.
 */
@Override public void create(String fullId,Map<String,Object> obj) throws ObjectSetException {
  String localId=getLocalId(fullId);
  String type=getObjectType(fullId);
  String orientClassName=typeToOrientClassName(type);
  if (fullId == null || localId == null) {
    throw new NotFoundException("String_Node_Str" + fullId + "String_Node_Str"+ localId);
  }
 else   if (type == null) {
    throw new NotFoundException("String_Node_Str" + fullId);
  }
  obj.put(DocumentUtil.TAG_ID,localId);
  ODatabaseDocumentTx db=pool.acquire(dbURL,user,password);
  try {
    ODocument newDoc=DocumentUtil.toDocument(obj,null,db,orientClassName);
    logger.trace("String_Node_Str",fullId,newDoc);
    newDoc.save();
    obj.put(DocumentUtil.TAG_REV,Integer.toString(newDoc.getVersion()));
    logger.debug("String_Node_Str",fullId,newDoc);
  }
 catch (  OIndexException ex) {
    throw new PreconditionFailedException("String_Node_Str" + ex.getMessage(),ex);
  }
catch (  com.orientechnologies.orient.core.exception.ODatabaseException ex) {
    if (isCauseIndexException(ex,10)) {
      throw new PreconditionFailedException("String_Node_Str" + ex.getMessage(),ex);
    }
 else {
      throw ex;
    }
  }
catch (  RuntimeException e) {
    throw e;
  }
 finally {
    if (db != null) {
      db.close();
    }
  }
}