rename Jet* classes to Kt*

This commit is contained in:
Dmitry Jemerov
2015-10-19 18:43:17 +02:00
parent 660972b12d
commit 49033e0002
1965 changed files with 23732 additions and 23757 deletions
@@ -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<ValueParameterDescriptor> 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;
}
}
@@ -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<CallableMemberDescriptor, CallableDescriptor> {
if (delegateExpressionType?.isDynamic() ?: false) return mapOf();
@@ -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<JetParameter> constructorParameters);
protected abstract void generateCopyFunction(@NotNull FunctionDescriptor function, @NotNull List<KtParameter> constructorParameters);
protected abstract void generateToStringMethod(@NotNull FunctionDescriptor function, @NotNull List<PropertyDescriptor> properties);
@@ -93,7 +93,7 @@ public abstract class DataClassMethodGenerator {
}
}
private void generateCopyFunctionForDataClasses(List<JetParameter> constructorParameters) {
private void generateCopyFunctionForDataClasses(List<KtParameter> 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<PropertyDescriptor> getDataProperties() {
List<PropertyDescriptor> 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<JetParameter> getPrimaryConstructorParameters() {
if (declaration instanceof JetClass) {
private List<KtParameter> getPrimaryConstructorParameters() {
if (declaration instanceof KtClass) {
return declaration.getPrimaryConstructorParameters();
}
return Collections.emptyList();