Created
March 7, 2018 05:10
-
-
Save paraya3636/c9fbe1adcee4cea075217ca3983d34ae to your computer and use it in GitHub Desktop.
fixed: WildcardTypeImpl cannot be cast to java.lang.Class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Class<?> resolveClass(Type type) { | |
Class<?> clazz; | |
try { | |
clazz = (Class<?>) type; | |
} catch (ClassCastException e) { | |
Type wildcardType = ((WildcardType) type).getUpperBounds()[0]; | |
clazz = (Class<?>) wildcardType; | |
} | |
return clazz; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment