Skip to content

new Check: report unneeded null check when using instanceOf #6943

@tir38

Description

@tir38

Given:

if (myObj != null && myObj instanceof SomeObject) {
    // ...
}

I should be warned that myObj != null is not needed, given that instanceOf handles that under the hood.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions