Fix TypeDescriptors.isBoxedType() and TypeDescriptors.isNonVoidPrimitiveType().
Those two method should return false for `java.lang.Void` and `void` respectively but didn't.
@@ -138,11 +138,13 @@ public class TypeDescriptors {
public static boolean isBoxedType(TypeDescriptor typeDescriptor) {
return get()
.boxedTypeByPrimitiveType
- .containsValue(typeDescriptor.toRawTypeDescriptor().toNullable());
+ .containsValue(typeDescriptor.toRawTypeDescriptor().toNullable())
+ && !isJavaLangVoid(typeDescriptor);
}
public static boolean isNonVoidPrimitiveType(TypeDescriptor typeDescriptor) {
- return get().boxedTypeByPrimitiveType.containsKey(typeDescriptor.toRawTypeDescriptor());
+ return get().boxedTypeByPrimitiveType.containsKey(typeDescriptor.toRawTypeDescriptor())
+ && !isPrimitiveVoid(typeDescriptor);
}
public static boolean isBoxedBooleanOrDouble(TypeDescriptor typeDescriptor) {
