Use Java 8 lambdas instead of anonymous classes in compiler modules

This commit is contained in:
Alexander Udalov
2017-04-01 01:37:15 +03:00
parent 6aa0f7bb65
commit 5ebee6ceca
109 changed files with 1528 additions and 2754 deletions
@@ -17,7 +17,6 @@
package org.jetbrains.kotlin.resolve.scopes;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.descriptors.PropertyDescriptor;
@@ -35,14 +34,11 @@ public final class ScopeUtils {
return new LexicalScopeImpl(parent, propertyDescriptor, false, null, LexicalScopeKind.PROPERTY_HEADER,
// redeclaration on type parameters should be reported early, see: DescriptorResolver.resolvePropertyDescriptor()
LocalRedeclarationChecker.DO_NOTHING.INSTANCE,
new Function1<LexicalScopeImpl.InitializeHandler, Unit>() {
@Override
public Unit invoke(LexicalScopeImpl.InitializeHandler handler) {
for (TypeParameterDescriptor typeParameterDescriptor : propertyDescriptor.getTypeParameters()) {
handler.addClassifierDescriptor(typeParameterDescriptor);
}
return Unit.INSTANCE;
handler -> {
for (TypeParameterDescriptor typeParameterDescriptor : propertyDescriptor.getTypeParameters()) {
handler.addClassifierDescriptor(typeParameterDescriptor);
}
return Unit.INSTANCE;
});
}