Remove redundant type arguments for Java 8+ in compiler modules

This commit is contained in:
Alexander Udalov
2017-04-01 02:39:10 +03:00
parent d440f07111
commit 78e278ec4c
56 changed files with 104 additions and 128 deletions
@@ -208,11 +208,7 @@ public class FunctionCodegen {
getThrownExceptions(functionDescriptor, typeMapper));
if (CodegenContextUtil.isImplClassOwner(owner)) {
v.getSerializationBindings().put(
METHOD_FOR_FUNCTION,
CodegenUtilKt.<FunctionDescriptor>unwrapFrontendVersion(functionDescriptor),
asmMethod
);
v.getSerializationBindings().put(METHOD_FOR_FUNCTION, CodegenUtilKt.unwrapFrontendVersion(functionDescriptor), asmMethod);
}
generateMethodAnnotations(functionDescriptor, asmMethod, mv);
@@ -1031,7 +1031,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
}
else if (constructor.hasBody() && !(constructor instanceof KtSecondaryConstructor && !((KtSecondaryConstructor) constructor).hasImplicitDelegationCall())) {
KtBlockExpression bodyExpression = constructor.getBodyExpression();
List<KtExpression> statements = bodyExpression != null ? bodyExpression.getStatements() : Collections.<KtExpression>emptyList();
List<KtExpression> statements = bodyExpression != null ? bodyExpression.getStatements() : Collections.emptyList();
if (!statements.isEmpty()) {
codegen.markStartLineNumber(statements.iterator().next());
}
@@ -20,7 +20,6 @@ import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.psi.PsiElement;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.backend.common.CodegenUtil;
@@ -60,7 +59,10 @@ import org.jetbrains.kotlin.storage.LockBasedStorageManager;
import org.jetbrains.kotlin.storage.NotNullLazyValue;
import org.jetbrains.kotlin.types.ErrorUtils;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.org.objectweb.asm.*;
import org.jetbrains.org.objectweb.asm.Label;
import org.jetbrains.org.objectweb.asm.MethodVisitor;
import org.jetbrains.org.objectweb.asm.Opcodes;
import org.jetbrains.org.objectweb.asm.Type;
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
import org.jetbrains.org.objectweb.asm.commons.Method;
@@ -450,8 +452,7 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
private SimpleFunctionDescriptorImpl createClInitFunctionDescriptor(@NotNull DeclarationDescriptor descriptor) {
SimpleFunctionDescriptorImpl clInit = SimpleFunctionDescriptorImpl.create(descriptor, Annotations.Companion.getEMPTY(),
Name.special("<clinit>"), SYNTHESIZED, KotlinSourceElementKt.toSourceElement(element));
clInit.initialize(null, null, Collections.<TypeParameterDescriptor>emptyList(),
Collections.<ValueParameterDescriptor>emptyList(),
clInit.initialize(null, null, Collections.emptyList(), Collections.emptyList(),
DescriptorUtilsKt.getModule(descriptor).getBuiltIns().getUnitType(),
null, Visibilities.PRIVATE);
return clInit;
@@ -60,7 +60,7 @@ public class ScriptCodegen extends MemberCodegen<KtScript> {
List<ScriptDescriptor> earlierScripts = state.getReplSpecific().getEarlierScriptsForReplInterpreter();
ScriptContext scriptContext = parentContext.intoScript(
scriptDescriptor,
earlierScripts == null ? Collections.<ScriptDescriptor>emptyList() : earlierScripts,
earlierScripts == null ? Collections.emptyList() : earlierScripts,
scriptDescriptor,
state.getTypeMapper()
);
@@ -106,7 +106,7 @@ public final class MutableClosure implements CalculatedClosure {
@NotNull
@Override
public Map<DeclarationDescriptor, EnclosedValueDescriptor> getCaptureVariables() {
return captureVariables != null ? captureVariables : Collections.<DeclarationDescriptor, EnclosedValueDescriptor>emptyMap();
return captureVariables != null ? captureVariables : Collections.emptyMap();
}
public void setCaptureReceiverType(@NotNull KotlinType type) {
@@ -116,7 +116,7 @@ public final class MutableClosure implements CalculatedClosure {
@NotNull
@Override
public List<Pair<String, Type>> getRecordedFields() {
return recordedFields != null ? recordedFields : Collections.<Pair<String, Type>>emptyList();
return recordedFields != null ? recordedFields : Collections.emptyList();
}
@Override
@@ -590,7 +590,7 @@ public class InlineCodegen extends CallGenerator {
strategy =
new SuspendFunctionGenerationStrategy(
state,
CoroutineCodegenUtilKt.<FunctionDescriptor>unwrapInitialDescriptorForSuspendFunction(descriptor),
CoroutineCodegenUtilKt.unwrapInitialDescriptorForSuspendFunction(descriptor),
(KtFunction) expression
);
}
@@ -61,7 +61,7 @@ public class InliningContext {
@NotNull
public InliningContext subInline(@NotNull NameGenerator generator) {
return subInline(generator, Collections.<String, String>emptyMap(), isInliningLambda);
return subInline(generator, Collections.emptyMap(), isInliningLambda);
}
@NotNull