Skip to content

Commit

Permalink
Use @qualifier to specify which MessageSource to choose
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesfredley committed Sep 10, 2024
1 parent f9acc10 commit 01d465e
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
import org.grails.datastore.mapping.transactions.DatastoreTransactionManager;
import org.grails.datastore.mapping.transactions.TransactionCapableDatastore;
import org.grails.datastore.mapping.validation.ValidatorRegistry;
import org.grails.spring.context.support.PluginAwareResourceBundleMessageSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.MessageSource;
import org.springframework.context.support.StaticMessageSource;
import org.springframework.core.env.PropertyResolver;
Expand Down Expand Up @@ -578,11 +578,7 @@ public void setCodecs(List<Codec<?>> codecs) {
* @param messageSource The message source
*/
@Autowired(required = false)
public void setMessageSource(PluginAwareResourceBundleMessageSource messageSource) {
setMessageSource((MessageSource) messageSource);
}

public void setMessageSource(MessageSource messageSource) {
public void setMessageSource(@Qualifier("PluginAwareResourceBundleMessageSource") MessageSource messageSource) {
if(messageSource != null) {
configureValidatorRegistry(connectionSources.getDefaultConnectionSource().getSettings(), (MongoMappingContext) mappingContext, messageSource);
}
Expand Down

0 comments on commit 01d465e

Please sign in to comment.