Service lookups answer from an index the catalog builds once per type instead of filtering every registration per call; a type's @Service annotation is read once

This commit is contained in:
piexel committed 2026-10-10 14:46:07 +02:00
1 parent d7de5939d7
commit b39c750e26
3 files changed
+56 -20

No files matched your search

@@ -395,6 +395,11 @@ class ModuleRegistryTest {
var several = assertThrows(IllegalArgumentException.class, () -> catalog.service(Greeting.class));
assertTrue(several.getMessage().contains("services(...)"), several.getMessage());
assertThrows(IllegalArgumentException.class, () -> catalog.services(NotAService.class));
assertThrows(IllegalArgumentException.class, () -> catalog.registrations(NotAService.class), "asking again still refuses it");
assertEquals(List.of(alphaFirst, alphaSecond, zeta),
catalog.registrations(Greeting.class).stream().map(ServiceRegistration::provider).toList());
assertEquals(List.of(), catalog.registrations(Clock.class));
assertThrows(UnsupportedOperationException.class, () -> catalog.services(Greeting.class).clear(), "the catalog is frozen");
}
@Test