diff --git a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.java b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.java index e9e0ffa6ec7..6745cfcf87c 100644 --- a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.java +++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.java @@ -29,8 +29,8 @@ import org.jetbrains.kotlin.codegen.CodegenTestFiles; import org.jetbrains.kotlin.codegen.GenerationUtils; import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime; import org.jetbrains.kotlin.generators.tests.generator.TestGeneratorUtil; -import org.jetbrains.kotlin.idea.JetFileType; -import org.jetbrains.kotlin.psi.JetFile; +import org.jetbrains.kotlin.idea.KotlinFileType; +import org.jetbrains.kotlin.psi.KtFile; import org.jetbrains.kotlin.test.ConfigurationKind; import org.jetbrains.kotlin.test.JetTestUtils; import org.jetbrains.kotlin.test.TestJdkKind; @@ -133,7 +133,7 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase { private class FilesWriter { private final boolean isFullJdk; - public List files = new ArrayList(); + public List files = new ArrayList(); private KotlinCoreEnvironment environment; private FilesWriter(boolean isFullJdk) { @@ -161,11 +161,11 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase { public void writeFilesOnDisk() { writeFiles(files); - files = new ArrayList(); + files = new ArrayList(); environment = createEnvironment(isFullJdk); } - private void writeFiles(List filesToCompile) { + private void writeFiles(List filesToCompile) { System.out.println("Generating " + filesToCompile.size() + " files..."); OutputFileCollection outputFiles; try { @@ -207,7 +207,7 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase { processFiles(printer, listFiles, holderFull, holderMock); } } - else if (!FileUtilRt.getExtension(file.getName()).equals(JetFileType.INSTANCE.getDefaultExtension())) { + else if (!FileUtilRt.getExtension(file.getName()).equals(KotlinFileType.INSTANCE.getDefaultExtension())) { // skip non kotlin files } else { diff --git a/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtil.java b/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtil.java index 1245d6639a2..95125017cf9 100644 --- a/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtil.java +++ b/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtil.java @@ -32,9 +32,9 @@ import org.jetbrains.kotlin.resolve.calls.callResolverUtil.CallResolverUtilKt; import org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt; import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall; import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt; -import org.jetbrains.kotlin.types.JetType; +import org.jetbrains.kotlin.types.KtType; import org.jetbrains.kotlin.types.TypeUtils; -import org.jetbrains.kotlin.types.checker.JetTypeChecker; +import org.jetbrains.kotlin.types.checker.KotlinTypeChecker; import java.util.*; @@ -63,9 +63,9 @@ public class CodegenUtil { } @Nullable - public static PropertyDescriptor getDelegatePropertyIfAny(JetExpression expression, ClassDescriptor classDescriptor, BindingContext bindingContext) { + public static PropertyDescriptor getDelegatePropertyIfAny(KtExpression expression, ClassDescriptor classDescriptor, BindingContext bindingContext) { PropertyDescriptor propertyDescriptor = null; - if (expression instanceof JetSimpleNameExpression) { + if (expression instanceof KtSimpleNameExpression) { ResolvedCall call = CallUtilKt.getResolvedCall(expression, bindingContext); if (call != null) { CallableDescriptor callResultingDescriptor = call.getResultingDescriptor(); @@ -140,8 +140,8 @@ public class CodegenUtil { } @NotNull - public static ClassDescriptor getSuperClassByDelegationSpecifier(@NotNull JetDelegationSpecifier specifier, @NotNull BindingContext bindingContext) { - JetType superType = bindingContext.get(BindingContext.TYPE, specifier.getTypeReference()); + public static ClassDescriptor getSuperClassByDelegationSpecifier(@NotNull KtDelegationSpecifier specifier, @NotNull BindingContext bindingContext) { + KtType superType = bindingContext.get(BindingContext.TYPE, specifier.getTypeReference()); assert superType != null : "superType should not be null: " + specifier.getText(); ClassDescriptor superClassDescriptor = (ClassDescriptor) superType.getConstructor().getDeclarationDescriptor(); @@ -164,16 +164,16 @@ public class CodegenUtil { return true; } - private static boolean rawTypeMatches(JetType type, ClassifierDescriptor classifier) { + private static boolean rawTypeMatches(KtType type, ClassifierDescriptor classifier) { return type.getConstructor().equals(classifier.getTypeConstructor()); } public static boolean isEnumValueOfMethod(@NotNull FunctionDescriptor functionDescriptor) { List methodTypeParameters = functionDescriptor.getValueParameters(); - JetType nullableString = TypeUtils.makeNullable(DescriptorUtilsKt.getBuiltIns(functionDescriptor).getStringType()); + KtType nullableString = TypeUtils.makeNullable(DescriptorUtilsKt.getBuiltIns(functionDescriptor).getStringType()); return DescriptorUtils.ENUM_VALUE_OF.equals(functionDescriptor.getName()) && methodTypeParameters.size() == 1 - && JetTypeChecker.DEFAULT.isSubtypeOf(methodTypeParameters.get(0).getType(), nullableString); + && KotlinTypeChecker.DEFAULT.isSubtypeOf(methodTypeParameters.get(0).getType(), nullableString); } public static boolean isEnumValuesProperty(@NotNull VariableDescriptor propertyDescriptor) { @@ -183,8 +183,8 @@ public class CodegenUtil { @Nullable public static Integer getLineNumberForElement(@NotNull PsiElement statement, boolean markEndOffset) { PsiFile file = statement.getContainingFile(); - if (file instanceof JetFile) { - if (JetPsiFactoryKt.getDoNotAnalyze((JetFile) file) != null) { + if (file instanceof KtFile) { + if (KtPsiFactoryKt.getDoNotAnalyze((KtFile) file) != null) { return null; } } diff --git a/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtilKt.kt b/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtilKt.kt index e43b9de56a8..e80b74e0c1d 100644 --- a/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtilKt.kt +++ b/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtilKt.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.incremental.components.NoLookupLocation import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.MemberComparator -import org.jetbrains.kotlin.types.JetType +import org.jetbrains.kotlin.types.KtType import org.jetbrains.kotlin.types.isDynamic import org.jetbrains.kotlin.utils.keysToMapExceptNulls import java.util.Comparator @@ -38,7 +38,7 @@ public object CodegenUtilKt { public fun getDelegates( descriptor: ClassDescriptor, toTrait: ClassDescriptor, - delegateExpressionType: JetType? = null + delegateExpressionType: KtType? = null ): Map { if (delegateExpressionType?.isDynamic() ?: false) return mapOf(); diff --git a/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/DataClassMethodGenerator.java b/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/DataClassMethodGenerator.java index 2a292ba0b52..5b9c978b44f 100644 --- a/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/DataClassMethodGenerator.java +++ b/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/DataClassMethodGenerator.java @@ -22,9 +22,9 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.builtins.KotlinBuiltIns; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.name.Name; -import org.jetbrains.kotlin.psi.JetClass; -import org.jetbrains.kotlin.psi.JetClassOrObject; -import org.jetbrains.kotlin.psi.JetParameter; +import org.jetbrains.kotlin.psi.KtClass; +import org.jetbrains.kotlin.psi.KtClassOrObject; +import org.jetbrains.kotlin.psi.KtParameter; import org.jetbrains.kotlin.resolve.BindingContext; import org.jetbrains.kotlin.resolve.BindingContextUtils; import org.jetbrains.kotlin.resolve.OverrideResolver; @@ -39,12 +39,12 @@ import java.util.List; * changed here with the platform backends adopted. */ public abstract class DataClassMethodGenerator { - private final JetClassOrObject declaration; + private final KtClassOrObject declaration; private final BindingContext bindingContext; private final ClassDescriptor classDescriptor; private final KotlinBuiltIns builtIns; - public DataClassMethodGenerator(JetClassOrObject declaration, BindingContext bindingContext) { + public DataClassMethodGenerator(KtClassOrObject declaration, BindingContext bindingContext) { this.declaration = declaration; this.bindingContext = bindingContext; this.classDescriptor = BindingContextUtils.getNotNull(bindingContext, BindingContext.CLASS, declaration); @@ -66,7 +66,7 @@ public abstract class DataClassMethodGenerator { protected abstract void generateComponentFunction(@NotNull FunctionDescriptor function, @NotNull ValueParameterDescriptor parameter); - protected abstract void generateCopyFunction(@NotNull FunctionDescriptor function, @NotNull List constructorParameters); + protected abstract void generateCopyFunction(@NotNull FunctionDescriptor function, @NotNull List constructorParameters); protected abstract void generateToStringMethod(@NotNull FunctionDescriptor function, @NotNull List properties); @@ -93,7 +93,7 @@ public abstract class DataClassMethodGenerator { } } - private void generateCopyFunctionForDataClasses(List constructorParameters) { + private void generateCopyFunctionForDataClasses(List constructorParameters) { FunctionDescriptor copyFunction = bindingContext.get(BindingContext.DATA_CLASS_COPY_FUNCTION, classDescriptor); if (copyFunction != null) { generateCopyFunction(copyFunction, constructorParameters); @@ -123,7 +123,7 @@ public abstract class DataClassMethodGenerator { private List getDataProperties() { List result = Lists.newArrayList(); - for (JetParameter parameter : getPrimaryConstructorParameters()) { + for (KtParameter parameter : getPrimaryConstructorParameters()) { if (parameter.hasValOrVar()) { result.add(bindingContext.get(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, parameter)); } @@ -132,8 +132,8 @@ public abstract class DataClassMethodGenerator { } @NotNull - private List getPrimaryConstructorParameters() { - if (declaration instanceof JetClass) { + private List getPrimaryConstructorParameters() { + if (declaration instanceof KtClass) { return declaration.getPrimaryConstructorParameters(); } return Collections.emptyList(); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForCallableDescriptor.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForCallableDescriptor.java index 2b4077f13b1..0105f98ddd1 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForCallableDescriptor.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForCallableDescriptor.java @@ -19,12 +19,12 @@ package org.jetbrains.kotlin.codegen; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor; -import org.jetbrains.kotlin.psi.JetSuperExpression; +import org.jetbrains.kotlin.psi.KtSuperExpression; public interface AccessorForCallableDescriptor { @NotNull T getCalleeDescriptor(); @Nullable - JetSuperExpression getSuperCallExpression(); + KtSuperExpression getSuperCallExpression(); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForConstructorDescriptor.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForConstructorDescriptor.kt index 585f0b0d543..eac7f44874b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForConstructorDescriptor.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForConstructorDescriptor.kt @@ -18,14 +18,14 @@ package org.jetbrains.kotlin.codegen import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.psi.JetSuperExpression +import org.jetbrains.kotlin.psi.KtSuperExpression import org.jetbrains.kotlin.resolve.DescriptorUtils -import org.jetbrains.kotlin.types.JetType +import org.jetbrains.kotlin.types.KtType public class AccessorForConstructorDescriptor( private val calleeDescriptor: ConstructorDescriptor, containingDeclaration: DeclarationDescriptor, - private val superCallExpression: JetSuperExpression? + private val superCallExpression: KtSuperExpression? ) : AbstractAccessorForFunctionDescriptor(containingDeclaration, Name.special("")), ConstructorDescriptor, AccessorForCallableDescriptor { @@ -35,9 +35,9 @@ public class AccessorForConstructorDescriptor( override fun isPrimary(): Boolean = false - override fun getReturnType(): JetType = super.getReturnType()!! + override fun getReturnType(): KtType = super.getReturnType()!! - override fun getSuperCallExpression(): JetSuperExpression? = superCallExpression + override fun getSuperCallExpression(): KtSuperExpression? = superCallExpression init { initialize( diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForFunctionDescriptor.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForFunctionDescriptor.java index d5e77bc16a6..c5d0954e567 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForFunctionDescriptor.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForFunctionDescriptor.java @@ -20,18 +20,18 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.name.Name; -import org.jetbrains.kotlin.psi.JetSuperExpression; +import org.jetbrains.kotlin.psi.KtSuperExpression; import org.jetbrains.kotlin.resolve.DescriptorUtils; import org.jetbrains.kotlin.resolve.annotations.AnnotationUtilKt; public class AccessorForFunctionDescriptor extends AbstractAccessorForFunctionDescriptor implements AccessorForCallableDescriptor { private final FunctionDescriptor calleeDescriptor; - private final JetSuperExpression superCallExpression; + private final KtSuperExpression superCallExpression; public AccessorForFunctionDescriptor( @NotNull FunctionDescriptor descriptor, @NotNull DeclarationDescriptor containingDeclaration, - @Nullable JetSuperExpression superCallExpression, + @Nullable KtSuperExpression superCallExpression, @NotNull String nameSuffix ) { super(containingDeclaration, @@ -57,7 +57,7 @@ public class AccessorForFunctionDescriptor extends AbstractAccessorForFunctionDe } @Override - public JetSuperExpression getSuperCallExpression() { + public KtSuperExpression getSuperCallExpression() { return superCallExpression; } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForPropertyBackingFieldInOuterClass.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForPropertyBackingFieldInOuterClass.java index d072f5f0628..4b1baa5746e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForPropertyBackingFieldInOuterClass.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForPropertyBackingFieldInOuterClass.java @@ -20,13 +20,13 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.descriptors.DeclarationDescriptor; import org.jetbrains.kotlin.descriptors.PropertyDescriptor; -import org.jetbrains.kotlin.types.JetType; +import org.jetbrains.kotlin.types.KtType; public class AccessorForPropertyBackingFieldInOuterClass extends AccessorForPropertyDescriptor { public AccessorForPropertyBackingFieldInOuterClass( @NotNull PropertyDescriptor property, @NotNull DeclarationDescriptor containingDeclaration, - @Nullable JetType delegationType, + @Nullable KtType delegationType, @NotNull String nameSuffix ) { super(property, delegationType != null ? delegationType : property.getType(), null, null, containingDeclaration, null, nameSuffix); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForPropertyDescriptor.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForPropertyDescriptor.java index 536a2c24739..8e0507d4e59 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForPropertyDescriptor.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AccessorForPropertyDescriptor.java @@ -25,21 +25,21 @@ import org.jetbrains.kotlin.descriptors.impl.PropertyGetterDescriptorImpl; import org.jetbrains.kotlin.descriptors.impl.PropertySetterDescriptorImpl; import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl; import org.jetbrains.kotlin.name.Name; -import org.jetbrains.kotlin.psi.JetSuperExpression; +import org.jetbrains.kotlin.psi.KtSuperExpression; import org.jetbrains.kotlin.resolve.DescriptorUtils; -import org.jetbrains.kotlin.types.JetType; +import org.jetbrains.kotlin.types.KtType; import java.util.Collections; public class AccessorForPropertyDescriptor extends PropertyDescriptorImpl implements AccessorForCallableDescriptor { private final PropertyDescriptor calleeDescriptor; - private final JetSuperExpression superCallExpression; + private final KtSuperExpression superCallExpression; @NotNull private final String nameSuffix; public AccessorForPropertyDescriptor( @NotNull PropertyDescriptor property, @NotNull DeclarationDescriptor containingDeclaration, - @Nullable JetSuperExpression superCallExpression, + @Nullable KtSuperExpression superCallExpression, @NotNull String nameSuffix ) { this(property, property.getType(), DescriptorUtils.getReceiverParameterType(property.getExtensionReceiverParameter()), @@ -48,11 +48,11 @@ public class AccessorForPropertyDescriptor extends PropertyDescriptorImpl implem protected AccessorForPropertyDescriptor( @NotNull PropertyDescriptor original, - @NotNull JetType propertyType, - @Nullable JetType receiverType, + @NotNull KtType propertyType, + @Nullable KtType receiverType, @Nullable ReceiverParameterDescriptor dispatchReceiverParameter, @NotNull DeclarationDescriptor containingDeclaration, - @Nullable JetSuperExpression superCallExpression, + @Nullable KtSuperExpression superCallExpression, @NotNull String nameSuffix ) { super(containingDeclaration, null, Annotations.Companion.getEMPTY(), Modality.FINAL, Visibilities.LOCAL, @@ -84,7 +84,7 @@ public class AccessorForPropertyDescriptor extends PropertyDescriptorImpl implem @Nullable @Override - public JetSuperExpression getSuperCallExpression() { + public KtSuperExpression getSuperCallExpression() { return ((AccessorForPropertyDescriptor) getCorrespondingProperty()).getSuperCallExpression(); } @@ -108,7 +108,7 @@ public class AccessorForPropertyDescriptor extends PropertyDescriptorImpl implem @Nullable @Override - public JetSuperExpression getSuperCallExpression() { + public KtSuperExpression getSuperCallExpression() { return ((AccessorForPropertyDescriptor) getCorrespondingProperty()).getSuperCallExpression(); } } @@ -120,7 +120,7 @@ public class AccessorForPropertyDescriptor extends PropertyDescriptorImpl implem } @Override - public JetSuperExpression getSuperCallExpression() { + public KtSuperExpression getSuperCallExpression() { return superCallExpression; } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java index 4ceada00ad9..4c8b7bd5b5b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java @@ -157,7 +157,7 @@ public abstract class AnnotationCodegen { return false; } - private void generateNullabilityAnnotation(@Nullable JetType type, @NotNull Set annotationDescriptorsAlreadyPresent) { + private void generateNullabilityAnnotation(@Nullable KtType type, @NotNull Set annotationDescriptorsAlreadyPresent) { if (type == null) return; if (isBareTypeParameterWithNullableUpperBound(type)) { @@ -253,12 +253,12 @@ public abstract class AnnotationCodegen { } } - private static boolean isBareTypeParameterWithNullableUpperBound(@NotNull JetType type) { + private static boolean isBareTypeParameterWithNullableUpperBound(@NotNull KtType type) { ClassifierDescriptor classifier = type.getConstructor().getDeclarationDescriptor(); return !type.isMarkedNullable() && classifier instanceof TypeParameterDescriptor && TypeUtils.hasNullableSuperType(type); } - public void generateAnnotationDefaultValue(@NotNull ConstantValue value, @NotNull JetType expectedType) { + public void generateAnnotationDefaultValue(@NotNull ConstantValue value, @NotNull KtType expectedType) { AnnotationVisitor visitor = visitAnnotation(null, false); // Parameters are unimportant genCompileTimeValue(null, value, visitor); visitor.visitEnd(); @@ -418,7 +418,7 @@ public abstract class AnnotationCodegen { for (ConstantValue value : values) { if (value instanceof EnumValue) { ClassDescriptor enumEntry = ((EnumValue) value).getValue(); - JetType classObjectType = DescriptorUtilsKt.getClassObjectType(enumEntry); + KtType classObjectType = DescriptorUtilsKt.getClassObjectType(enumEntry); if (classObjectType != null) { if ("java/lang/annotation/ElementType".equals(typeMapper.mapType(classObjectType).getInternalName())) { result.add(ElementType.valueOf(enumEntry.getName().asString())); @@ -446,7 +446,7 @@ public abstract class AnnotationCodegen { ConstantValue compileTimeConstant = valueArguments.iterator().next(); if (compileTimeConstant instanceof EnumValue) { ClassDescriptor enumEntry = ((EnumValue) compileTimeConstant).getValue(); - JetType classObjectType = DescriptorUtilsKt.getClassObjectType(enumEntry); + KtType classObjectType = DescriptorUtilsKt.getClassObjectType(enumEntry); if (classObjectType != null) { if ("java/lang/annotation/RetentionPolicy".equals(typeMapper.mapType(classObjectType).getInternalName())) { return RetentionPolicy.valueOf(enumEntry.getName().asString()); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java index dac28a7f51f..a6954c2eccf 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AsmUtil.java @@ -35,7 +35,7 @@ import org.jetbrains.kotlin.codegen.state.GenerationState; import org.jetbrains.kotlin.codegen.state.JetTypeMapper; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.jvm.RuntimeAssertionInfo; -import org.jetbrains.kotlin.lexer.JetTokens; +import org.jetbrains.kotlin.lexer.KtTokens; import org.jetbrains.kotlin.load.java.JavaVisibilities; import org.jetbrains.kotlin.load.java.JvmAnnotationNames; import org.jetbrains.kotlin.load.java.descriptors.JavaCallableMemberDescriptor; @@ -52,7 +52,7 @@ import org.jetbrains.kotlin.serialization.DescriptorSerializer; import org.jetbrains.kotlin.serialization.jvm.BitEncoding; import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor; import org.jetbrains.kotlin.types.FlexibleTypesKt; -import org.jetbrains.kotlin.types.JetType; +import org.jetbrains.kotlin.types.KtType; import org.jetbrains.org.objectweb.asm.*; import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter; import org.jetbrains.org.objectweb.asm.commons.Method; @@ -432,7 +432,7 @@ public class AsmUtil { allFields.add(Pair.create(CAPTURED_THIS_FIELD, typeMapper.mapType(captureThis))); } - JetType captureReceiverType = closure.getCaptureReceiverType(); + KtType captureReceiverType = closure.getCaptureReceiverType(); if (captureReceiverType != null) { allFields.add(Pair.create(CAPTURED_RECEIVER_FIELD, typeMapper.mapType(captureReceiverType))); } @@ -558,7 +558,7 @@ public class AsmUtil { right.put(rightType, v); genAreEqualCall(v); - if (opToken == JetTokens.EXCLEQ || opToken == JetTokens.EXCLEQEQEQ) { + if (opToken == KtTokens.EXCLEQ || opToken == KtTokens.EXCLEQEQEQ) { genInvertBoolean(v); } return Unit.INSTANCE$; @@ -638,7 +638,7 @@ public class AsmUtil { @NotNull CallableDescriptor parameter, @NotNull String name ) { - JetType type = parameter.getReturnType(); + KtType type = parameter.getReturnType(); if (type == null || isNullableType(type)) return; int index = frameMap.getIndex(parameter); @@ -672,7 +672,7 @@ public class AsmUtil { if (!isDeclaredInJava(descriptor)) return false; - JetType type = descriptor.getReturnType(); + KtType type = descriptor.getReturnType(); if (type == null || isNullableType(FlexibleTypesKt.lowerIfFlexible(type))) return false; Type asmType = state.getTypeMapper().mapReturnType(descriptor); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/BranchedValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/BranchedValue.kt index 8eea7c615dd..f3cdd804779 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/BranchedValue.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/BranchedValue.kt @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.codegen import com.intellij.psi.tree.IElementType import org.jetbrains.kotlin.codegen.pseudoInsns.fakeAlwaysFalseIfeq import org.jetbrains.kotlin.codegen.pseudoInsns.fakeAlwaysTrueIfeq -import org.jetbrains.kotlin.lexer.JetTokens +import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.org.objectweb.asm.Label import org.jetbrains.org.objectweb.asm.Opcodes.* import org.jetbrains.org.objectweb.asm.Type @@ -214,7 +214,7 @@ class NumberCompare( override fun patchOpcode(opcode: Int, v: InstructionAdapter): Int { when (operandType) { Type.FLOAT_TYPE, Type.DOUBLE_TYPE -> { - if (opToken == JetTokens.GT || opToken == JetTokens.GTEQ) { + if (opToken == KtTokens.GT || opToken == KtTokens.GTEQ) { v.cmpl(operandType) } else { @@ -234,12 +234,12 @@ class NumberCompare( companion object { fun getNumberCompareOpcode(opToken: IElementType): Int { return when (opToken) { - JetTokens.EQEQ, JetTokens.EQEQEQ -> IFNE - JetTokens.EXCLEQ, JetTokens.EXCLEQEQEQ -> IFEQ - JetTokens.GT -> IFLE - JetTokens.GTEQ -> IFLT - JetTokens.LT -> IFGE - JetTokens.LTEQ -> IFGT + KtTokens.EQEQ, KtTokens.EQEQEQ -> IFNE + KtTokens.EXCLEQ, KtTokens.EXCLEQEQEQ -> IFEQ + KtTokens.GT -> IFLE + KtTokens.GTEQ -> IFLT + KtTokens.LT -> IFGE + KtTokens.LTEQ -> IFGT else -> { throw UnsupportedOperationException("Don't know how to generate this condJump: " + opToken) } @@ -258,8 +258,8 @@ class ObjectCompare( companion object { fun getObjectCompareOpcode(opToken: IElementType): Int { return when (opToken) { - JetTokens.EQEQEQ -> IF_ACMPNE - JetTokens.EXCLEQEQEQ -> IF_ACMPEQ + KtTokens.EQEQEQ -> IF_ACMPNE + KtTokens.EXCLEQEQEQ -> IF_ACMPEQ else -> throw UnsupportedOperationException("don't know how to generate this condjump") } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/CallBasedArgumentGenerator.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/CallBasedArgumentGenerator.java index a15ac23d66f..c81b2b73798 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/CallBasedArgumentGenerator.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/CallBasedArgumentGenerator.java @@ -18,7 +18,7 @@ package org.jetbrains.kotlin.codegen; import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor; -import org.jetbrains.kotlin.psi.JetExpression; +import org.jetbrains.kotlin.psi.KtExpression; import org.jetbrains.kotlin.psi.ValueArgument; import org.jetbrains.kotlin.resolve.calls.model.*; import org.jetbrains.org.objectweb.asm.Type; @@ -68,7 +68,7 @@ public class CallBasedArgumentGenerator extends ArgumentGenerator { Type type = valueParameterTypes.get(i); ValueArgument valueArgument = argument.getValueArgument(); assert valueArgument != null; - JetExpression argumentExpression = valueArgument.getArgumentExpression(); + KtExpression argumentExpression = valueArgument.getArgumentExpression(); assert argumentExpression != null : valueArgument.asElement().getText(); callGenerator.genValueAndPut(parameter, argumentExpression, type, i); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/CallGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/CallGenerator.kt index 9f3953fe0a1..c851844a523 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/CallGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/CallGenerator.kt @@ -17,7 +17,7 @@ package org.jetbrains.kotlin.codegen import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor -import org.jetbrains.kotlin.psi.JetExpression +import org.jetbrains.kotlin.psi.KtExpression import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.org.objectweb.asm.Type @@ -57,7 +57,7 @@ abstract class CallGenerator { override fun genValueAndPut( valueParameterDescriptor: ValueParameterDescriptor, - argumentExpression: JetExpression, + argumentExpression: KtExpression, parameterType: Type, parameterIndex: Int) { val value = codegen.gen(argumentExpression) @@ -118,7 +118,7 @@ abstract class CallGenerator { abstract fun genValueAndPut( valueParameterDescriptor: ValueParameterDescriptor, - argumentExpression: JetExpression, + argumentExpression: KtExpression, parameterType: Type, parameterIndex: Int) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBodyCodegen.java index 940a1bd41d0..b3e69edd2f6 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassBodyCodegen.java @@ -31,13 +31,13 @@ import java.util.List; import static org.jetbrains.kotlin.codegen.binding.CodegenBinding.enumEntryNeedSubclass; -public abstract class ClassBodyCodegen extends MemberCodegen { - protected final JetClassOrObject myClass; +public abstract class ClassBodyCodegen extends MemberCodegen { + protected final KtClassOrObject myClass; protected final OwnerKind kind; protected final ClassDescriptor descriptor; protected ClassBodyCodegen( - @NotNull JetClassOrObject myClass, + @NotNull KtClassOrObject myClass, @NotNull ClassContext context, @NotNull ClassBuilder v, @NotNull GenerationState state, @@ -53,14 +53,14 @@ public abstract class ClassBodyCodegen extends MemberCodegen { protected void generateBody() { if (kind != OwnerKind.DEFAULT_IMPLS) { //generate nested classes first and only then generate class body. It necessary to access to nested CodegenContexts - for (JetDeclaration declaration : myClass.getDeclarations()) { + for (KtDeclaration declaration : myClass.getDeclarations()) { if (shouldProcessFirst(declaration)) { generateDeclaration(declaration); } } } - for (JetDeclaration declaration : myClass.getDeclarations()) { + for (KtDeclaration declaration : myClass.getDeclarations()) { if (!shouldProcessFirst(declaration)) { generateDeclaration(declaration); } @@ -92,26 +92,26 @@ public abstract class ClassBodyCodegen extends MemberCodegen { generatePrimaryConstructorProperties(); } - private static boolean shouldProcessFirst(JetDeclaration declaration) { - return !(declaration instanceof JetProperty || declaration instanceof JetNamedFunction); + private static boolean shouldProcessFirst(KtDeclaration declaration) { + return !(declaration instanceof KtProperty || declaration instanceof KtNamedFunction); } - protected void generateDeclaration(JetDeclaration declaration) { - if (declaration instanceof JetProperty || declaration instanceof JetNamedFunction) { + protected void generateDeclaration(KtDeclaration declaration) { + if (declaration instanceof KtProperty || declaration instanceof KtNamedFunction) { genFunctionOrProperty(declaration); } - else if (declaration instanceof JetClassOrObject) { - if (declaration instanceof JetEnumEntry && !enumEntryNeedSubclass(bindingContext, (JetEnumEntry) declaration)) { + else if (declaration instanceof KtClassOrObject) { + if (declaration instanceof KtEnumEntry && !enumEntryNeedSubclass(bindingContext, (KtEnumEntry) declaration)) { return; } - genClassOrObject((JetClassOrObject) declaration); + genClassOrObject((KtClassOrObject) declaration); } } private void generatePrimaryConstructorProperties() { boolean isAnnotation = descriptor.getKind() == ClassKind.ANNOTATION_CLASS; - for (JetParameter p : getPrimaryConstructorParameters()) { + for (KtParameter p : getPrimaryConstructorParameters()) { if (p.hasValOrVar()) { PropertyDescriptor propertyDescriptor = bindingContext.get(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, p); if (propertyDescriptor != null) { @@ -127,9 +127,9 @@ public abstract class ClassBodyCodegen extends MemberCodegen { } @NotNull - protected List getPrimaryConstructorParameters() { - if (myClass instanceof JetClass) { - return ((JetClass) myClass).getPrimaryConstructorParameters(); + protected List getPrimaryConstructorParameters() { + if (myClass instanceof KtClass) { + return ((KtClass) myClass).getPrimaryConstructorParameters(); } return Collections.emptyList(); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java index db7d9902069..796bf6531b2 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java @@ -33,7 +33,7 @@ import org.jetbrains.kotlin.load.java.JvmAbi; import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils; import org.jetbrains.kotlin.load.kotlin.PackageParts; import org.jetbrains.kotlin.name.FqName; -import org.jetbrains.kotlin.psi.JetFile; +import org.jetbrains.kotlin.psi.KtFile; import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin; import org.jetbrains.kotlin.serialization.jvm.JvmPackageTable; import org.jetbrains.org.objectweb.asm.Type; @@ -223,7 +223,7 @@ public class ClassFileFactory implements OutputFileCollection { } @NotNull - public PackageCodegen forPackage(@NotNull FqName fqName, @NotNull Collection files) { + public PackageCodegen forPackage(@NotNull FqName fqName, @NotNull Collection files) { assert !isDone : "Already done!"; PackageCodegen codegen = package2codegen.get(fqName); if (codegen == null) { @@ -235,7 +235,7 @@ public class ClassFileFactory implements OutputFileCollection { } @NotNull - public MultifileClassCodegen forMultifileClass(@NotNull FqName facadeFqName, @NotNull Collection files) { + public MultifileClassCodegen forMultifileClass(@NotNull FqName facadeFqName, @NotNull Collection files) { assert !isDone : "Already done!"; MultifileClassCodegen codegen = multifileClass2codegen.get(facadeFqName); if (codegen == null) { @@ -341,7 +341,7 @@ public class ClassFileFactory implements OutputFileCollection { } @TestOnly - public List getInputFiles() { + public List getInputFiles() { return state.getFiles(); } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java index 755a5aa53cf..a2f8b3e8f06 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClosureCodegen.java @@ -35,15 +35,15 @@ import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl; import org.jetbrains.kotlin.incremental.components.NoLookupLocation; import org.jetbrains.kotlin.load.java.JvmAbi; import org.jetbrains.kotlin.load.java.JvmAnnotationNames; -import org.jetbrains.kotlin.psi.JetElement; +import org.jetbrains.kotlin.psi.KtElement; import org.jetbrains.kotlin.resolve.BindingContext; import org.jetbrains.kotlin.resolve.DescriptorUtils; import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt; import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKt; -import org.jetbrains.kotlin.resolve.scopes.JetScope; +import org.jetbrains.kotlin.resolve.scopes.KtScope; import org.jetbrains.kotlin.serialization.DescriptorSerializer; import org.jetbrains.kotlin.serialization.ProtoBuf; -import org.jetbrains.kotlin.types.JetType; +import org.jetbrains.kotlin.types.KtType; import org.jetbrains.kotlin.util.OperatorNameConventions; import org.jetbrains.kotlin.utils.FunctionsKt; import org.jetbrains.org.objectweb.asm.AnnotationVisitor; @@ -66,12 +66,12 @@ import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*; import static org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin.NO_ORIGIN; import static org.jetbrains.org.objectweb.asm.Opcodes.*; -public class ClosureCodegen extends MemberCodegen { +public class ClosureCodegen extends MemberCodegen { private final FunctionDescriptor funDescriptor; private final ClassDescriptor classDescriptor; private final SamType samType; - private final JetType superClassType; - private final List superInterfaceTypes; + private final KtType superClassType; + private final List superInterfaceTypes; private final FunctionDescriptor functionReferenceTarget; private final FunctionGenerationStrategy strategy; private final CalculatedClosure closure; @@ -83,7 +83,7 @@ public class ClosureCodegen extends MemberCodegen { public ClosureCodegen( @NotNull GenerationState state, - @NotNull JetElement element, + @NotNull KtElement element, @Nullable SamType samType, @NotNull ClosureContext context, @Nullable FunctionDescriptor functionReferenceTarget, @@ -100,10 +100,10 @@ public class ClosureCodegen extends MemberCodegen { this.strategy = strategy; if (samType == null) { - this.superInterfaceTypes = new ArrayList(); + this.superInterfaceTypes = new ArrayList(); - JetType superClassType = null; - for (JetType supertype : classDescriptor.getTypeConstructor().getSupertypes()) { + KtType superClassType = null; + for (KtType supertype : classDescriptor.getTypeConstructor().getSupertypes()) { ClassifierDescriptor classifier = supertype.getConstructor().getDeclarationDescriptor(); if (DescriptorUtils.isInterface(classifier)) { superInterfaceTypes.add(supertype); @@ -141,7 +141,7 @@ public class ClosureCodegen extends MemberCodegen { sw.writeSuperclassEnd(); String[] superInterfaceAsmTypes = new String[superInterfaceTypes.size()]; for (int i = 0; i < superInterfaceTypes.size(); i++) { - JetType superInterfaceType = superInterfaceTypes.get(i); + KtType superInterfaceType = superInterfaceTypes.get(i); sw.writeInterface(); superInterfaceAsmTypes[i] = typeMapper.mapSupertype(superInterfaceType, sw).getInternalName(); sw.writeInterfaceEnd(); @@ -428,7 +428,7 @@ public class ClosureCodegen extends MemberCodegen { Type type = typeMapper.mapType(captureThis); args.add(FieldInfo.createForHiddenField(ownerType, type, CAPTURED_THIS_FIELD)); } - JetType captureReceiverType = closure.getCaptureReceiverType(); + KtType captureReceiverType = closure.getCaptureReceiverType(); if (captureReceiverType != null) { args.add(FieldInfo.createForHiddenField(ownerType, typeMapper.mapType(captureReceiverType), CAPTURED_RECEIVER_FIELD)); } @@ -467,7 +467,7 @@ public class ClosureCodegen extends MemberCodegen { ClassDescriptor elementClass = elementDescriptor.getExtensionReceiverParameter() == null ? DescriptorUtilsKt.getBuiltIns(elementDescriptor).getFunction(arity) : DescriptorUtilsKt.getBuiltIns(elementDescriptor).getExtensionFunction(arity); - JetScope scope = elementClass.getDefaultType().getMemberScope(); + KtScope scope = elementClass.getDefaultType().getMemberScope(); return scope.getFunctions(OperatorNameConventions.INVOKE, NoLookupLocation.FROM_BACKEND).iterator().next(); } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/CodegenFileClassesProvider.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/CodegenFileClassesProvider.kt index e0bc97fbcf1..4cc20975a20 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/CodegenFileClassesProvider.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/CodegenFileClassesProvider.kt @@ -19,9 +19,9 @@ package org.jetbrains.kotlin.codegen import org.jetbrains.kotlin.fileClasses.JvmFileClassInfo import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil import org.jetbrains.kotlin.fileClasses.JvmFileClassesProvider -import org.jetbrains.kotlin.psi.JetFile +import org.jetbrains.kotlin.psi.KtFile public class CodegenFileClassesProvider : JvmFileClassesProvider { - override public fun getFileClassInfo(file: JetFile): JvmFileClassInfo = + override public fun getFileClassInfo(file: KtFile): JvmFileClassInfo = JvmFileClassUtil.getFileClassInfoNoResolve(file) } \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/CodegenStatementVisitor.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/CodegenStatementVisitor.java index f6a0be5626c..08dbacb4d9a 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/CodegenStatementVisitor.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/CodegenStatementVisitor.java @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.codegen; import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.psi.*; -public class CodegenStatementVisitor extends JetVisitor { +public class CodegenStatementVisitor extends KtVisitor { private final ExpressionCodegen codegen; public CodegenStatementVisitor(ExpressionCodegen codegen) { @@ -27,38 +27,38 @@ public class CodegenStatementVisitor extends JetVisitor } @Override - public StackValue visitJetElement(@NotNull JetElement element, StackValue receiver) { + public StackValue visitJetElement(@NotNull KtElement element, StackValue receiver) { return element.accept(codegen, receiver); } @Override - public StackValue visitIfExpression(@NotNull JetIfExpression expression, StackValue receiver) { + public StackValue visitIfExpression(@NotNull KtIfExpression expression, StackValue receiver) { return codegen.generateIfExpression(expression, true); } @Override - public StackValue visitTryExpression(@NotNull JetTryExpression expression, StackValue data) { + public StackValue visitTryExpression(@NotNull KtTryExpression expression, StackValue data) { return codegen.generateTryExpression(expression, true); } @Override - public StackValue visitNamedFunction(@NotNull JetNamedFunction function, StackValue data) { + public StackValue visitNamedFunction(@NotNull KtNamedFunction function, StackValue data) { return codegen.visitNamedFunction(function, data, true); } @Override - public StackValue visitWhenExpression(@NotNull JetWhenExpression expression, StackValue data) { + public StackValue visitWhenExpression(@NotNull KtWhenExpression expression, StackValue data) { return codegen.generateWhenExpression(expression, true); } @Override - public StackValue visitBlockExpression(@NotNull JetBlockExpression expression, StackValue data) { + public StackValue visitBlockExpression(@NotNull KtBlockExpression expression, StackValue data) { return codegen.generateBlock(expression, true); } @Override - public StackValue visitLabeledExpression(@NotNull JetLabeledExpression expression, StackValue receiver) { - JetExpression baseExpression = expression.getBaseExpression(); + public StackValue visitLabeledExpression(@NotNull KtLabeledExpression expression, StackValue receiver) { + KtExpression baseExpression = expression.getBaseExpression(); assert baseExpression != null : "Label expression should have base one: " + expression.getText(); return baseExpression.accept(this, receiver); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/CollectionStubMethodGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/CollectionStubMethodGenerator.kt index 56cc9a1226f..645840b22a4 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/CollectionStubMethodGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/CollectionStubMethodGenerator.kt @@ -30,7 +30,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature import org.jetbrains.kotlin.types.* -import org.jetbrains.kotlin.types.checker.JetTypeChecker +import org.jetbrains.kotlin.types.checker.KotlinTypeChecker import org.jetbrains.org.objectweb.asm.Opcodes.* import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter import java.util.ArrayList @@ -187,7 +187,7 @@ class CollectionStubMethodGenerator( return ourSuperCollectionClasses.filter { klass -> klass.readOnlyClass !in redundantClasses } } - private fun Collection.classes(): Collection = + private fun Collection.classes(): Collection = this.map { it.getConstructor().getDeclarationDescriptor() as ClassDescriptor } private fun findFakeOverridesForMethodsFromMutableCollection( @@ -213,13 +213,13 @@ class CollectionStubMethodGenerator( return result } - private fun Collection.findMostSpecificTypeForClass(klass: ClassDescriptor): JetType { + private fun Collection.findMostSpecificTypeForClass(klass: ClassDescriptor): KtType { val types = this.filter { it.getConstructor().getDeclarationDescriptor() == klass } if (types.isEmpty()) error("No supertype of $klass in $this") if (types.size() == 1) return types.first() // Find the first type in the list such that it's a subtype of every other type in that list return types.first { type -> - types.all { other -> JetTypeChecker.DEFAULT.isSubtypeOf(type, other) } + types.all { other -> KotlinTypeChecker.DEFAULT.isSubtypeOf(type, other) } } } @@ -239,8 +239,8 @@ class CollectionStubMethodGenerator( return this.getOverriddenDescriptors().firstOrNull { it.getContainingDeclaration() == classDescriptor } } - private fun newType(classDescriptor: ClassDescriptor, typeArguments: List): JetType { - return JetTypeImpl.create(Annotations.EMPTY, classDescriptor, false, typeArguments) + private fun newType(classDescriptor: ClassDescriptor, typeArguments: List): KtType { + return KtTypeImpl.create(Annotations.EMPTY, classDescriptor, false, typeArguments) } private fun FunctionDescriptor.signature(): JvmMethodSignature = typeMapper.mapSignature(this) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueLoader.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueLoader.java index 1d398ecb68e..db4d853780e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueLoader.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueLoader.java @@ -17,7 +17,7 @@ package org.jetbrains.kotlin.codegen; import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor; -import org.jetbrains.kotlin.psi.JetParameter; +import org.jetbrains.kotlin.psi.KtParameter; import static org.jetbrains.kotlin.resolve.DescriptorToSourceUtils.descriptorToDeclaration; @@ -31,7 +31,7 @@ public interface DefaultParameterValueLoader { ValueParameterDescriptor descriptor, ExpressionCodegen codegen ) { - JetParameter jetParameter = (JetParameter) descriptorToDeclaration(descriptor); + KtParameter jetParameter = (KtParameter) descriptorToDeclaration(descriptor); assert jetParameter != null; return codegen.gen(jetParameter.getDefaultValue()); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueSubstitutor.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueSubstitutor.kt index 1f8c079a177..05380c8a32d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueSubstitutor.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/DefaultParameterValueSubstitutor.kt @@ -19,9 +19,9 @@ package org.jetbrains.kotlin.codegen import org.jetbrains.kotlin.codegen.binding.CodegenBinding import org.jetbrains.kotlin.codegen.state.GenerationState import org.jetbrains.kotlin.descriptors.* -import org.jetbrains.kotlin.psi.JetClass -import org.jetbrains.kotlin.psi.JetClassOrObject -import org.jetbrains.kotlin.psi.JetElement +import org.jetbrains.kotlin.psi.KtClass +import org.jetbrains.kotlin.psi.KtClassOrObject +import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.resolve.descriptorUtil.hasDefaultValue import org.jetbrains.kotlin.resolve.jvm.AsmTypes import org.jetbrains.kotlin.resolve.jvm.annotations.hasJvmOverloadsAnnotation @@ -42,7 +42,7 @@ public class DefaultParameterValueSubstitutor(val state: GenerationState) { constructorDescriptor: ConstructorDescriptor, classBuilder: ClassBuilder, contextKind: OwnerKind, - classOrObject: JetClassOrObject + classOrObject: KtClassOrObject ) { if (generateOverloadsIfNeeded(classOrObject, constructorDescriptor, constructorDescriptor, contextKind, classBuilder)) { return @@ -70,7 +70,7 @@ public class DefaultParameterValueSubstitutor(val state: GenerationState) { * @return true if the overloads annotation was found on the element, false otherwise */ fun generateOverloadsIfNeeded( - methodElement: JetElement?, + methodElement: KtElement?, functionDescriptor: FunctionDescriptor, delegateFunctionDescriptor: FunctionDescriptor, contextKind: OwnerKind, @@ -109,7 +109,7 @@ public class DefaultParameterValueSubstitutor(val state: GenerationState) { functionDescriptor: FunctionDescriptor, delegateFunctionDescriptor: FunctionDescriptor, classBuilder: ClassBuilder, - methodElement: JetElement?, + methodElement: KtElement?, contextKind: OwnerKind, substituteCount: Int ) { @@ -208,7 +208,7 @@ public class DefaultParameterValueSubstitutor(val state: GenerationState) { return functionDescriptor.getValueParameters().filter { !it.declaresDefaultValue() || --remainingCount >= 0 } } - private fun isEmptyConstructorNeeded(constructorDescriptor: ConstructorDescriptor, classOrObject: JetClassOrObject): Boolean { + private fun isEmptyConstructorNeeded(constructorDescriptor: ConstructorDescriptor, classOrObject: KtClassOrObject): Boolean { val classDescriptor = constructorDescriptor.getContainingDeclaration() if (classDescriptor.getKind() != ClassKind.CLASS) return false @@ -220,12 +220,12 @@ public class DefaultParameterValueSubstitutor(val state: GenerationState) { return false if (constructorDescriptor.getValueParameters().isEmpty()) return false - if (classOrObject is JetClass && hasSecondaryConstructorsWithNoParameters(classOrObject)) return false + if (classOrObject is KtClass && hasSecondaryConstructorsWithNoParameters(classOrObject)) return false return constructorDescriptor.getValueParameters().all { it.declaresDefaultValue() } } - private fun hasSecondaryConstructorsWithNoParameters(klass: JetClass) = + private fun hasSecondaryConstructorsWithNoParameters(klass: KtClass) = klass.getSecondaryConstructors().any { it.getValueParameters().isEmpty() } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index b1a8bfdb756..6fab26b15f3 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -54,7 +54,7 @@ import org.jetbrains.kotlin.diagnostics.Errors; import org.jetbrains.kotlin.incremental.components.NoLookupLocation; import org.jetbrains.kotlin.jvm.RuntimeAssertionInfo; import org.jetbrains.kotlin.jvm.bindingContextSlices.BindingContextSlicesKt; -import org.jetbrains.kotlin.lexer.JetTokens; +import org.jetbrains.kotlin.lexer.KtTokens; import org.jetbrains.kotlin.load.java.descriptors.SamConstructorDescriptor; import org.jetbrains.kotlin.name.Name; import org.jetbrains.kotlin.psi.*; @@ -80,10 +80,10 @@ import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterSignature import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature; import org.jetbrains.kotlin.resolve.scopes.receivers.*; import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor; -import org.jetbrains.kotlin.types.JetType; +import org.jetbrains.kotlin.types.KtType; import org.jetbrains.kotlin.types.TypeProjection; import org.jetbrains.kotlin.types.TypeUtils; -import org.jetbrains.kotlin.types.checker.JetTypeChecker; +import org.jetbrains.kotlin.types.checker.KotlinTypeChecker; import org.jetbrains.org.objectweb.asm.Label; import org.jetbrains.org.objectweb.asm.MethodVisitor; import org.jetbrains.org.objectweb.asm.Opcodes; @@ -104,7 +104,7 @@ import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*; import static org.jetbrains.kotlin.resolve.jvm.annotations.AnnotationUtilKt.hasJvmFieldAnnotation; import static org.jetbrains.org.objectweb.asm.Opcodes.*; -public class ExpressionCodegen extends JetVisitor implements LocalLookup { +public class ExpressionCodegen extends KtVisitor implements LocalLookup { private final GenerationState state; final JetTypeMapper typeMapper; private final BindingContext bindingContext; @@ -125,7 +125,7 @@ public class ExpressionCodegen extends JetVisitor implem * When we create a temporary variable to hold some value not to compute it many times * we put it into this map to emit access to that variable instead of evaluating the whole expression */ - public final Map tempVariables = Maps.newHashMap(); + public final Map tempVariables = Maps.newHashMap(); private int myLastLineNumber = -1; private boolean shouldMarkLineNumbers = true; @@ -156,9 +156,9 @@ public class ExpressionCodegen extends JetVisitor implem static class LoopBlockStackElement extends BlockStackElement { final Label continueLabel; final Label breakLabel; - public final JetSimpleNameExpression targetLabel; + public final KtSimpleNameExpression targetLabel; - LoopBlockStackElement(Label breakLabel, Label continueLabel, JetSimpleNameExpression targetLabel) { + LoopBlockStackElement(Label breakLabel, Label continueLabel, KtSimpleNameExpression targetLabel) { this.breakLabel = breakLabel; this.continueLabel = continueLabel; this.targetLabel = targetLabel; @@ -168,9 +168,9 @@ public class ExpressionCodegen extends JetVisitor implem static class FinallyBlockStackElement extends BlockStackElement { List