Consistently use class literals for primitive types

To improve consistency and avoid confusion regarding primitive types
and their wrapper types, this commit ensures that we always use class
literals for primitive types.

For example, instead of using the `Void.TYPE` constant, we now
consistently use `void.class`.
This commit is contained in:
Sam Brannen
2024-01-30 15:15:47 +01:00
parent 95a3f3bb6e
commit db535863dd
33 changed files with 231 additions and 231 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -94,7 +94,7 @@ class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware {
@Override
public Object convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType) {
if (targetType.getType() == Void.class || targetType.getType() == Void.TYPE) {
if (targetType.getType() == Void.class || targetType.getType() == void.class) {
return null;
}
if (conversionService.canConvert(sourceType, targetType)) {