null-guard

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1525740 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Jason Benson 2013-09-23 23:43:13 +00:00
parent 76fd4f1e72
commit 9ad1a4df47
1 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@ -1261,6 +1262,9 @@ public class TypeUtils {
* @return Type
*/
public static Type unrollVariables(Map<TypeVariable<?>, Type> typeArguments, final Type type) {
if (typeArguments == null) {
typeArguments = Collections.<TypeVariable<?>, Type> emptyMap();
}
if (containsTypeVariables(type)) {
if (type instanceof TypeVariable<?>) {
return unrollVariables(typeArguments, typeArguments.get(type));