util:constant can't read static inner enums [SPR-5210] #9883
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Gert-Jan Schouten opened SPR-5210 and commented
If I have this code:
public enum AccountLevel {
}
then I can put this in my spring config:
<util:constant static-field="AccountLevel.NORMAL" />
Everything works fine. But if I have this code:
public class Account {
}
then I cannot do this:
<util:constant static-field="Account.Level.NORMAL" />
I have been thinking about this and came to the conclusion that this is impossible, because my inner enum is not static: You need an instance of Account, before you can have an Account.Level (just like inner classed), so I changed my code and made the enum static:
public class Account {
}
But this:
<util:constant static-field="Account.Level.NORMAL" />
still does not work! Why? It should work, I think...
Affects: 2.5.5
Referenced from: commits eb1631f
The text was updated successfully, but these errors were encountered: