Skip to content

Commit 6573e91

Browse files
committed
Polishing
1 parent 797f5db commit 6573e91

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ else if (sqlType == Types.BOOLEAN) {
369369
ps.setBoolean(paramIndex, (Boolean) inValue);
370370
}
371371
else {
372-
ps.setObject(paramIndex, inValue, Types.BOOLEAN);
372+
ps.setObject(paramIndex, inValue, Types.BOOLEAN);
373373
}
374374
}
375375
else if (sqlType == Types.DATE) {

spring-test/src/main/java/org/springframework/test/context/BootstrapUtils.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@
2222
import org.apache.commons.logging.Log;
2323
import org.apache.commons.logging.LogFactory;
2424

25+
import org.springframework.beans.BeanUtils;
2526
import org.springframework.core.annotation.AnnotatedElementUtils;
2627
import org.springframework.core.annotation.AnnotationUtils;
27-
import org.springframework.util.Assert;
2828
import org.springframework.util.ClassUtils;
2929
import org.springframework.util.MultiValueMap;
3030

31-
import static org.springframework.beans.BeanUtils.instantiateClass;
32-
3331
/**
3432
* {@code BootstrapUtils} is a collection of utility methods to assist with
3533
* bootstrapping the <em>Spring TestContext Framework</em>.
@@ -80,7 +78,7 @@ static BootstrapContext createBootstrapContext(Class<?> testClass) {
8078
if (logger.isDebugEnabled()) {
8179
logger.debug(String.format("Instantiating BootstrapContext using constructor [%s]", constructor));
8280
}
83-
return instantiateClass(constructor, testClass, cacheAwareContextLoaderDelegate);
81+
return BeanUtils.instantiateClass(constructor, testClass, cacheAwareContextLoaderDelegate);
8482
}
8583
catch (Throwable ex) {
8684
throw new IllegalStateException("Could not load BootstrapContext [" + clazz + "]", ex);
@@ -98,7 +96,7 @@ private static CacheAwareContextLoaderDelegate createCacheAwareContextLoaderDele
9896
logger.debug(String.format("Instantiating CacheAwareContextLoaderDelegate from class [%s]",
9997
clazz.getName()));
10098
}
101-
return instantiateClass(clazz, CacheAwareContextLoaderDelegate.class);
99+
return BeanUtils.instantiateClass(clazz, CacheAwareContextLoaderDelegate.class);
102100
}
103101
catch (Throwable ex) {
104102
throw new IllegalStateException("Could not load CacheAwareContextLoaderDelegate [" + clazz + "]", ex);
@@ -134,7 +132,8 @@ static TestContextBootstrapper resolveTestContextBootstrapper(BootstrapContext b
134132
logger.debug(String.format("Instantiating TestContextBootstrapper for test class [%s] from class [%s]",
135133
testClass.getName(), clazz.getName()));
136134
}
137-
TestContextBootstrapper testContextBootstrapper = instantiateClass(clazz, TestContextBootstrapper.class);
135+
TestContextBootstrapper testContextBootstrapper =
136+
BeanUtils.instantiateClass(clazz, TestContextBootstrapper.class);
138137
testContextBootstrapper.setBootstrapContext(bootstrapContext);
139138
return testContextBootstrapper;
140139
}

0 commit comments

Comments
 (0)