GH-1052 - ApplicationModuleSource now uses JavaPackage.findAnnotation(…).

This is to make sure that marker types annotated with @PackageInfo are considered, too. Deprecate JavaPackage.getAnnotation(…) as it's not used anywhere anymore and we would like to consistently consider package info marker types when looking up package annotations.
This commit is contained in:
Oliver Drotbohm
2025-02-23 21:40:54 +01:00
parent cd36bd7ac8
commit bf0c07e222
5 changed files with 54 additions and 17 deletions

View File

@@ -53,7 +53,7 @@ class JavaPackageUnitTests {
void findsAnnotationOnPackageInfo() {
var annotation = JavaPackage.of(Classes.of(PKG_CLASSES), "pkg.onpackage") //
.getAnnotation(ApplicationModule.class);
.findAnnotation(ApplicationModule.class);
assertThat(annotation).hasValueSatisfying(it -> {
assertThat(it.displayName()).isEqualTo("onPackage");