Source:
public <T> ElasticsearchScopedIndexFieldComponent<T> getSchemaNodeComponent(String absoluteFieldPath, IndexSchemaFieldNodeComponentRetrievalStrategy<T> componentRetrievalStrategy) { ElasticsearchIndexModel indexModelForSelectedSchemaNode = null; ElasticsearchIndexSchemaFieldNode<?> selectedSchemaNode = null; ElasticsearchScopedIndexFieldComponent<T> scopedIndexFieldComponent = new ElasticsearchScopedIndexFieldComponent<>(); for ( ElasticsearchIndexModel indexModel : indexModels ) { ElasticsearchIndexSchemaFieldNode<?> 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.getHibernateSearchIndexName(), indexModel.getHibernateSearchIndexName() ) ); } ElasticsearchFailingCompatibilityChecker failingCompatibilityChecker = new ElasticsearchFailingCompatibilityChecker<>( absoluteFieldPath, scopedIndexFieldComponent.getComponent(), component, EventContexts.fromIndexNames( indexModelForSelectedSchemaNode.getHibernateSearchIndexName(), indexModel.getHibernateSearchIndexName() ), 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> ElasticsearchScopedIndexFieldComponent<T> getSchemaNodeComponent(String absoluteFieldPath, IndexSchemaFieldNodeComponentRetrievalStrategy<T> componentRetrievalStrategy) { ElasticsearchIndexModel indexModelForSelectedSchemaNode = null; ElasticsearchIndexSchemaFieldNode<?> selectedSchemaNode = null; ElasticsearchScopedIndexFieldComponent<T> scopedIndexFieldComponent = new ElasticsearchScopedIndexFieldComponent<>(); for ( ElasticsearchIndexModel indexModel : indexModels ) { ElasticsearchIndexSchemaFieldNode<?> 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.getHibernateSearchIndexName(), indexModel.getHibernateSearchIndexName() ) ); } ElasticsearchFailingCompatibilityChecker<T> failingCompatibilityChecker = new ElasticsearchFailingCompatibilityChecker<>( absoluteFieldPath, scopedIndexFieldComponent.getComponent(), component, EventContexts.fromIndexNames( indexModelForSelectedSchemaNode.getHibernateSearchIndexName(), indexModel.getHibernateSearchIndexName() ), 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; }