Buggy code:
class ActivateOisFromJsonStream implements StreamReader { private static final EnumSet < CreateEntityFlags > CREATE_FLAGS = EnumSet . of ( fNO_SPAWNING , fIGNORE_MAX_CARDINALITY , fDONT_UPDATE_OI , fDONT_INITIALIZE_ATTRIBUTES , fIGNORE_PERMISSIONS ) ; private static final ActivateOisFromJsonStream . EntityMeta DEFAULT_ENTITY_META = new ActivateOisFromJsonStream . EntityMeta ( ) ; private Task task ; private InputStream stream ; private DeserializeOi options ; private final Map < Object , EntityInstanceImpl > linkSources ; private JsonParser jp ; private Application application ; private boolean incremental ; private LodDef lodDef ; private View view ; private final List < View > returnList ; private String version ; private List < EntityInstance > selectedInstances ; private boolean readOnlyOi ; private boolean readOnly ; private interface JsonReader { void process ( ) throws Exception { } } ActivateOisFromJsonStream ( ) { } public List < View > read ( ) { } private ActivateOisFromJsonStream . JsonReader getReaderForVersion ( ) { } private ActivateOisFromJsonStream . JsonReader getSimpleReaderForVersion ( ) { } private void readFileMeta ( ) throws Exception { } private String getVersion ( ) { } private boolean readOi ( ) throws Exception { } private void setCursors ( ) { } private boolean readSimpleOi ( ) throws Exception { } private void readEntity ( String entityName ) throws Exception { boolean entityArray = false ; int twinCount = 0 ; JsonToken token = jp . getCurrentToken ( ) ; if ( token == ( JsonToken . START_ARRAY ) ) { token = jp . nextToken ( ) ; entityArray = true ; } assert token == ( JsonToken . START_OBJECT ) ; EntityDef entityDef = lodDef . getEntityDef ( entityName ) ; while ( ( token = jp . nextToken ( ) ) != null ) { twinCount ++ ; if ( token == ( JsonToken . END_ARRAY ) ) break ; if ( token == ( JsonToken . END_OBJECT ) ) { token = jp . nextToken ( ) ; assert token == ( JsonToken . END_ARRAY ) ; break ; } if ( token == ( JsonToken . START_OBJECT ) ) { assert twinCount > 1 ; token = jp . nextToken ( ) ; } assert token == ( JsonToken . FIELD_NAME ) ; EntityInstanceImpl ei = ( ( EntityInstanceImpl ) ( view . cursor ( entityDef ) . createEntity ( LAST , ActivateOisFromJsonStream . CREATE_FLAGS ) ) ) ; List < ActivateOisFromJsonStream . AttributeMeta > attributeMetas = new ArrayList < > ( ) ; ActivateOisFromJsonStream . EntityMeta entityMeta = ActivateOisFromJsonStream . DEFAULT_ENTITY_META ; while ( ( token = jp . nextToken ( ) ) != ( JsonToken . END_OBJECT ) ) { String fieldName = jp . getCurrentName ( ) ; if ( token != ( JsonToken . VALUE_STRING ) ) token = jp . nextToken ( ) ; if ( StringUtils . equals ( fieldName , ".meta" ) ) { entityMeta = readEntityMeta ( ei ) ; if ( entityMeta . isLinkedSource ) linkSources . put ( entityMeta . entityKey , ei ) ; else if ( ( entityMeta . linkedSource ) != null ) ei . linkInstances ( linkSources . get ( entityMeta . linkedSource ) ) ; continue ; } if ( fieldName . startsWith ( "." ) ) { ActivateOisFromJsonStream . AttributeMeta am = readAttributeMeta ( ei , fieldName ) ; attributeMetas . add ( am ) ; continue ; } if ( ( token == ( JsonToken . START_ARRAY ) ) || ( token == ( JsonToken . START_OBJECT ) ) ) { boolean recursiveChild = false ; EntityDef childEntity = lodDef . getEntityDef ( fieldName ) ; if ( ( childEntity . getParent ( ) ) != entityDef ) { <START_BUG> if ( childEntity . isRecursive ( ) ) { <END_BUG> view . cursor ( entityDef ) . setToSubobject ( ) ; recursiveChild = true ; } else throw new ZeidonException ( "Parse<seq2seq4repair_space>error:<seq2seq4repair_space>%s<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>child<seq2seq4repair_space>of<seq2seq4repair_space>%s" , fieldName , entityName ) ; } readEntity ( fieldName ) ; if ( recursiveChild ) view . resetSubobject ( ) ; continue ; } if ( StringUtils . equals ( jp . getText ( ) , fieldName ) ) token = jp . nextToken ( ) ; AttributeDef attributeDef = entityDef . getAttribute ( fieldName , false ) ; if ( attributeDef == null ) { if ( ( ( options . getAllowableDynamicEntities ( ) ) == null ) || ( ! ( options . getAllowableDynamicEntities ( ) . contains ( entityDef . getName ( ) ) ) ) ) { entityDef . getAttribute ( fieldName ) ; } DynamicAttributeDefConfiguration config = new DynamicAttributeDefConfiguration ( ) ; config . setAttributeName ( fieldName ) ; attributeDef = entityDef . createDynamicAttributeDef ( config ) ; } ei . setInternalAttributeValue ( attributeDef , jp . getText ( ) , false ) ; if ( incremental ) { AttributeValue attrib = ei . getInternalAttribute ( attributeDef ) ; attrib . setUpdated ( false ) ; } } for ( ActivateOisFromJsonStream . AttributeMeta am : attributeMetas ) am . apply ( ei ) ; ei . setCreated ( entityMeta . created ) ; ei . setUpdated ( entityMeta . updated ) ; ei . setDeleted ( entityMeta . deleted ) ; ei . setIncluded ( entityMeta . included ) ; ei . setExcluded ( entityMeta . excluded ) ; if ( entityMeta . incomplete ) ei . setIncomplete ( null ) ; if ( entityArray == false ) break ; } } private ActivateOisFromJsonStream . AttributeMeta readAttributeMeta ( EntityInstanceImpl ei , String fieldName ) throws JsonParseException , IOException { } private class AttributeMeta { private AttributeDef attributeDef ; private boolean updated = false ; private void apply ( EntityInstanceImpl ei ) { } } private ActivateOisFromJsonStream . EntityMeta readEntityMeta ( EntityInstanceImpl ei ) throws Exception { } private void readIncrementals ( ActivateOisFromJsonStream . EntityMeta meta ) throws JsonParseException , IOException { } private JsonToken readOiMeta ( ) throws Exception { } private static class EntityMeta { private String linkedSource ; private String entityKey ; private boolean isLinkedSource ;

Fix:
if ( entityDef . isRecursive ( ) ) {