Source:
public <T> LuceneScopedIndexFieldComponent<T> getSchemaNodeComponent(String absoluteFieldPath, IndexSchemaFieldNodeComponentRetrievalStrategy<T> componentRetrievalStrategy) { LuceneIndexModel indexModelForSelectedSchemaNode = null; LuceneIndexSchemaFieldNode<?> selectedSchemaNode = null; LuceneScopedIndexFieldComponent<T> scopedIndexFieldComponent = new LuceneScopedIndexFieldComponent<>(); for ( LuceneIndexModel indexModel : indexModels ) { LuceneIndexSchemaFieldNode<?> schemaNode = indexModel.getFieldNode( absoluteFieldPath ); if ( schemaNode == null ) { continue; } T component = componentRetrievalStrategy.extractComponent( schemaNode ); if ( selectedSchemaNode == null ) { selectedSchemaNode = schemaNode; indexModelForSelectedSchemaNode = indexModel; scopedIndexFieldComponent.setComponent( component ); continue; } if ( !componentRetrievalStrategy.hasCompatibleCodec( scopedIndexFieldComponent.getComponent(), component ) ) { throw componentRetrievalStrategy.createCompatibilityException( absoluteFieldPath, scopedIndexFieldComponent.getComponent(), component, EventContexts.fromIndexNames( indexModelForSelectedSchemaNode.getIndexName(), indexModel.getIndexName() ) ); } LuceneFailingCompatibilityChecker failingCompatibilityChecker = new LuceneFailingCompatibilityChecker( absoluteFieldPath, scopedIndexFieldComponent.getComponent(), component, EventContexts.fromIndexNames( indexModelForSelectedSchemaNode.getIndexName(), indexModel.getIndexName() ), componentRetrievalStrategy ); if ( !componentRetrievalStrategy.hasCompatibleConverter( scopedIndexFieldComponent.getComponent(), component ) ) { scopedIndexFieldComponent.setConverterCompatibilityChecker( failingCompatibilityChecker ); } if ( !componentRetrievalStrategy.hasCompatibleAnalyzer( scopedIndexFieldComponent.getComponent(), component ) ) { scopedIndexFieldComponent.setAnalyzerCompatibilityChecker( failingCompatibilityChecker ); } } if ( selectedSchemaNode == null ) { throw log.unknownFieldForSearch( absoluteFieldPath, getIndexesEventContext() ); } return scopedIndexFieldComponent; }

Target:
public <T> LuceneScopedIndexFieldComponent<T> getSchemaNodeComponent(String absoluteFieldPath, IndexSchemaFieldNodeComponentRetrievalStrategy<T> componentRetrievalStrategy) { LuceneIndexModel indexModelForSelectedSchemaNode = null; LuceneIndexSchemaFieldNode<?> selectedSchemaNode = null; LuceneScopedIndexFieldComponent<T> scopedIndexFieldComponent = new LuceneScopedIndexFieldComponent<>(); for ( LuceneIndexModel indexModel : indexModels ) { LuceneIndexSchemaFieldNode<?> schemaNode = indexModel.getFieldNode( absoluteFieldPath ); if ( schemaNode == null ) { continue; } T component = componentRetrievalStrategy.extractComponent( schemaNode ); if ( selectedSchemaNode == null ) { selectedSchemaNode = schemaNode; indexModelForSelectedSchemaNode = indexModel; scopedIndexFieldComponent.setComponent( component ); continue; } if ( !componentRetrievalStrategy.hasCompatibleCodec( scopedIndexFieldComponent.getComponent(), component ) ) { throw componentRetrievalStrategy.createCompatibilityException( absoluteFieldPath, scopedIndexFieldComponent.getComponent(), component, EventContexts.fromIndexNames( indexModelForSelectedSchemaNode.getIndexName(), indexModel.getIndexName() ) ); } LuceneFailingCompatibilityChecker<T> failingCompatibilityChecker = new LuceneFailingCompatibilityChecker<>( absoluteFieldPath, scopedIndexFieldComponent.getComponent(), component, EventContexts.fromIndexNames( indexModelForSelectedSchemaNode.getIndexName(), indexModel.getIndexName() ), componentRetrievalStrategy ); if ( !componentRetrievalStrategy.hasCompatibleConverter( scopedIndexFieldComponent.getComponent(), component ) ) { scopedIndexFieldComponent.setConverterCompatibilityChecker( failingCompatibilityChecker ); } if ( !componentRetrievalStrategy.hasCompatibleAnalyzer( scopedIndexFieldComponent.getComponent(), component ) ) { scopedIndexFieldComponent.setAnalyzerCompatibilityChecker( failingCompatibilityChecker ); } } if ( selectedSchemaNode == null ) { throw log.unknownFieldForSearch( absoluteFieldPath, getIndexesEventContext() ); } return scopedIndexFieldComponent; }