Polishing

(cherry picked from commit 91df065)
This commit is contained in:
Juergen Hoeller
2017-04-17 15:05:34 +02:00
parent 9b2f9e655e
commit fd1d8aeeb4
6 changed files with 72 additions and 61 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -1078,10 +1078,10 @@ public abstract class ClassUtils {
}
/**
* Return all interfaces that the given instance implements as array,
* Return all interfaces that the given instance implements as an array,
* including ones implemented by superclasses.
* @param instance the instance to analyze for interfaces
* @return all interfaces that the given instance implements as array
* @return all interfaces that the given instance implements as an array
*/
public static Class<?>[] getAllInterfaces(Object instance) {
Assert.notNull(instance, "Instance must not be null");
@@ -1089,24 +1089,24 @@ public abstract class ClassUtils {
}
/**
* Return all interfaces that the given class implements as array,
* Return all interfaces that the given class implements as an array,
* including ones implemented by superclasses.
* <p>If the class itself is an interface, it gets returned as sole interface.
* @param clazz the class to analyze for interfaces
* @return all interfaces that the given object implements as array
* @return all interfaces that the given object implements as an array
*/
public static Class<?>[] getAllInterfacesForClass(Class<?> clazz) {
return getAllInterfacesForClass(clazz, null);
}
/**
* Return all interfaces that the given class implements as array,
* Return all interfaces that the given class implements as an array,
* including ones implemented by superclasses.
* <p>If the class itself is an interface, it gets returned as sole interface.
* @param clazz the class to analyze for interfaces
* @param classLoader the ClassLoader that the interfaces need to be visible in
* (may be {@code null} when accepting all declared interfaces)
* @return all interfaces that the given object implements as array
* @return all interfaces that the given object implements as an array
*/
public static Class<?>[] getAllInterfacesForClass(Class<?> clazz, ClassLoader classLoader) {
Set<Class<?>> ifcs = getAllInterfacesForClassAsSet(clazz, classLoader);
@@ -1114,10 +1114,10 @@ public abstract class ClassUtils {
}
/**
* Return all interfaces that the given instance implements as Set,
* Return all interfaces that the given instance implements as a Set,
* including ones implemented by superclasses.
* @param instance the instance to analyze for interfaces
* @return all interfaces that the given instance implements as Set
* @return all interfaces that the given instance implements as a Set
*/
public static Set<Class<?>> getAllInterfacesAsSet(Object instance) {
Assert.notNull(instance, "Instance must not be null");
@@ -1125,24 +1125,24 @@ public abstract class ClassUtils {
}
/**
* Return all interfaces that the given class implements as Set,
* Return all interfaces that the given class implements as a Set,
* including ones implemented by superclasses.
* <p>If the class itself is an interface, it gets returned as sole interface.
* @param clazz the class to analyze for interfaces
* @return all interfaces that the given object implements as Set
* @return all interfaces that the given object implements as a Set
*/
public static Set<Class<?>> getAllInterfacesForClassAsSet(Class<?> clazz) {
return getAllInterfacesForClassAsSet(clazz, null);
}
/**
* Return all interfaces that the given class implements as Set,
* Return all interfaces that the given class implements as a Set,
* including ones implemented by superclasses.
* <p>If the class itself is an interface, it gets returned as sole interface.
* @param clazz the class to analyze for interfaces
* @param classLoader the ClassLoader that the interfaces need to be visible in
* (may be {@code null} when accepting all declared interfaces)
* @return all interfaces that the given object implements as Set
* @return all interfaces that the given object implements as a Set
*/
public static Set<Class<?>> getAllInterfacesForClassAsSet(Class<?> clazz, ClassLoader classLoader) {
Assert.notNull(clazz, "Class must not be null");