Source:
<code>private PartitionSelectorStrategy getPartitionSelectorStrategy(ProducerProperties producerProperties) { PartitionSelectorStrategy partitionSelector; if (producerProperties.getPartitionSelectorClass() != null) { logger.warn("'partitionSelectorClass' option is deprecated as of v2.0. Please configure partition " + "selector as a @Bean that implements 'PartitionSelectorStrategy'. Additionally you can " + "specify 'spring.cloud.stream.bindings.output.producer.partitionSelectorName' to specify which " + "bean to use in the event there are more then one."); partitionSelector = instantiate(producerProperties.getPartitionSelectorClass(), PartitionSelectorStrategy.class); } else if (StringUtils.hasText(producerProperties.getPartitionSelectorName())) { partitionSelector = this.partitionSelectors.get(producerProperties.getPartitionSelectorName()); Assert.notNull(partitionSelector, "PartitionSelectorStrategy bean with the name '" + producerProperties.getPartitionSelectorName() + "' can not be found. Has it been configured (e.g., @Bean)?"); } else { <START> Assert.isTrue(CollectionUtils.isEmpty(this.partitionSelectors) || this.partitionSelectors.size() == 1, <END> "Multiple beans of type 'PartitionSelectorStrategy' found. " + this.partitionSelectors + ". Please " + "use 'spring.cloud.stream.bindings.output.producer.partitionSelectorName' property to specify " + "the name of the bean to be used."); partitionSelector = CollectionUtils.isEmpty(this.partitionSelectors) ? new DefaultPartitionSelector() : this.partitionSelectors.values().iterator().next(); } return partitionSelector; }</code><technical_language>ditto ( <= 1)</technical_language>

Target:
private PartitionSelectorStrategy getPartitionSelectorStrategy(ProducerProperties producerProperties) { PartitionSelectorStrategy partitionSelector; if (producerProperties.getPartitionSelectorClass() != null) { logger.warn("'partitionSelectorClass' option is deprecated as of v2.0. Please configure partition " + "selector as a @Bean that implements 'PartitionSelectorStrategy'. Additionally you can " + "specify 'spring.cloud.stream.bindings.output.producer.partitionSelectorName' to specify which " + "bean to use in the event there are more then one."); partitionSelector = instantiate(producerProperties.getPartitionSelectorClass(), PartitionSelectorStrategy.class); } else if (StringUtils.hasText(producerProperties.getPartitionSelectorName())) { partitionSelector = this.partitionSelectors.get(producerProperties.getPartitionSelectorName()); Assert.notNull(partitionSelector, "PartitionSelectorStrategy bean with the name '" + producerProperties.getPartitionSelectorName() + "' can not be found. Has it been configured (e.g., @Bean)?"); } else { Assert.isTrue(CollectionUtils.isEmpty(this.partitionSelectors) || this.partitionSelectors.size() <= 1, "Multiple beans of type 'PartitionSelectorStrategy' found. " + this.partitionSelectors + ". Please " + "use 'spring.cloud.stream.bindings.output.producer.partitionSelectorName' property to specify " + "the name of the bean to be used."); partitionSelector = CollectionUtils.isEmpty(this.partitionSelectors) ? new DefaultPartitionSelector() : this.partitionSelectors.values().iterator().next(); } return partitionSelector; }