Fix detection of JSpecify annotations on parameters

See gh-28797
This commit is contained in:
Sébastien Deleuze
2025-01-03 17:29:49 +01:00
parent f136e27ccf
commit 57c0d95007
2 changed files with 25 additions and 7 deletions

View File

@@ -412,7 +412,8 @@ public class MethodParameter {
return true;
}
}
for (AnnotatedType annotatedType : this.executable.getAnnotatedParameterTypes()) {
if (this.parameterIndex >= 0) {
AnnotatedType annotatedType = this.executable.getAnnotatedParameterTypes()[this.parameterIndex];
for (Annotation ann : annotatedType.getAnnotations()) {
if ("Nullable".equals(ann.annotationType().getSimpleName())) {
return true;