11/*
2- * Copyright 2010-2024 the original author or authors.
2+ * Copyright 2010-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2323
2424import org .apache .ibatis .io .Resources ;
2525import org .apache .ibatis .session .SqlSessionFactory ;
26- import org .mybatis .logging .Logger ;
27- import org .mybatis .logging .LoggerFactory ;
2826import org .mybatis .spring .SqlSessionTemplate ;
27+ import org .slf4j .Logger ;
28+ import org .slf4j .LoggerFactory ;
2929import org .springframework .aop .scope .ScopedProxyFactoryBean ;
3030import org .springframework .aop .scope .ScopedProxyUtils ;
3131import org .springframework .aot .AotDetector ;
@@ -256,8 +256,8 @@ public Set<BeanDefinitionHolder> doScan(String... basePackages) {
256256
257257 if (beanDefinitions .isEmpty ()) {
258258 if (printWarnLogIfNotFoundMappers ) {
259- LOGGER .warn (() -> "No MyBatis mapper was found in '" + Arrays . toString ( basePackages )
260- + "' package. Please check your configuration." );
259+ LOGGER .warn ("No MyBatis mapper was found in '{}' package. Please check your configuration." ,
260+ Arrays . toString ( basePackages ) );
261261 }
262262 } else {
263263 processBeanDefinitions (beanDefinitions );
@@ -280,8 +280,8 @@ private void processBeanDefinitions(Set<BeanDefinitionHolder> beanDefinitions) {
280280 scopedProxy = true ;
281281 }
282282 var beanClassName = definition .getBeanClassName ();
283- LOGGER .debug (() -> "Creating MapperFactoryBean with name '" + holder . getBeanName () + " ' and '" + beanClassName
284- + "' mapperInterface" );
283+ LOGGER .debug ("Creating MapperFactoryBean with name '{} ' and '{}' mapperInterface" , holder . getBeanName (),
284+ beanClassName );
285285
286286 // the mapper interface is the original class of the bean
287287 // but, the actual class of the bean is MapperFactoryBean
@@ -314,22 +314,22 @@ private void processBeanDefinitions(Set<BeanDefinitionHolder> beanDefinitions) {
314314 if (StringUtils .hasText (this .sqlSessionTemplateBeanName )) {
315315 if (explicitFactoryUsed ) {
316316 LOGGER .warn (
317- () -> "Cannot use both: sqlSessionTemplate and sqlSessionFactory together. sqlSessionFactory is ignored." );
317+ "Cannot use both: sqlSessionTemplate and sqlSessionFactory together. sqlSessionFactory is ignored." );
318318 }
319319 definition .getPropertyValues ().add ("sqlSessionTemplate" ,
320320 new RuntimeBeanReference (this .sqlSessionTemplateBeanName ));
321321 explicitFactoryUsed = true ;
322322 } else if (this .sqlSessionTemplate != null ) {
323323 if (explicitFactoryUsed ) {
324324 LOGGER .warn (
325- () -> "Cannot use both: sqlSessionTemplate and sqlSessionFactory together. sqlSessionFactory is ignored." );
325+ "Cannot use both: sqlSessionTemplate and sqlSessionFactory together. sqlSessionFactory is ignored." );
326326 }
327327 definition .getPropertyValues ().add ("sqlSessionTemplate" , this .sqlSessionTemplate );
328328 explicitFactoryUsed = true ;
329329 }
330330
331331 if (!explicitFactoryUsed ) {
332- LOGGER .debug (() -> "Enabling autowire by type for MapperFactoryBean with name '" + holder .getBeanName () + "'." );
332+ LOGGER .debug ("Enabling autowire by type for MapperFactoryBean with name '{}'." , holder .getBeanName ());
333333 definition .setAutowireMode (AbstractBeanDefinition .AUTOWIRE_BY_TYPE );
334334 }
335335
@@ -364,8 +364,9 @@ protected boolean checkCandidate(String beanName, BeanDefinition beanDefinition)
364364 if (super .checkCandidate (beanName , beanDefinition )) {
365365 return true ;
366366 }
367- LOGGER .warn (() -> "Skipping MapperFactoryBean with name '" + beanName + "' and '"
368- + beanDefinition .getBeanClassName () + "' mapperInterface" + ". Bean already defined with the same name!" );
367+ LOGGER .warn (
368+ "Skipping MapperFactoryBean with name '{}' and '{}' mapperInterface. Bean already defined with the same name!" ,
369+ beanName , beanDefinition .getBeanClassName ());
369370 return false ;
370371 }
371372
0 commit comments