We have missed updating
org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor#isOptionalParameter
. This also checks for Spring Framework's@Nullable
. Problem here is that we can't rely onNullness
, as the annotation processor has no dependencies.
Originally posted by @mhalbritter in #46593
Comment From: mhalbritter
This will trigger the annotation type use bug in the JDK, which is only fixed in JDK 24 right now.
@sdeleuze said:
to get TYPE_USE annotations discovered I did:
AnnotationMirror getAnnotation(Element element, String type) {
if (element != null) {
for (AnnotationMirror annotation : element.getAnnotationMirrors()) {
if (type.equals(annotation.getAnnotationType().toString())) {
return annotation;
}
}
for (AnnotationMirror annotation : element.asType().getAnnotationMirrors()) {
if (type.equals(annotation.getAnnotationType().toString())) {
return annotation;
}
}
}
return null;
}
Comment From: wonyongg
Hi, I’ve read through this issue and thought it would be a good opportunity to contribute, so I opened a pull request that attempts to address it.
I would be very grateful if you could give me the chance to contribute here. If there are any problems with the PR, please feel free to let me know — I’ll be happy to update it accordingly!