Skip to content

Static methods can be accessed from within subclasses, but NullAway doesn't know this #764

@lazaroclapp

Description

@lazaroclapp

The following is (annoyingly) valid Java code for calling a static method:

class Foo {
    public static String foo(@Nullable Object ignored) { return "Nonsense java black magic!"; };
}

class Bar extends Foo { }

class Main {
    public static void main(String[] args) {
        System.out.println(Bar.foo(null));
    }
}

However, NullAway will fail to read the annotations of Foo.foo(...) when inspecting the static call to Bar.foo(...) and thus give an error on Bar.foo(null).

Metadata

Metadata

Assignees

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