commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1525740 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
Date Mon, 23 Sep 2013 23:43:14 GMT
Author: mbenson
Date: Mon Sep 23 23:43:13 2013
New Revision: 1525740

URL: http://svn.apache.org/r1525740
Log:
null-guard

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java?rev=1525740&r1=1525739&r2=1525740&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
Mon Sep 23 23:43:13 2013
@@ -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));



Mime
View raw message