Buggy code:
public class RequestDAO extends OrientdbDAO { private static final Logger logger = Logger . getLogger ( RequestDAO . class . getName ( ) ) ; private OrientGraph graph ; public RequestDAO ( ODatabaseDocumentTx dbConnection ) { } public Request createRequest ( Request newRequest , User account ) throws IllegalArgumentException , DuplicateObjectException , NdexException { Preconditions . checkArgument ( ( null != newRequest ) , "A<seq2seq4repair_space>Request<seq2seq4repair_space>parameter<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; Preconditions . checkArgument ( ( ( ( newRequest . getSourceUUID ( ) ) != null ) && ( ! ( Strings . isNullOrEmpty ( newRequest . getSourceUUID ( ) . toString ( ) ) ) ) ) , "A<seq2seq4repair_space>source<seq2seq4repair_space>UUID<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; Preconditions . checkArgument ( ( ! ( Strings . isNullOrEmpty ( newRequest . getSourceName ( ) ) ) ) , "A<seq2seq4repair_space>source<seq2seq4repair_space>name<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; Preconditions . checkArgument ( ( ( ( newRequest . getDestinationUUID ( ) ) != null ) && ( ! ( Strings . isNullOrEmpty ( newRequest . getDestinationUUID ( ) . toString ( ) ) ) ) ) , "A<seq2seq4repair_space>destination<seq2seq4repair_space>UUID<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; Preconditions . checkArgument ( ( ! ( Strings . isNullOrEmpty ( newRequest . getDestinationName ( ) ) ) ) , "A<seq2seq4repair_space>destination<seq2seq4repair_space>name<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; Preconditions . checkArgument ( ( ( newRequest . getPermission ( ) ) != null ) , "A<seq2seq4repair_space>permission<seq2seq4repair_space>is<seq2seq4repair_space>required" ) ; Preconditions . checkArgument ( ( account != null ) , "Must<seq2seq4repair_space>be<seq2seq4repair_space>logged<seq2seq4repair_space>in<seq2seq4repair_space>to<seq2seq4repair_space>make<seq2seq4repair_space>a<seq2seq4repair_space>request" ) ; <START_BUG> ODocument sourceAccount = this . getRecordByUUID ( newRequest . getSourceUUID ( ) , Account ) ; <END_BUG> ODocument userAccount = this . getRecordByUUID ( account . getExternalId ( ) , NdexClasses . User ) ; ODocument destinationResource ; if ( ( newRequest . getPermission ( ) . equals ( GROUPADMIN ) ) || ( newRequest . getPermission ( ) . equals ( MEMBER ) ) ) { destinationResource = this . getRecordByUUID ( newRequest . getDestinationUUID ( ) , Group ) ; if ( sourceAccount . getClassName ( ) . equals ( Group ) ) throw new IllegalArgumentException ( "Group<seq2seq4repair_space>cannot<seq2seq4repair_space>request<seq2seq4repair_space>access<seq2seq4repair_space>to<seq2seq4repair_space>group" ) ; } else destinationResource = this . getRecordByUUID ( newRequest . getDestinationUUID ( ) , Network ) ; if ( sourceAccount . getClassName ( ) . equals ( Group ) ) if ( ! ( checkPermission ( userAccount . getIdentity ( ) , sourceAccount . getIdentity ( ) , OUT , 1 , GROUPADMIN ) ) ) throw new IllegalArgumentException ( "Not<seq2seq4repair_space>admin<seq2seq4repair_space>of<seq2seq4repair_space>specified<seq2seq4repair_space>group" ) ; this . checkForExistingRequest ( userAccount , sourceAccount , destinationResource , newRequest . getPermission ( ) ) ; newRequest . setExternalId ( UUID . randomUUID ( ) ) ; try { ODocument request = new ODocument ( NdexClasses . Request ) ; request . fields ( "sourceUUID" , newRequest . getSourceUUID ( ) . toString ( ) , "sourceName" , newRequest . getSourceName ( ) , "destinationUUID" , newRequest . getDestinationUUID ( ) . toString ( ) , "destinationName" , newRequest . getDestinationName ( ) , "message" , newRequest . getMessage ( ) , "requestPermission" , newRequest . getPermission ( ) . name ( ) , "response" , PENDING , ExternalObj_cTime , newRequest . getCreationTime ( ) , ExternalObj_ID , newRequest . getExternalId ( ) . toString ( ) , ExternalObj_mTime , newRequest . getModificationTime ( ) , ExternalObj_isDeleted , false ) ; request = request . save ( ) ; OrientVertex vRequest = this . graph . getVertex ( request ) ; OrientVertex vUser = this . graph . getVertex ( userAccount ) ; OrientVertex vResource = this . graph . getVertex ( destinationResource ) ; this . graph . addEdge ( null , vUser , vRequest , Request_E_requests ) ; vUser . getRecord ( ) . reload ( ) ; vRequest . getRecord ( ) . reload ( ) ; for ( Vertex v : vResource . getVertices ( IN , GROUPADMIN . name ( ) . toLowerCase ( ) , ADMIN . name ( ) . toLowerCase ( ) ) ) { if ( ( ( OrientVertex ) ( v ) ) . getRecord ( ) . getClassName ( ) . equals ( NdexClasses . User ) ) { vRequest . getRecord ( ) . reload ( ) ; graph . addEdge ( null , vRequest , v , Request_E_requests ) ; } for ( Vertex vv : v . getVertices ( IN , GROUPADMIN . name ( ) . toLowerCase ( ) ) ) { vRequest . getRecord ( ) . reload ( ) ; graph . addEdge ( null , vRequest , vv , Request_E_requests ) ; } } RequestDAO . logger . info ( ( ( ( ( "Created<seq2seq4repair_space>request:" + "\n<seq2seq4repair_space>source<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( newRequest . getSourceUUID ( ) ) ) + "\n<seq2seq4repair_space>destination<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( newRequest . getDestinationUUID ( ) ) ) ) ; return newRequest ; } catch ( Exception e ) { RequestDAO . logger . severe ( ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>request:" + "\n<seq2seq4repair_space>source<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( newRequest . getSourceUUID ( ) ) ) + "\n<seq2seq4repair_space>destination<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( newRequest . getDestinationUUID ( ) ) ) ) ; throw new NdexException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>request" ) ; } } public void deleteRequest ( UUID requestId , User account ) throws IllegalArgumentException , ObjectNotFoundException , NdexException { } public Request getRequest ( UUID requestId , User account ) throws IllegalArgumentException , NdexException { } public void updateRequest ( UUID requestId , Request updatedRequest , User account ) throws IllegalArgumentException , NdexException { } @ Override public void commit ( ) { } @ Override public void close ( ) { } public static Request getRequestFromDocument ( ODocument request ) throws NdexException { } private void checkForExistingRequest ( ODocument user , ODocument source , ODocument destination , Permissions permission ) throws DuplicateObjectException , NdexException { } }

Fix:
ODocument sourceAccount = this . getRecordByUUID ( newRequest . getSourceUUID ( ) , null ) ;