Skip to content

Identify invalid factory methods AOT when possible #32794

Open
@sdeleuze

Description

@sdeleuze

As discussed with @snicoll and @jhoeller while working on #32719, InstanceSupplierCodeGenerator#generateCode currently does not perform the same checks than org.springframework.beans.factory.support.ConstructorResolver#instantiateUsingFactoryMethod except the recent suspending function check added recently.

It would be nice from a DevXP and consistency perspective if it could perform AOT some of those checks (like the void return type check for example).

Activity

added
in: coreIssues in core modules (aop, beans, core, context, expression)
theme: aotAn issue related to Ahead-of-time processing
on May 10, 2024
added this to the 6.2.x milestone on May 10, 2024
snicoll

snicoll commented on May 11, 2024

@snicoll
Member

What I would like to see is a way to run those checks with some sort of API that allow to decouple them. There might be an interest to also accumulate those errors so that it doesn't fail one by one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)theme: aotAn issue related to Ahead-of-time processingtype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sdeleuze@snicoll@jhoeller

        Issue actions

          Identify invalid factory methods AOT when possible · Issue #32794 · spring-projects/spring-framework