Source:
public void init() { IndexMap indexMap = indexMapRef.indexMapSnapshot(); Map<InternalIndexState, List<IndexLogRecord>> indexStates = new HashMap<>(); for ( IndexRule indexRule : indexRules ) { IndexProxy indexProxy; long indexId = indexRule.getId(); IndexDescriptor descriptor = new IndexDescriptor( indexRule.getLabel(), indexRule.getPropertyKey() ); SchemaIndexProvider.Descriptor providerDescriptor = indexRule.getProviderDescriptor(); SchemaIndexProvider provider = providerMap.apply( providerDescriptor ); InternalIndexState initialState = provider.getInitialState( indexId ); indexStates.computeIfAbsent( initialState, internalIndexState -> new ArrayList<>() ).add( new IndexLogRecord( indexId, descriptor ) ); log.debug( indexStateInfo( "init", indexId, initialState, descriptor ) ); boolean constraint = indexRule.isConstraintIndex(); switch ( initialState ) { case ONLINE: indexProxy = indexProxyCreator.createOnlineIndexProxy( indexId, descriptor, providerDescriptor, constraint ); break; case POPULATING: if ( constraint && indexRule.getOwningConstraint() == null ) { indexProxy = indexProxyCreator.createFailedIndexProxy( indexId, descriptor, providerDescriptor, constraint, failure( "Constraint for index was not committed." ) ); } else { indexProxy = indexProxyCreator .createRecoveringIndexProxy( descriptor, providerDescriptor, constraint ); } break; case FAILED: IndexPopulationFailure failure = failure( provider.getPopulationFailure( indexId ) ); indexProxy = indexProxyCreator .createFailedIndexProxy( indexId, descriptor, providerDescriptor, constraint, failure ); break; default: throw new IllegalArgumentException( "" + initialState ); } indexMap.putIndexProxy( indexId, indexProxy ); } logIndexStateSummary( "init", indexStates ); indexMapRef.setIndexMap( indexMap ); }

Target:
public void init() { IndexMap indexMap = indexMapRef.indexMapSnapshot(); Map<InternalIndexState, List<IndexLogRecord>> indexStates = new EnumMap<>( InternalIndexState.class ); for ( IndexRule indexRule : indexRules ) { IndexProxy indexProxy; long indexId = indexRule.getId(); IndexDescriptor descriptor = new IndexDescriptor( indexRule.getLabel(), indexRule.getPropertyKey() ); SchemaIndexProvider.Descriptor providerDescriptor = indexRule.getProviderDescriptor(); SchemaIndexProvider provider = providerMap.apply( providerDescriptor ); InternalIndexState initialState = provider.getInitialState( indexId ); indexStates.computeIfAbsent( initialState, internalIndexState -> new ArrayList<>() ).add( new IndexLogRecord( indexId, descriptor ) ); log.debug( indexStateInfo( "init", indexId, initialState, descriptor ) ); boolean constraint = indexRule.isConstraintIndex(); switch ( initialState ) { case ONLINE: indexProxy = indexProxyCreator.createOnlineIndexProxy( indexId, descriptor, providerDescriptor, constraint ); break; case POPULATING: if ( constraint && indexRule.getOwningConstraint() == null ) { indexProxy = indexProxyCreator.createFailedIndexProxy( indexId, descriptor, providerDescriptor, constraint, failure( "Constraint for index was not committed." ) ); } else { indexProxy = indexProxyCreator .createRecoveringIndexProxy( descriptor, providerDescriptor, constraint ); } break; case FAILED: IndexPopulationFailure failure = failure( provider.getPopulationFailure( indexId ) ); indexProxy = indexProxyCreator .createFailedIndexProxy( indexId, descriptor, providerDescriptor, constraint, failure ); break; default: throw new IllegalArgumentException( "" + initialState ); } indexMap.putIndexProxy( indexId, indexProxy ); } logIndexStateSummary( "init", indexStates ); indexMapRef.setIndexMap( indexMap ); }