// Implementation note: The default Spring InstantiationStrategy caches constructors.
// This is no good at development time because if the class reloads then Spring
// continues to use the old class. We deal with this here by disabling the caching
// for development time only
setInstantiationStrategy(new CglibSubclassingInstantiationStrategy() {
@Override
public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) {
// Don't override the class with CGLIB if no overrides.
if (beanDefinition.getMethodOverrides().isEmpty()) {
Constructor<?> constructorToUse;