You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NullPointerException in InstanceOfAndCastMatchWrongType #4168
error-prone version: 2.23.0
BugPattern: InstanceOfAndCastMatchWrongType
Stack Trace:
java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.isPrimitive()" because "t" is null
The snippet on which it failed looks like:
if(bazinstanceofFoo.Bar.Baz(Stringtext, Localelocale, Charsetcharset)) {
Some.staticMethod((Foo.Bar.Baz) baz, unrelated); // <-- NullPointerException on this line
}
where Foo is an enum, Bar a sealed interface and Baz a record that implements Bar.
Activity
anthonyvdotbe commentedon May 31, 2024
@graememorgan I believe this requires an equivalent fix as what you did for #4349
Fix NPE in InstanceOfAndCastMatchWrongType.
Fix NPE in InstanceOfAndCastMatchWrongType.
cushon commentedon Feb 5, 2026
Fixed in 376b9d6