return(list);
}
catch (NoSuchMethodException | IllegalAccessException | InstantiationException e)
{
throw new PreferencesException("Cannot instantiate list of type " + listType + ".", e);
}
catch (InvocationTargetException e)
{
if (e.getCause() instanceof RuntimeException)
throw ((RuntimeException)e.getCause());
else if (e.getCause() instanceof Error)
throw ((Error)e.getCause());
else if (e.getCause() instanceof PreferencesException)
throw ((PreferencesException)e.getCause());
else
throw new PreferencesException("Cannot instantiate list of type " + listType + ".", e.getCause());
}
}
else
throw new PreferencesException("Cannot instantiate list of type " + listType + " since it cannot be instantiated.");
}