Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.3.0, 4.4.0, 4.5.0
-
None
-
Unknown
Description
Originally reported here:
If you use @PropertyInject like:
public class Foo { @PropertyInject(value = "1") private Integer bar; }
Then you get an exception like:
java.lang.UnsupportedOperationException: Cannot inject value of class: class java.lang.Integer into: private java.lang.Integer
The original exception is swallowed, but it's something like:
IllegalArgumentException: Can not set java.lang.Integer field to int(1)
You can't use Field.setInt etc where the field type is not a primitive. You have to use Field.set in that case.
https://docs.oracle.com/javase/tutorial/reflect/member/fieldTrouble.html
Maybe it's related to this change:
https://github.com/apache/camel/commit/df19aec009164ba821c60518651dfc5eda3aee7d