You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For historical reasons, people have been using the non-standard practice of wrapping checked exceptions in UTE from inside a Function implementation. We can change these existing users to using AsyncFunction which allows checked exceptions to be thrown.
Earlier discussion:
Where is it specified that Function implementations should wrap checked exceptions in UTE? UTE is from java.lang.reflect package, so it's surprising to me to see us special-casing UTE in Future utility.
I think that this is the specification here :) Probably it applies only to this method and not to Function in general, and likely it was intended to be somewhere more... visible :)
People do appear to be taking advantage of the feature, as demonstrated by a search for files containing both "new UndeclaredThrowableException" and "com.google.common.util.concurrent.Futures."
It's an odd feature, though, and it might be wise to convert them to AsyncFunctions. Their computations won't necessarily be asynchronous, but AsyncFunction is allowed to throw any kind of exception, making UndeclaredThrowableException unnecessary.
The text was updated successfully, but these errors were encountered:
It's something that I would like to see happen but never have been able to justify. I assume that you're interested because it lets you remove the GWT emulation of UndeclaredThrowableException? If nothing else, I can float this in front of future 20%ers (and add it to my ever-growing list of "quick tasks" for myself, but that probably won't accomplish much :)).
How much does removing the type buy you? I could try to bump it up if there's a big win.
Original issue created by cpovirk@google.com on 2013-09-30 at 04:19 PM
For historical reasons, people have been using the non-standard practice of wrapping checked exceptions in UTE from inside a Function implementation. We can change these existing users to using AsyncFunction which allows checked exceptions to be thrown.
Earlier discussion:
People do appear to be taking advantage of the feature, as demonstrated by a search for files containing both "new UndeclaredThrowableException" and "com.google.common.util.concurrent.Futures."
It's an odd feature, though, and it might be wise to convert them to AsyncFunctions. Their computations won't necessarily be asynchronous, but AsyncFunction is allowed to throw any kind of exception, making UndeclaredThrowableException unnecessary.
The text was updated successfully, but these errors were encountered: