[MAGNOLIA-8103] Multibinding IoC fails when no implementations are declared Created: 26/May/21  Updated: 26/Aug/21  Resolved: 26/Aug/21

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 6.2.9, 6.3.0
Fix Version/s: 6.2.10, 6.3.0

Type: Bug Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Documentation update required:
Yes
Date of First Response:

 Description   

Steps to reproduce

Define a multibinding interface Foo, map no implementations, try to inject Set<Foo> somewhere.

Expected results

Empty set injected

Actual results

Guice injection failure.

Development notes

This happens due to "lazy" registration of multi-binding interfaces: we invoke Guice.newSetMultibinder() only while registering an actual implementation of an interface. This is all due to the lack of specific syntax that would let us declare the presence of such interface itself. The attached PR suggests to add such syntax.


Generated at Mon Feb 12 04:29:40 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.