Why is it not possible to call configure on PrivateModule multiple times? #1791
Unanswered
JanSkalicky-SF
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'd like to ask why is it not possible to call configure on PrivateModule multiple times? I wrote config resolution using Guice and I have a problem using it. My idea was, that I analyse modules, find all occurrences of our custom annotation in bindings and bind appropriate pieces of configuration to those bindings. When I use Elements.getElements(modules) to list all bindings, configure is called on modules which is fine. The problem appears in PrivateElementsImpl, where there are two fields (elementsMutable, exposureBuilders) which are set to null after first access to them. When configure is called second time from injector, these fields are set to null and therefore I get NullReferenceException.
Is there any reason why is it set to null? If new array is assigned, everything will work nicely.
Beta Was this translation helpful? Give feedback.
All reactions