Recently i came across a "strange" Spring behaviour which i do not know if it is the expected behavior or a bug.
I have two spring files:
FileA.xml
<bean id="AbstractParent" class="com.classes.MyAbstractClass" abstract="true"/>
<bean id="ConcreateChild parent="AbstractParent" />
FileB.xml
<import resource="FileA.xml"/>
<bean id="AnotherChild" parent="AbstractParent" />
<bean id="ConcreateChild" parent="AnotherChild"/>
I also have two different objects(which implement BeanNameAware) that have a reference to "ConcreateChild". I was expecting that both objects will have a reference to the same ConcreateChild object. But this is not the case.
When i debug and try to see the BeanName one reference is giving me "ConcreateChild" (as expected) but the other "AnotherChild".
Does anyone know if this is expected? I would expect the same reference to "ConcreateChild" always.
Couldn't find any answers or explanation in Spring documentation thus i posted here.
Thanks.