TypeToken is not available on old Guava.

This commit is contained in:
sk89q 2015-01-17 19:26:33 -08:00
parent 520f9e3fcf
commit fdddb17d2f

View File

@ -70,10 +70,10 @@ public SchedulerReport() {
@SuppressWarnings("unchecked")
@Nullable
private Class<?> getTaskClass(BukkitTask task) {
try {
Class<?> clazz = task.getClass();
Set<Class<?>> classes = (Set) TypeToken.of(clazz).getTypes().rawTypes();
try {
for (Class<?> type : classes) {
Optional<Field> field = taskFieldCache.getUnchecked(type);
if (field.isPresent()) {
@ -81,6 +81,7 @@ private Class<?> getTaskClass(BukkitTask task) {
}
}
} catch (IllegalAccessException ignored) {
} catch (NoClassDefFoundError ignored) {
}
return null;