GH-1082 - 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 0ddb72bc97
commit f61e7d91a0
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");