Petr Masopust
Petr Masopust
Yes, byte buddy version 1.12.9 throws the same exception only with different line: Caused by: java.lang.NullPointerException at net.bytebuddy.description.annotation.AnnotationDescription$ForLoadedAnnotation.(AnnotationDescription.java:657) at net.bytebuddy.description.annotation.AnnotationDescription$ForLoadedAnnotation.of(AnnotationDescription.java:692) at net.bytebuddy.description.annotation.AnnotationList$ForLoadedAnnotations.get(AnnotationList.java:240) at net.bytebuddy.description.annotation.AnnotationList$ForLoadedAnnotations.get(AnnotationList.java:197) at java.base/java.util.AbstractList$Itr.next(AbstractList.java:371) at net.bytebuddy.implementation.attribute.AnnotationAppender$ForTypeAnnotations.ofTypeVariable(AnnotationAppender.java:645) at net.bytebuddy.implementation.attribute.AnnotationAppender$ForTypeAnnotations.ofTypeVariable(AnnotationAppender.java:617)...
openjdk version "11.0.14" 2022-01-18 OpenJDK Runtime Environment (build 11.0.14+9-post-Debian-1deb11u1) OpenJDK 64-Bit Server VM (build 11.0.14+9-post-Debian-1deb11u1, mixed mode, sharing) and openjdk version "11.0.14.1" 2022-02-08 LTS OpenJDK Runtime Environment Zulu11.54+25-CA (build 11.0.14.1+1-LTS)...
I tried extract important part but it worked - it must be influenced by something else in our project. I can't publish it but I'll investigate it further.
Finally found it. grpc libraries have checkerframework (checkerframework.org) as their dependency. After exclusion (i.e. exclude group: 'org.checkerframework') everything works without NPE again. You may want investigate it deeper but for...
I can't replicate it with recent versions of bytebuddy and checkerframework, i.e. mocking works as it should.