Source:
public BinderFactory binderFactory(BinderTypeRegistry binderTypeRegistry, ChannelBindingServiceProperties channelBindingServiceProperties) { Map<String, BinderConfiguration> binderConfigurations = new HashMap<>(); Map<String, BinderProperties> declaredBinders = channelBindingServiceProperties.getBinders(); boolean hasUserDefinedBinders = false; Iterator<Map.Entry<String, BinderProperties>> binderPropertiesIterator = declaredBinders.entrySet().iterator(); while (!hasUserDefinedBinders && binderPropertiesIterator.hasNext()) { hasUserDefinedBinders = binderPropertiesIterator.next().getValue().isApplicationProvided(); } for (Map.Entry<String, BinderProperties> binderEntry : declaredBinders.entrySet()) { BinderProperties binderProperties = binderEntry.getValue(); if (binderTypeRegistry.get(binderEntry.getKey()) != null) { binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderTypeRegistry.get(binderEntry.getKey()), binderProperties.getEnvironment(), binderProperties.isInheritEnvironment(), binderProperties.isApplicationProvided())); } else { Assert.hasText(binderProperties.getType(), "No 'type' property present for custom " + "binder " + binderEntry.getKey()); BinderType binderType = binderTypeRegistry.get(binderProperties.getType()); Assert.notNull(binderType, "Binder type " + binderProperties.getType() + " is not defined"); binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderType, binderProperties.getEnvironment(), binderProperties.isInheritEnvironment(), binderProperties.isApplicationProvided())); } } if (!hasUserDefinedBinders) { for (Map.Entry<String, BinderType> entry : binderTypeRegistry.getAll().entrySet()) { binderConfigurations.put(entry.getKey(), new BinderConfiguration(entry.getValue(), new Properties(), true, true)); } } DefaultBinderFactory binderFactory = new DefaultBinderFactory<>(binderConfigurations); binderFactory.setDefaultBinder(channelBindingServiceProperties.getDefaultBinder()); return binderFactory; }

Target:
public BinderFactory binderFactory(BinderTypeRegistry binderTypeRegistry, ChannelBindingServiceProperties channelBindingServiceProperties) { Map<String, BinderConfiguration> binderConfigurations = new HashMap<>(); Map<String, BinderProperties> declaredBinders = channelBindingServiceProperties.getBinders(); boolean defaultCandidatesExist = false; Iterator<Map.Entry<String, BinderProperties>> binderPropertiesIterator = declaredBinders.entrySet().iterator(); while (!defaultCandidatesExist && binderPropertiesIterator.hasNext()) { defaultCandidatesExist = binderPropertiesIterator.next().getValue().isDefaultCandidate(); } for (Map.Entry<String, BinderProperties> binderEntry : declaredBinders.entrySet()) { BinderProperties binderProperties = binderEntry.getValue(); if (binderTypeRegistry.get(binderEntry.getKey()) != null) { binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderTypeRegistry.get(binderEntry.getKey()), binderProperties.getEnvironment(), binderProperties.isInheritEnvironment(), binderProperties.isDefaultCandidate())); } else { Assert.hasText(binderProperties.getType(), "No 'type' property present for custom " + "binder " + binderEntry.getKey()); BinderType binderType = binderTypeRegistry.get(binderProperties.getType()); Assert.notNull(binderType, "Binder type " + binderProperties.getType() + " is not defined"); binderConfigurations.put(binderEntry.getKey(), new BinderConfiguration(binderType, binderProperties.getEnvironment(), binderProperties.isInheritEnvironment(), binderProperties.isDefaultCandidate())); } } if (!defaultCandidatesExist) { for (Map.Entry<String, BinderType> entry : binderTypeRegistry.getAll().entrySet()) { binderConfigurations.put(entry.getKey(), new BinderConfiguration(entry.getValue(), new Properties(), true, true)); } } DefaultBinderFactory binderFactory = new DefaultBinderFactory<>(binderConfigurations); binderFactory.setDefaultBinder(channelBindingServiceProperties.getDefaultBinder()); return binderFactory; }