Similar to #4167
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(baz instanceof Foo.Bar.Baz(String text, Locale locale, Charset charset)) {
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.