Skip to content

Treat @PostConstruct methods as constructors for UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR #2870

@famod

Description

@famod

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions