When I run this code fragment, neither side is taken.
if (Boolean.class.isAssignableFrom(boolean.class)) {
uLog.error("Boolean is => boolean");
}
if (boolean.class.isAssignableFrom(Boolean.class)) {
uLog.error("boolean is <= Boolean");
}
Specifically, I’m trying to test the paramter types using reflection:
Type[] pType = m.getGenericParameterTypes();
and I can’t figure out the proper test for boolean parameters.
The type of built-in
booleanis represented byBoolean.TYPE. Sincebooleancannot be inherited, you do not needisAssignableFrom: you can simply check the type in question for equality toBoolean.TYPEto see if the type of a parameter is built-inboolean.