Buggy code:
class ObjectInstance implements Lockable { private TaskImpl task ; private final LodDef lodDef ; private final long id ; private final UUID uuid ; private EntityInstanceImpl rootEntityInstance ; private boolean isLocked ; private boolean isReadOnly ; private final AtomicInteger versionedInstances ; private boolean updated = false ; private boolean updatedFile = false ; private ActivateOptions activateOptions ; boolean dbhNeedsForeignKeys ; boolean dbhNeedsGenKeys ; private final LazyLoadLock lock ; private boolean ignoreLazyLoadEntities = false ; private final AttributeHashKeyMap attributeHashkeyMap ; private final ConcurrentMap < ViewCursor , Boolean > referringViewCursors ; ObjectInstance ( TaskImpl task , LodDef lodDef ) { } LodDef getLodDef ( ) { } TaskImpl getTask ( ) { } long getId ( ) { } EntityInstanceImpl getRootEntityInstance ( ) { } void setRootEntityInstance ( EntityInstanceImpl rootEntityInstance ) { } boolean isUpdated ( ) { } void setUpdated ( boolean updated ) { } boolean isUpdatedFile ( ) { } void setUpdatedFile ( boolean updatedFile ) { } boolean isLocked ( ) { } void setLocked ( boolean isLocked ) { } boolean isReadOnly ( ) { } void setReadOnly ( boolean isReadOnly ) { } void incrementVersionedCount ( ) { } void decrementVersionedCount ( ) { } boolean isVersioned ( ) { } EntityInstanceImpl findByHierIndex ( long index ) { } Iterable < EntityInstanceImpl > getEntities ( ) { } Iterable < EntityInstanceImpl > getEntities ( final boolean allowHidden ) { } @ Override public String toString ( ) { } @ Override public ReentrantReadWriteLock getLock ( ) { } boolean validateChains ( ) { EntityInstanceImpl root = getRootEntityInstance ( ) ; if ( root == null ) return true ; root = root . getLatestVersion ( ) ; for ( EntityInstanceImpl scan = root ; scan != null ; scan = scan . getNextHier ( ) ) { if ( ( scan . getObjectInstance ( ) ) != ( this ) ) { writeValidateError ( scan , scan , "EI<seq2seq4repair_space>has<seq2seq4repair_space>mis-matching<seq2seq4repair_space>OI" ) ; <START_BUG> return true ; <END_BUG> } if ( ( scan . getPrevHier ( ) ) != null ) { if ( ( scan . getPrevHier ( ) . getNextHier ( ) ) != scan ) { writeValidateError ( scan , scan . getPrevHier ( ) , "Prev//Next<seq2seq4repair_space>hier<seq2seq4repair_space>pointers<seq2seq4repair_space>don't<seq2seq4repair_space>match" ) ; return false ; } } EntityInstanceImpl next = scan . getNextHier ( ) ; if ( next != null ) { if ( ( next . getPrevHier ( ) ) != scan ) { writeValidateError ( scan , next , "Next//prev<seq2seq4repair_space>hier<seq2seq4repair_space>pointers<seq2seq4repair_space>don't<seq2seq4repair_space>match" ) ; scan . logEntity ( false ) ; next . logEntity ( false ) ; return false ; } } if ( ( scan . getNextTwin ( ) ) != null ) { if ( ( scan . getNextTwin ( ) . getPrevTwin ( ) ) != scan ) { writeValidateError ( scan , scan . getNextTwin ( ) , "Next//prev<seq2seq4repair_space>Twin<seq2seq4repair_space>pointers<seq2seq4repair_space>don't<seq2seq4repair_space>match" ) ; return false ; } if ( ( scan . getNextTwin ( ) . getEntityDef ( ) ) != ( scan . getEntityDef ( ) ) ) { writeValidateError ( scan , scan . getNextTwin ( ) , "EntityDef<seq2seq4repair_space>next<seq2seq4repair_space>Twin<seq2seq4repair_space>pointers<seq2seq4repair_space>don't<seq2seq4repair_space>match" ) ; return false ; } } if ( ( scan . getPrevTwin ( ) ) != null ) { if ( ( scan . getPrevTwin ( ) . getParent ( ) ) != ( scan . getParent ( ) ) ) { writeValidateError ( scan , scan . getPrevTwin ( ) , "Parent<seq2seq4repair_space>pointers<seq2seq4repair_space>don't<seq2seq4repair_space>match" ) ; return false ; } if ( ( scan . getPrevTwin ( ) . getNextTwin ( ) ) != scan ) { writeValidateError ( scan , scan . getPrevTwin ( ) , "Prev//Next<seq2seq4repair_space>twin<seq2seq4repair_space>pointers<seq2seq4repair_space>don't<seq2seq4repair_space>match" ) ; return false ; } if ( ( scan . getPrevTwin ( ) . getEntityDef ( ) ) != ( scan . getEntityDef ( ) ) ) { writeValidateError ( scan , scan . getPrevTwin ( ) , "Prev<seq2seq4repair_space>twin<seq2seq4repair_space>EntityDef<seq2seq4repair_space>don't<seq2seq4repair_space>match" ) ; return false ; } } } return true ; } private void writeValidateError ( EntityInstanceImpl scan , EntityInstanceImpl other , String msg ) { } void setTask ( TaskImpl task ) { } AttributeHashKeyMap getAttributeHashkeyMap ( ) { } ActivateOptions getActivateOptions ( ) { } void setActivateOptions ( ActivateOptions activateOptions ) { } UUID getUuid ( ) { } void addReferringViewCursor ( ViewCursor viewCursor ) { } Set < ViewCursor > getReferringViewCursors ( ) { } boolean isIgnoreLazyLoadEntities ( ) { } void setIgnoreLazyLoadEntities ( boolean ignoreLazyLoadEntities ) { } ViewImpl createView ( EntityInstanceImpl ei ) { } int getEntityCount ( boolean includeHidden ) { } }

Fix:
return false ;