Closed scottydelicious closed 10 years ago
ReflectionHelper tries to determine method argument types from supplied values. This is impossible in three cases. ReflectionHelper contains static helper methods that allow to supply additional type data:
nullValue(Class<?>)
typed(Object, Class<?>)
primitive(...)
(overloaded for primitive types, not for all though)
I am implementing IPeripheralAdapter and using ReflectionHelper to call a method in a tile entity. The tile entity expects a raw boolean primitive, but before calling the method, ReflectionHelper converts the boolean into a Boolean Object and the method call in the entity fails.
Is there a way I can force ReflectionHelper to send the primitive instead of an Object, or should I implement the java reflection manually myself?