From 6061528f7f23c81f3aeb8f63c6847fc0b56c12d4 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 24 Sep 2015 19:13:07 +0300 Subject: [PATCH] Minor. Rename isInterface -> isJvmInterface --- .../src/org/jetbrains/kotlin/codegen/AsmUtil.java | 8 ++++---- .../jetbrains/kotlin/codegen/ExpressionCodegen.java | 6 +++--- .../kotlin/codegen/ImplementationBodyCodegen.java | 4 ++-- .../org/jetbrains/kotlin/codegen/JvmCodegenUtil.java | 6 +++--- .../org/jetbrains/kotlin/codegen/PropertyCodegen.java | 6 +++--- .../jetbrains/kotlin/codegen/state/JetTypeMapper.java | 10 +++++----- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java index 79be4c575d5..d44a02dfedc 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java @@ -64,7 +64,7 @@ import java.util.Set; import static org.jetbrains.kotlin.builtins.KotlinBuiltIns.isBoolean; import static org.jetbrains.kotlin.builtins.KotlinBuiltIns.isPrimitiveClass; -import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isInterface; +import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isJvmInterface; import static org.jetbrains.kotlin.load.java.JvmAnnotationNames.KotlinSyntheticClass; import static org.jetbrains.kotlin.resolve.DescriptorUtils.*; import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*; @@ -168,7 +168,7 @@ public class AsmUtil { public static boolean isAbstractMethod(FunctionDescriptor functionDescriptor, OwnerKind kind) { return (functionDescriptor.getModality() == Modality.ABSTRACT - || isInterface(functionDescriptor.getContainingDeclaration())) + || isJvmInterface(functionDescriptor.getContainingDeclaration())) && !isStaticMethod(kind, functionDescriptor); } @@ -318,7 +318,7 @@ public class AsmUtil { private static Integer specialCaseVisibility(@NotNull MemberDescriptor memberDescriptor) { DeclarationDescriptor containingDeclaration = memberDescriptor.getContainingDeclaration(); Visibility memberVisibility = memberDescriptor.getVisibility(); - if (isInterface(containingDeclaration)) { + if (isJvmInterface(containingDeclaration)) { return memberVisibility == Visibilities.PRIVATE ? NO_FLAG_PACKAGE_PRIVATE : ACC_PUBLIC; } @@ -350,7 +350,7 @@ public class AsmUtil { if (memberDescriptor instanceof CallableDescriptor && memberVisibility == Visibilities.PROTECTED) { for (CallableDescriptor overridden : DescriptorUtils.getAllOverriddenDescriptors((CallableDescriptor) memberDescriptor)) { - if (isInterface(overridden.getContainingDeclaration())) { + if (isJvmInterface(overridden.getContainingDeclaration())) { return ACC_PUBLIC; } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index 4d0bb232868..4b15a36c6cc 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -251,7 +251,7 @@ public class ExpressionCodegen extends JetVisitor implem @NotNull ClassDescriptor provided, @NotNull ClassDescriptor required ) { - if (!isInterface(provided) && isInterface(required)) { + if (!isJvmInterface(provided) && isJvmInterface(required)) { return StackValue.coercion(inner, asmType(required.getDefaultType())); } @@ -2200,7 +2200,7 @@ public class ExpressionCodegen extends JetVisitor implem if (!skipPropertyAccessors) { if (!couldUseDirectAccessToProperty(propertyDescriptor, true, isDelegatedProperty, context)) { - if (isSuper && !isInterface(containingDeclaration)) { + if (isSuper && !isJvmInterface(containingDeclaration)) { ClassDescriptor owner = getSuperCallLabelTarget(context, superExpression); CodegenContext c = context.findParentContextWithDescriptor(owner); assert c != null : "Couldn't find a context for a super-call: " + propertyDescriptor; @@ -2371,7 +2371,7 @@ public class ExpressionCodegen extends JetVisitor implem JetSuperExpression superCallExpression = CallResolverUtilPackage.getSuperCallExpression(call); boolean superCall = superCallExpression != null; - if (superCall && !isInterface(fd.getContainingDeclaration())) { + if (superCall && !isJvmInterface(fd.getContainingDeclaration())) { ClassDescriptor owner = getSuperCallLabelTarget(context, superCallExpression); CodegenContext c = context.findParentContextWithDescriptor(owner); assert c != null : "Couldn't find a context for a super-call: " + fd; diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java index 4643144080c..0b64d0a000c 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java @@ -296,7 +296,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { LinkedHashSet superInterfaces = new LinkedHashSet(); for (JetType supertype : descriptor.getTypeConstructor().getSupertypes()) { - if (isInterface(supertype.getConstructor().getDeclarationDescriptor())) { + if (isJvmInterface(supertype.getConstructor().getDeclarationDescriptor())) { sw.writeInterface(); Type jvmName = typeMapper.mapSupertype(supertype, sw); sw.writeInterfaceEnd(); @@ -318,7 +318,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { for (JetType supertype : descriptor.getTypeConstructor().getSupertypes()) { ClassifierDescriptor superClass = supertype.getConstructor().getDeclarationDescriptor(); - if (superClass != null && !isInterface(superClass)) { + if (superClass != null && !isJvmInterface(superClass)) { superClassAsmType = typeMapper.mapClass(superClass); superClassType = supertype; return; diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmCodegenUtil.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmCodegenUtil.java index 6d871a16683..c323f7d8813 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmCodegenUtil.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmCodegenUtil.java @@ -55,7 +55,7 @@ public class JvmCodegenUtil { private JvmCodegenUtil() { } - public static boolean isInterface(DeclarationDescriptor descriptor) { + public static boolean isJvmInterface(DeclarationDescriptor descriptor) { if (descriptor instanceof ClassDescriptor) { ClassKind kind = ((ClassDescriptor) descriptor).getKind(); return kind == ClassKind.INTERFACE || kind == ClassKind.ANNOTATION_CLASS; @@ -63,8 +63,8 @@ public class JvmCodegenUtil { return false; } - public static boolean isInterface(JetType type) { - return isInterface(type.getConstructor().getDeclarationDescriptor()); + public static boolean isJvmInterface(JetType type) { + return isJvmInterface(type.getConstructor().getDeclarationDescriptor()); } public static boolean isConst(@NotNull CalculatedClosure closure) { diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java index a94b7300e33..1fb410b57fc 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/PropertyCodegen.java @@ -54,7 +54,7 @@ import org.jetbrains.org.objectweb.asm.commons.Method; import java.util.List; import static org.jetbrains.kotlin.codegen.AsmUtil.*; -import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isInterface; +import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isJvmInterface; import static org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings.*; import static org.jetbrains.kotlin.resolve.DescriptorUtils.isCompanionObject; import static org.jetbrains.kotlin.resolve.DescriptorUtils.isTrait; @@ -215,7 +215,7 @@ public class PropertyCodegen { } private boolean hasBackingField(@NotNull JetNamedDeclaration p, @NotNull PropertyDescriptor descriptor) { - return !isInterface(descriptor.getContainingDeclaration()) && + return !isJvmInterface(descriptor.getContainingDeclaration()) && kind != OwnerKind.DEFAULT_IMPLS && !Boolean.FALSE.equals(bindingContext.get(BindingContext.BACKING_FIELD_REQUIRED, descriptor)); } @@ -225,7 +225,7 @@ public class PropertyCodegen { @NotNull PropertyDescriptor descriptor, @NotNull Annotations annotations ) { - if (isInterface(descriptor.getContainingDeclaration()) || kind == OwnerKind.DEFAULT_IMPLS) { + if (isJvmInterface(descriptor.getContainingDeclaration()) || kind == OwnerKind.DEFAULT_IMPLS) { return false; } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java index f645e92290e..159af688aa9 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java @@ -614,14 +614,14 @@ public class JetTypeMapper { ClassDescriptor currentOwner = (ClassDescriptor) functionParent; ClassDescriptor declarationOwner = (ClassDescriptor) declarationFunctionDescriptor.getContainingDeclaration(); - boolean originalIsInterface = isInterface(declarationOwner); - boolean currentIsInterface = isInterface(currentOwner); + boolean originalIsInterface = isJvmInterface(declarationOwner); + boolean currentIsInterface = isJvmInterface(currentOwner); boolean isInterface = currentIsInterface && originalIsInterface; ClassDescriptor ownerForDefault = (ClassDescriptor) findBaseDeclaration(functionDescriptor).getContainingDeclaration(); ownerForDefaultParam = mapClass(ownerForDefault); - ownerForDefaultImpl = isInterface(ownerForDefault) ? mapTraitImpl(ownerForDefault) : ownerForDefaultParam; + ownerForDefaultImpl = isJvmInterface(ownerForDefault) ? mapTraitImpl(ownerForDefault) : ownerForDefaultParam; if (isInterface && (superCall || descriptor.getVisibility() == Visibilities.PRIVATE)) { thisClass = mapClass(currentOwner); @@ -941,7 +941,7 @@ public class JetTypeMapper { for (JetType jetType : typeParameterDescriptor.getUpperBounds()) { if (jetType.getConstructor().getDeclarationDescriptor() instanceof ClassDescriptor) { - if (!isInterface(jetType)) { + if (!isJvmInterface(jetType)) { mapType(jetType, sw, JetTypeMapperMode.TYPE_PARAMETER); break classBound; } @@ -958,7 +958,7 @@ public class JetTypeMapper { for (JetType jetType : typeParameterDescriptor.getUpperBounds()) { ClassifierDescriptor classifier = jetType.getConstructor().getDeclarationDescriptor(); if (classifier instanceof ClassDescriptor) { - if (isInterface(jetType)) { + if (isJvmInterface(jetType)) { sw.writeInterfaceBound(); mapType(jetType, sw, JetTypeMapperMode.TYPE_PARAMETER); sw.writeInterfaceBoundEnd();