Browse Source

Polishing

pull/976/merge
Juergen Hoeller 9 years ago
parent
commit
6573e9142c
  1. 2
      spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
  2. 11
      spring-test/src/main/java/org/springframework/test/context/BootstrapUtils.java

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

@ -369,7 +369,7 @@ public abstract class StatementCreatorUtils { @@ -369,7 +369,7 @@ public abstract class StatementCreatorUtils {
ps.setBoolean(paramIndex, (Boolean) inValue);
}
else {
ps.setObject(paramIndex, inValue, Types.BOOLEAN);
ps.setObject(paramIndex, inValue, Types.BOOLEAN);
}
}
else if (sqlType == Types.DATE) {

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

@ -22,14 +22,12 @@ import java.util.List; @@ -22,14 +22,12 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.MultiValueMap;
import static org.springframework.beans.BeanUtils.instantiateClass;
/**
* {@code BootstrapUtils} is a collection of utility methods to assist with
* bootstrapping the <em>Spring TestContext Framework</em>.
@ -80,7 +78,7 @@ abstract class BootstrapUtils { @@ -80,7 +78,7 @@ abstract class BootstrapUtils {
if (logger.isDebugEnabled()) {
logger.debug(String.format("Instantiating BootstrapContext using constructor [%s]", constructor));
}
return instantiateClass(constructor, testClass, cacheAwareContextLoaderDelegate);
return BeanUtils.instantiateClass(constructor, testClass, cacheAwareContextLoaderDelegate);
}
catch (Throwable ex) {
throw new IllegalStateException("Could not load BootstrapContext [" + clazz + "]", ex);
@ -98,7 +96,7 @@ abstract class BootstrapUtils { @@ -98,7 +96,7 @@ abstract class BootstrapUtils {
logger.debug(String.format("Instantiating CacheAwareContextLoaderDelegate from class [%s]",
clazz.getName()));
}
return instantiateClass(clazz, CacheAwareContextLoaderDelegate.class);
return BeanUtils.instantiateClass(clazz, CacheAwareContextLoaderDelegate.class);
}
catch (Throwable ex) {
throw new IllegalStateException("Could not load CacheAwareContextLoaderDelegate [" + clazz + "]", ex);
@ -134,7 +132,8 @@ abstract class BootstrapUtils { @@ -134,7 +132,8 @@ abstract class BootstrapUtils {
logger.debug(String.format("Instantiating TestContextBootstrapper for test class [%s] from class [%s]",
testClass.getName(), clazz.getName()));
}
TestContextBootstrapper testContextBootstrapper = instantiateClass(clazz, TestContextBootstrapper.class);
TestContextBootstrapper testContextBootstrapper =
BeanUtils.instantiateClass(clazz, TestContextBootstrapper.class);
testContextBootstrapper.setBootstrapContext(bootstrapContext);
return testContextBootstrapper;
}

Loading…
Cancel
Save