Do Java8 lambdas maintain a reference to their enclosing instance like anonymous classes?

Lambda expressions and method references capture a reference to this only if required, i.e. when this is referenced directly or an instance (non-static) member is accessed. Of course, if your lambda expression captures the value of a local variable and that value contains a reference to this it implies referencing this as well…

Retrolambda: Lint crashes when using lambda expressions with retrolambda

You can use a special lombok version with lint which does not whine about Java 8 features. buildscript { repositories { jcenter() … } dependencies { classpath ‘com.android.tools.build:gradle:<version>’ classpath ‘me.tatarka:gradle-retrolambda:<version>’ classpath ‘me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2’ } // Exclude the version that the android plugin depends on. configurations.classpath.exclude group: ‘com.android.tools.external.lombok’ } This way you can keep running lint on … Read more