Repository navigation
Closed as duplicate
Description
Hi, when trying to upgrade Spring Framework from NullAway 0.12.7 to 0.12.8, I get the following error even if I use the recommended Error Prone version 2.39.0. Same error happen with 2.41.0.
/Users/sdeleuze/workspace/spring-framework/spring-web/src/main/java/org/springframework/http/client/SubscriberInputStream.java:332: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
this.available = Objects.requireNonNull(this.mapper.apply(buffer));
^
Please report this at https://github.com/google/error-prone/issues/new and include the following:
error-prone version: 2.39.0
BugPattern: NullAway
Stack Trace:
java.lang.ClassCastException: class com.sun.tools.javac.code.Type$TypeVar cannot be cast to class com.sun.tools.javac.code.Type$ArrayType (com.sun.tools.javac.code.Type$TypeVar and com.sun.tools.javac.code.Type$ArrayType are in module jdk.compiler of loader 'app')
at com.uber.nullaway.generics.CheckIdenticalNullabilityVisitor.visitArrayType(CheckIdenticalNullabilityVisitor.java:94)
at com.uber.nullaway.generics.CheckIdenticalNullabilityVisitor.visitArrayType(CheckIdenticalNullabilityVisitor.java:16)
at jdk.compiler/com.sun.tools.javac.code.Type$ArrayType.accept(Type.java:1375)
at com.uber.nullaway.generics.GenericsChecks.identicalTypeParameterNullability(GenericsChecks.java:615)
at com.uber.nullaway.generics.GenericsChecks.subtypeParameterNullability(GenericsChecks.java:647)
at com.uber.nullaway.generics.GenericsChecks.checkTypeParameterNullnessForAssignability(GenericsChecks.java:456)
at com.uber.nullaway.NullAway.matchAssignment(NullAway.java:526)
at com.google.errorprone.scanner.ErrorProneScanner.processMatchers(ErrorProneScanner.java:509)
You should be able to reproduce with:
git clone https://github.com/sdeleuze/spring-framework.git
git checkout nullaway-0-12-8-regression
./gradlew build -x test
Metadata
Metadata
Assignees
Labels
No labels
Activity
msridhar commentedon Aug 18, 2025
Reproduced; thanks for the report. I think this is a duplicate of #1238 which has been fixed on the master branch by #1240. @sdeleuze would it be helpful to you if we cut a bug-fix release for this crash?
sdeleuze commentedon Aug 18, 2025
Yep, it would be very useful if possible!
msridhar commentedon Aug 18, 2025
@sdeleuze we just cut NullAway 0.12.9 and your repro command succeeds with that release. Let us know if it doesn't work for you. Thanks!
sdeleuze commentedon Aug 19, 2025
NullAway 0.12.9 works as expected and allow Spring Framework green build, thanks!