diff --git a/src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java b/src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java index 282bbdf333..ed97f2e130 100644 --- a/src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java +++ b/src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java @@ -555,11 +555,10 @@ private T[] appendArrays(T[] oldArrays, T[] newArrays, IntFunction gene } if (newArrays == null) { return oldArrays; - } else { - List newList = new ArrayList<>(Arrays.asList(oldArrays)); - newList.addAll(Arrays.asList(newArrays)); - return newList.toArray(generator.apply(0)); } + List newList = new ArrayList<>(Arrays.asList(oldArrays)); + newList.addAll(Arrays.asList(newArrays)); + return newList.toArray(generator.apply(0)); } @Override diff --git a/src/main/java/org/mybatis/spring/annotation/MapperScannerRegistrar.java b/src/main/java/org/mybatis/spring/annotation/MapperScannerRegistrar.java index f1de1b3c1e..66d4b9f418 100644 --- a/src/main/java/org/mybatis/spring/annotation/MapperScannerRegistrar.java +++ b/src/main/java/org/mybatis/spring/annotation/MapperScannerRegistrar.java @@ -61,6 +61,7 @@ */ public class MapperScannerRegistrar implements ImportBeanDefinitionRegistrar, ResourceLoaderAware { + // Note: Do not move resourceLoader via cleanup private ResourceLoader resourceLoader; @Override diff --git a/src/main/java/org/mybatis/spring/mapper/MapperScannerConfigurer.java b/src/main/java/org/mybatis/spring/mapper/MapperScannerConfigurer.java index eaf7c6f3b1..dd2146308f 100644 --- a/src/main/java/org/mybatis/spring/mapper/MapperScannerConfigurer.java +++ b/src/main/java/org/mybatis/spring/mapper/MapperScannerConfigurer.java @@ -468,11 +468,11 @@ private String getPropertyValue(String propertyName, PropertyValues values) { } if (value instanceof String) { return value.toString(); - } else if (value instanceof TypedStringValue) { + } + if (value instanceof TypedStringValue) { return ((TypedStringValue) value).getValue(); - } else { - return null; } + return null; } @SuppressWarnings("unchecked")