-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Chris Beams opened SPR-8184 and commented
See AbstractAutowireCapableBeanFactory.setParameterNameDiscoverer
I ran into some pretty unintuitive error messages today while trying to use <constructor-arg name="..." =ref="..."/> syntax for constructor argument disambiguation.
I was doing this in a unit test that uses only an XmlBeanFactory as opposed to a full ApplicationContext.
I was surprised to see that it didn't work, and after a little investigation, I realized that there is no default ParameterNameDiscoverer if you're using just a BeanFactory.
The javadoc states that there is no default in order to avoid a dependency on ASM. Why is this important, given that .beans depends on core and .core depends on .asm?
It's true that there is no instance of a direct dependency on org.springframework.asm.* from any code in org.springframework.beans.*, yet at the same time the .beans ivy.xml does have a required compile-time dependency on .asm.
Perhaps this avoidance of .asm deps from .beans is just outdated? If so, I can add an issue that documents the strange error, and then simply set a default for the parameterNameDiscoverer property in AbstractAutowireCapabaleBeanFactory and be done with it.
Attachments:
- mylyn-context.zip (2.87 kB)
Referenced from: commits 4fc386a