|
|
|
|
@ -28,16 +28,7 @@ import java.lang.reflect.ParameterizedType;
@@ -28,16 +28,7 @@ import java.lang.reflect.ParameterizedType;
|
|
|
|
|
import java.lang.reflect.Type; |
|
|
|
|
import java.lang.reflect.TypeVariable; |
|
|
|
|
import java.lang.reflect.WildcardType; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.HashSet; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.Set; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
@ -61,14 +52,10 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
@@ -61,14 +52,10 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
|
|
|
|
|
|
|
|
|
static { |
|
|
|
|
|
|
|
|
|
ClassLoader classLoader = TypeDiscoverer.class.getClassLoader(); |
|
|
|
|
|
|
|
|
|
Set<Class<?>> mapTypes = new HashSet<>(); |
|
|
|
|
mapTypes.add(Map.class); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
mapTypes.add(ClassUtils.forName("javaslang.collection.Map", classLoader)); |
|
|
|
|
} catch (ClassNotFoundException o_O) {} |
|
|
|
|
tryToAddClassTo("javaslang.collection.Map", mapTypes); |
|
|
|
|
tryToAddClassTo("io.vavr.collection.Map", mapTypes); |
|
|
|
|
|
|
|
|
|
MAP_TYPES = mapTypes.toArray(new Class[0]); |
|
|
|
|
} |
|
|
|
|
@ -569,6 +556,19 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
@@ -569,6 +556,19 @@ class TypeDiscoverer<S> implements TypeInformation<S> {
|
|
|
|
|
return hashCode; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Tries to load the class with the given name and adds it to the given {@link Set} of classes if present. |
|
|
|
|
* |
|
|
|
|
* @param className must not be {@literal null} or empty. |
|
|
|
|
* @param classes must not be {@literal null}. |
|
|
|
|
*/ |
|
|
|
|
private static final void tryToAddClassTo(String className, Set<Class<?>> classes) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
classes.add(ClassUtils.forName(className, TypeDiscoverer.class.getClassLoader())); |
|
|
|
|
} catch (ClassNotFoundException o_O) {} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* A synthetic {@link ParameterizedType}. |
|
|
|
|
* |
|
|
|
|
|