Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat @PostConstruct methods as constructors for UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR #2870

Closed
famod opened this issue Feb 21, 2024 · 1 comment · Fixed by #2872
Closed

Comments

@famod
Copy link

famod commented Feb 21, 2024

Very similar to #453.

As of SB 4.8.3, UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR is reported for the following class:

// CDI bean
@ApplicationScoped
puplic class Foo {
    private Object bar;

    @PostConstruct
    void init() {
        bar = new Object();
    }

    public String doSomethingWithBar() {
        return bar.toString();
    }
}

This will never be a problem during runtime (only maybe in simple tests that don't use CDI, but you'll notice soon enough).

Copy link

welcome bot commented Feb 21, 2024

Thanks for opening your first issue here! 😃
Please check our contributing guideline. Especially when you report a problem, make sure you share a Minimal, Complete, and Verifiable example to reproduce it in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant