You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems there is an issue with ClassUtils.isAssignable and primitive/wrapper types:
Boolean b1 = true; // boolean is assignable to Boolean
boolean b2 = Boolean.TRUE; // Boolean is assignable to boolean
assertTrue(ClassUtils.isAssignable(boolean.class, Boolean.class));
assertTrue(ClassUtils.isAssignable(Boolean.class, boolean.class)); //Fail
I think the fix in ClassUtils would be:
public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType) {
Assert.notNull(lhsType, "Left-hand side type must not be null");
Assert.notNull(rhsType, "Right-hand side type must not be null");
return (lhsType.isAssignableFrom(rhsType) ||
lhsType.equals(primitiveWrapperTypeMap.get(rhsType)) ||
rhsType.equals(primitiveWrapperTypeMap.get(lhsType)));
}
Julien HENRY opened SPR-7610 and commented
It seems there is an issue with ClassUtils.isAssignable and primitive/wrapper types:
I think the fix in ClassUtils would be:
Affects: 3.0.3
Referenced from: commits d9b54a5
The text was updated successfully, but these errors were encountered: