Unassignable injection point type in XML application context
Reports invalid injection point types (properties and constructor arguments).
The following injection point types are allowed: ref
, idref
, any collection type, inner beans, and so on.
Example:
public class InjectionValueTypes{
public List<MyBean> setListBeans() {...}
public MyBean setMyBean() {...}
}
}
<beans>
<bean class="MyBean" id="myBean"/>
<bean class="ErrTypeBean" id="errTypeBean"/>
<bean class="InjectionValueTypes" id="kt">
<property name="myBean" ref="errTypeBean"/>
<!-- reports "Property of 'MyBean' type cannot be injected by 'ErrTypeBean'" -->
<property name="listBeans">
<list>
<idref local="myBean"/>
<ref bean="myBean"/>
<ref bean="errTypeBean"/> <!-- reports "Cannot be added in collection of 'MyBean' type" -->
<bean class="ErrTypeBean"/> <!-- reports "Bean must be of 'MyBean' type" -->
</list>
</property>
</bean>
</beans>
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Spring, 233.SNAPSHOT |
Last modified: 13 July 2023