Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Constructor injection fix #84

Merged
merged 2 commits into from
Feb 15, 2013

Conversation

chwthewke
Copy link

I found an issue in constructor injection where some dependencies would surprisingly be injected as null when recursively applying ConstructorInjectionPoint injection.

This was caused by the use of a private static const _parameterValues: Array in MethodInjectionPoint.as.

A first commit has a new test to help ascertain that this is a reasonable use case. The test fails at that revision.

The second commit changes MethodInjectionPoint.as to make the test pass.

A class with several dependencies injected through its constructor
fails to receive the first dependency if the second one is
constructor-injected and has at least one dependency.
The global Array _parameterValues was incorrectly shared between
reentrant calls to MethodInjectionPoint.applyInjection, thus losing
some dependencies for injection.
@darscan
Copy link
Contributor

darscan commented Feb 3, 2013

I have bumped into this myself.

tschneidereit added a commit that referenced this pull request Feb 15, 2013
@tschneidereit tschneidereit merged commit ee87749 into tschneidereit:master Feb 15, 2013
@tschneidereit
Copy link
Owner

Urgh, what an embarrassing bug! Thanks a lot for fixing it. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants