You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @ragavsathish,
I just stumbled over this as well. I checked your commits. I thought about setting the isInitialized as well. But while writing a test for it I thought of this:
The createApplication is only calling the getBean function to get the bean AND create the application. The init function of the bean factory is public though. So I was wondering whether:
the init function should be private - that would make your solution save as well
or whether to remove the call to init from getBean and explicitly call init from outside (createApplication). Then I would suggest putting the check for one execution into the init function and throw an error if there was another call.
I personally think the second solution is cleaner. What are your thoughts about it? I plan on preparing a commit later.
Edit:
I think the expose-BeanFactory script should be on another PR as it has nothing to do with this issue.
BeanFactory.getBean initializes dependency graph every time and creates new instance whenever asked for new bean.
The text was updated successfully, but these errors were encountered: