Primitives in Generics (+ the meaning of this)

Joshua Bloch jjb at
Fri Jul 16 09:27:26 PDT 2010


On Fri, Jul 16, 2010 at 8:28 AM, Peter Levart <peter.levart at>wrote:

> Regardless of that, do you aggree that the statistical evidence, prepared
> by some members of this list, showed that usage of explicit and implicit
> "this" inside anonymous inner SAM subclass creation expressions is
> practically non-existent and is actualy "in the way" of using outer.this
> and/or outer instance members (even a cause of bugs in JDK itself)?

I don't remember the details of the statistical evidence, but it seems
suspect. It's not uncommon for periodic TimerTasks to cancel themselves or
(as illustrated in the TimerTask documentation) to call their own
scheduledExecutionTime()method from their single abstract method (run). It
may be the case that it's much more common to want to access enclosing
instances, but I don't believe that intentional access to the function
object from within its body is "practically non-existent."


P.S. It took me ten seconds of searching to find this example:

More information about the lambda-dev mailing list