Buggy code:
public static PropertyValidator getPropertyValidator ( final SecurityContext securityContext , Class type , String propertyKey ) { } public static Value getPropertyValidationParameter ( Class type , String propertyKey ) { } public static PropertyConverter getPropertyConverter ( final SecurityContext securityContext , Class type , String propertyKey ) { } public static Value getPropertyConversionParameter ( Class type , String propertyKey ) { } public static Set < String > getSearchableProperties ( Class type , String index ) { } public static Set < String > getSearchableProperties ( String type , String index ) { } private static Map < String , DirectedRelationship > getPropertyRelationshipMapForType ( String sourceType ) { } private static Map < String , DirectedRelationship > getEntityRelationshipMapForType ( String sourceType ) { } private static Map < String , Set < String > > getPropertyViewMapForType ( Class type ) { } private static Map < String , Class < ? extends PropertyValidator > > getPropertyValidatorMapForType ( Class type ) { } private static Map < String , Value > getPropertyValidatonParameterMapForType ( Class type ) { } private static Map < String , Class < ? extends PropertyConverter > > getPropertyConverterMapForType ( Class type ) { } private static Map < String , Value > getPropertyConversionParameterMapForType ( Class type ) { } private static Set < String > getReadOnlyPropertySetForType ( Class type ) { } private static Set < String > getWriteOncePropertySetForType ( Class type ) { } private static Map < String , Set < String > > getSearchablePropertyMapForType ( String sourceType ) { } private static Map < String , PropertyGroup > getPropertyGroupMapForType ( Class type ) { } private static Map < String , Semaphore > getSemaphoreMapForType ( String sourceType ) { } private static Set < Transformation < AbstractNode > > getPostCreationTransformationsForType ( Class type ) { } public static EntityContext . EntityContextModificationListener getTransactionEventHandler ( ) { } public static synchronized Throwable getThrowable ( Long transactionKey ) { } public static boolean isReadOnlyProperty ( Class type , String key ) { } public static boolean isSearchableProperty ( Class type , String index , PropertyKey key ) { } public static boolean isSearchableProperty ( Class type , String index , String key ) { } public static boolean isSearchableProperty ( String type , String index , String key ) { } public static boolean isWriteOnceProperty ( Class type , String key ) { } public static synchronized void setTransactionKey ( Long transactionKey ) { } public static class EntityContextModificationListener implements TransactionEventHandler < Long > , VetoableGraphObjectListener { @ Override public Long beforeCommit ( TransactionData data ) throws Exception { long transactionKey = EntityContext . transactionKeyMap . get ( Thread . currentThread ( ) ) ; try { Map < Node , Map < String , Object > > removedProperties = new LinkedHashMap < Node , Map < String , Object > > ( ) ; SecurityContext securityContext = SecurityContext . getSuperUserInstance ( ) ; StructrNodeFactory factory = new StructrNodeFactory ( securityContext ) ; Set < AbstractNode > modifiedNodes = new LinkedHashSet < AbstractNode > ( ) ; Set < AbstractNode > createdNodes = new LinkedHashSet < AbstractNode > ( ) ; Set < StructrRelationship > createdRels = new LinkedHashSet < StructrRelationship > ( ) ; Set < StructrRelationship > deletedRels = new LinkedHashSet < StructrRelationship > ( ) ; begin ( securityContext , transactionKey ) ; for ( PropertyEntry < Node > entry : data . removedNodeProperties ( ) ) { Node node = entry . entity ( ) ; Map < String , Object > propertyMap = removedProperties . get ( node ) ; if ( propertyMap == null ) { propertyMap = new LinkedHashMap < String , Object > ( ) ; removedProperties . put ( node , propertyMap ) ; } propertyMap . put ( entry . key ( ) , entry . previouslyCommitedValue ( ) ) ; } for ( Node node : data . createdNodes ( ) ) { AbstractNode entity = factory . createNode ( securityContext , node ) ; graphObjectCreated ( securityContext , transactionKey , entity ) ; createdNodes . add ( entity ) ; } for ( Relationship rel : data . createdRelationships ( ) ) { StructrRelationship relationship = new StructrRelationship ( securityContext , rel ) ; relationshipCreated ( securityContext , transactionKey , relationship ) ; <START_BUG> deletedRels . add ( relationship ) ; <END_BUG> } for ( Relationship rel : data . deletedRelationships ( ) ) { StructrRelationship relationship = new StructrRelationship ( securityContext , rel ) ; relationshipDeleted ( securityContext , transactionKey , relationship ) ; deletedRels . add ( relationship ) ; } for ( Node node : data . deletedNodes ( ) ) { graphObjectDeleted ( securityContext , transactionKey , node . getId ( ) , removedProperties . get ( node ) ) ; } for ( PropertyEntry < Node > entry : data . assignedNodeProperties ( ) ) { AbstractNode entity = factory . createNode ( securityContext , entry . entity ( ) ) ; propertyModified ( securityContext , transactionKey , entity , entry . key ( ) , entry . previouslyCommitedValue ( ) , entry . value ( ) ) ; modifiedNodes . add ( entity ) ; } for ( AbstractNode node : modifiedNodes ) { if ( ! ( createdNodes . contains ( node ) ) ) { graphObjectModified ( securityContext , transactionKey , node ) ; } } commit ( securityContext , transactionKey ) ; } catch ( Throwable t ) { EntityContext . throwableMap . put ( transactionKey , t ) ; throw new IllegalStateException ( "Rollback" ) ; } return transactionKey ; } @ Override public void afterCommit ( TransactionData data , Long transactionKey ) { } @ Override public void afterRollback ( TransactionData data , Long transactionKey ) { } @ Override public void begin ( SecurityContext securityContext , long transactionKey ) { } @ Override public void commit ( SecurityContext securityContext , long transactionKey ) { }

Fix:
createdRels . add ( relationship ) ;