java.lang.StackOverflowError in Lowering

Bob Foster bobfoster at gmail.com
Wed Jun 22 09:27:29 PDT 2011


On Wed, 22 Jun 2011 10:31:29 -0400 Brian Goetz wrote:

> And for using the one-element-array trick to work around the mutable
> capture restriction, your license to code in Java has been permanently
> revoked.  Please turn in your keyboard, and security will escort you out
> of the building.

Java makes it awkward and tedious to return multiple results from a method
and something equivalent is needed to return even a single result from a
Runnable. Hence, Callable<T>, etc. Programs do need to do that. There are
plenty of use cases where local variable capture is a reasonable choice,
like SwingUtilities.invokeAndWait or CountDownLatch(1). I'm not sure
attitude helps people deal with this issue, though it has certainly helped
Project Lambda not deal with it. :)

Bob


More information about the lambda-dev mailing list