It's a Spring beans bug, fixed in version >= 3.2.5
Spring injects byte array with one symbol as Byte object
题
I have constant with type byte[] which contains only one symbol { 0 }. I tried to inject this constant to another bean SomeBean which contains method setSomeField(T field) through property tag.
Type of injected value is parametrized.
I tried to inject this constant through util:constant and got Byte type instead of byte[]. Then I tried to use factory bean with method byte[] getSomeField() and got Byte type again.
Could somebody explain why this happen? And how can I avoid this behavior?
I created repository with demonstration of this issue
解决方案
不隶属于 StackOverflow