Closed
Description
AnnotationBasedPersistentProperty.validateAnnotation NullPointerException on project-specific annotations.
<groupId>org.springframework.data.build</groupId>
<artifactId>spring-data-parent</artifactId>
<version>2.6.0-SNAPSHOT</version>
I hit this when running the tests of spring-data-couchbase project with JDK11 and adding a java-module.java. I assume there is some sort of introspection failure.
mergedAnnotation passed into validateAnnotation and the NPE occurs when candidate is dereferenced.
It's the .orElse((Object)null) that gets returned.
return !AnnotationFilter.PLAIN.matches(annotationType) && !AnnotationsScanner.hasPlainJavaAnnotationsOnly(element) ? (Annotation)getAnnotations(element).get(annotationType, (Predicate)null, MergedAnnotationSelectors.firstDirectlyDeclared()).synthesize(MergedAnnotation::isPresent).orElse((Object)null) : element.getDeclaredAnnotation(annotationType);