Skip to content

Commit 47cb34b

Browse files
committed
Never use PropertyDescriptors of a proxy class
1 parent 099fdcb commit 47cb34b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/spring/ReloadAwareAutowireCapableBeanFactory.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,12 @@ protected Map<String, PropertyDescriptor> resolveAutowireablePropertyDescriptors
269269
return resolveAutowireablePropertyDescriptorsForClass(existingBean.getClass(), new Callable<BeanWrapper>() {
270270
public BeanWrapper call() throws Exception {
271271
BeanWrapperImpl bw = new BeanWrapperImpl(false);
272-
bw.setWrappedInstance(existingBean);
272+
Class userClass = ClassUtils.getUserClass(existingBean.getClass());
273+
if(userClass != existingBean.getClass()) {
274+
bw.setWrappedInstance(BeanUtils.instantiate(userClass));
275+
} else {
276+
bw.setWrappedInstance(existingBean);
277+
}
273278
bw.setConversionService(getConversionService());
274279
return bw;
275280
}

0 commit comments

Comments
 (0)