}
private Object construct(Class baseClass, String methodName, Messages messages)
{
ComponentSpecification spec = new ComponentSpecification();
EnhancementOperationImpl op = new EnhancementOperationImpl(getClassResolver(), spec,
baseClass, new ClassFactoryImpl());
op.addInjectedField("_messages", Messages.class, messages);
EnhanceUtils.createSimpleAccessor(op, "_messages", "messages", Messages.class);
Method method = findMethod(baseClass, methodName);
new MessageAnnotationWorker().performEnhancement(op, spec, method, null);
ComponentConstructor cc = op.getConstructor();
return cc.newInstance();
}