Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding multiple modules causes the submodule to be configured twice #258

Closed
andrus opened this issue Mar 13, 2019 · 0 comments
Closed
Labels
Milestone

Comments

@andrus
Copy link
Contributor

andrus commented Mar 13, 2019

The following setup creates an injector where one module overrides different services in more than module:

Bootique.app(args)
                .module(M1.class)
                .module(M2.class)
                .override(M1.class, M2.class).with(M3.class)
                .createInjector();

While this works from the service assembly perspective, this causes M3.configure to be called twice (or rather N times, one time for each module it overrides). If configure defines its own services, they are loaded twice, causing exceptions.

The same issue happens if the modules are loaded via providers (as opposed to loaded explicitly per example above). One M3 instance is created, but its configure is called multiple times.

@andrus andrus added the bug label Mar 13, 2019
@andrus andrus added this to the 1.0.RC2 milestone Mar 14, 2019
andrus added a commit that referenced this issue Mar 14, 2019
andrus added a commit that referenced this issue Mar 14, 2019
@andrus andrus closed this as completed Mar 14, 2019
andrus added a commit that referenced this issue Mar 14, 2019
andrus added a commit that referenced this issue Mar 14, 2019
#258

* stop using wildcard imports. This conflicts with java.lang.Module in Java 10/11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant