Minor. Rename isInterface -> isJvmInterface

This commit is contained in:
Denis Zharkov
2015-09-24 19:13:07 +03:00
parent cb1bdfde52
commit 6061528f7f
6 changed files with 20 additions and 20 deletions
@@ -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;
}
}
@@ -251,7 +251,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> 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<StackValue, StackValue> 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<StackValue, StackValue> 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;
@@ -296,7 +296,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
LinkedHashSet<String> superInterfaces = new LinkedHashSet<String>();
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;
@@ -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) {
@@ -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;
}
@@ -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();