Skip to content

Instantly share code, notes, and snippets.

@paraya3636
Created March 7, 2018 05:10
Show Gist options
  • Save paraya3636/c9fbe1adcee4cea075217ca3983d34ae to your computer and use it in GitHub Desktop.
Save paraya3636/c9fbe1adcee4cea075217ca3983d34ae to your computer and use it in GitHub Desktop.
fixed: WildcardTypeImpl cannot be cast to java.lang.Class
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