Browse Source

Polish contribution

See gh-30282
pull/30420/head
Sam Brannen 3 years ago
parent
commit
2d1ddbb65c
  1. 8
      spring-core/src/main/java/org/springframework/util/ClassUtils.java
  2. 6
      spring-core/src/main/java/org/springframework/util/TypeUtils.java

8
spring-core/src/main/java/org/springframework/util/ClassUtils.java

@ -43,7 +43,8 @@ import org.springframework.lang.Nullable; @@ -43,7 +43,8 @@ import org.springframework.lang.Nullable;
/**
* Miscellaneous {@code java.lang.Class} utility methods.
* Mainly for internal use within the framework.
*
* <p>Mainly for internal use within the framework.
*
* @author Juergen Hoeller
* @author Keith Donald
@ -532,8 +533,9 @@ public abstract class ClassUtils { @@ -532,8 +533,9 @@ public abstract class ClassUtils {
* type, assuming setting by reflection. Considers primitive wrapper
* classes as assignable to the corresponding primitive types.
* @param lhsType the target type (left-hand side (LHS) type)
* @param rhsType the value type (right-hand side (RHS) type) that should be assigned to the target type
* @return if the target type is assignable from the value type
* @param rhsType the value type (right-hand side (RHS) type) that should
* be assigned to the target type
* @return {@code true} if {@code rhsType} is assignable to {@code lhsType}
* @see TypeUtils#isAssignable(java.lang.reflect.Type, java.lang.reflect.Type)
*/
public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType) {

6
spring-core/src/main/java/org/springframework/util/TypeUtils.java

@ -40,8 +40,10 @@ public abstract class TypeUtils { @@ -40,8 +40,10 @@ public abstract class TypeUtils {
* Check if the right-hand side type may be assigned to the left-hand side
* type following the Java generics rules.
* @param lhsType the target type (left-hand side (LHS) type)
* @param rhsType the value type (right-hand side (RHS) type) that should be assigned to the target type
* @return true if rhs is assignable to lhs
* @param rhsType the value type (right-hand side (RHS) type) that should
* be assigned to the target type
* @return {@code true} if {@code rhsType} is assignable to {@code lhsType}
* @see ClassUtils#isAssignable(Class, Class)
*/
public static boolean isAssignable(Type lhsType, Type rhsType) {
Assert.notNull(lhsType, "Left-hand side type must not be null");

Loading…
Cancel
Save