This code compiles without an error:
private FutureTask<MessageSource> loadingTask(final Locale locale)
{
return new FutureTask<MessageSource>(new Callable<MessageSource>()
{
@Override
public MessageSource call()
throws IOException
{
return loader.load(locale);
}
});
}
But the Callable
interface defines this:
public V call()
throws Exception;
How come I can declare that my override throws IOException
?
Note: I have already seen, and exploited that, with Guava's CacheLoader
for instance.