Allow to inject enum with package visibility [SPR-16284] #20831
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
Hans Desmet opened SPR-16284 and commented
A class with package visibility can be injected in a bean.
An enum can only be injected if it has public visibility.
Given a class
an enum
a bean class
and following bean definition:
you get an exception:java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'enumproblem.MyEnum': no matching editors or conversion strategy found
When you change the visibility of the enum to public, the exception dissapears.
Affects: 5.0.2
Reference URL: https://github.com/desmethans/enumproblem1.git
Issue Links:
Referenced from: commits 4bb8375, 9beb978
Backported to: 4.3.14
The text was updated successfully, but these errors were encountered: