Skip to content

Document why complex object structure are not supported as paremeters or properties by AOT #32273

@Christopher-Chianelli

Description

@Christopher-Chianelli

Affects: 6.1.3


A bean definition that uses non-common value types like this:

    @Override
    public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
        RootBeanDefinition beanDefinition = new RootBeanDefinition(MyBean.class);
        beanDefinition.getConstructorArgumentValues().addGenericArgumentValue(new MyBeanRecord("Bob", 12));
        registry.registerBeanDefinition("MyBean", beanDefinition);
    }

will cause a ValueCodeGeneration exception.
Since this use case is intentionally unsupported (see #32214 (comment)), a helpful error message saying "ConstructorArgumentValues do not support code generation for arguments of type (MyBeanRecord)" should be thrown instead, similar to what happens with instance suppliers.

Demo: https://github.com/Christopher-Chianelli/issue-reproducer/tree/constructor-argument-value-unsupported/demo

Metadata

Metadata

Assignees

Labels

theme: aotAn issue related to Ahead-of-time processingtype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions