Skip to content

Treat JUnit 3 unit test setup method as constructor for UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR #3169

@vectro

Description

@vectro

PR #2872 added support to consider additional methods as constructors for the purposes of UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR; however the approach implemented there does not seem to be compatible with JUnit 3. In JUnit 3 the initialization method is called setUp and does not have any annotations.

As an alternative, I suggest adding setUp as a whitelisted method name here, or if that is too loose it could be conditional on the method being a descendant of junit.framework.TestCase.

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