3 ms·
A class named 'HttpRequestInitializer' and taking 10 lines to set a timeout on a HTTP request isn't merely hypothetical: https://developers.google.com/api-clien
by michaelt 5y ago
A class named 'HttpRequestInitializer' and taking 10 lines to set a timeout on a HTTP request isn't merely hypothetical: https://developers.google.com/api-client-library/java/google-api-java-client/errors#timeouts https://developers.google.com/api-client-library/java/google... - and that's not counting any import statements.
(although getDefaultTimeoutFromEnvironment was artistic license on my part)
- contravariant 5y agoTrue, but like I said that doesn't make it not silly. Just harder to fix. Edit: Also, overriding a class method dynamically inside a function? I usually program python these days and even I think that's wild.
- _ea1k 5y agoIts an interface with only method. I suspect that most of us would just us a lambda now.
- contravariant 5y agoI'll never quite understand why it wasn't simply a function in the first place.
- dtech 5y agoJava pre-8 only had anonymous classes, there were no lambdas
- fiddlerwoaroof 5y agoAnd Java lambdas are still syntax sugar for one-method anonymous classes.