Minor. Renamed method.
This commit is contained in:
@@ -109,7 +109,7 @@ public class RangeCodegenUtil {
|
||||
// Must be a standard library class
|
||||
return null;
|
||||
}
|
||||
return map.get(DescriptorUtils.getFQName(declarationDescriptor).toSafe());
|
||||
return map.get(DescriptorUtils.getFqName(declarationDescriptor).toSafe());
|
||||
}
|
||||
|
||||
public static boolean isOptimizableRangeTo(CallableDescriptor rangeTo) {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.asm4.MethodVisitor;
|
||||
@@ -136,6 +135,7 @@ public class SamWrapperCodegen extends ParentCodegenAwareImpl {
|
||||
FqName packageClassFqName = PackageClassUtils.getPackageClassFqName(JetPsiUtil.getFQName(containingFile));
|
||||
String packageInternalName = JvmClassName.byFqNameWithoutInnerClasses(packageClassFqName).getInternalName();
|
||||
return packageInternalName + "$sam$" + samInterface.getName().asString() + "$" +
|
||||
Integer.toHexString(CodegenUtil.getPathHashCode(containingFile.getVirtualFile()) * 31 + DescriptorUtils.getFQName(samInterface).hashCode());
|
||||
Integer.toHexString(CodegenUtil.getPathHashCode(containingFile.getVirtualFile()) * 31 + DescriptorUtils.getFqName(
|
||||
samInterface).hashCode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public class IntrinsicMethods {
|
||||
declareIntrinsicProperty(Name.identifier("CharSequence"), Name.identifier("length"), new StringLength());
|
||||
declareIntrinsicProperty(Name.identifier("String"), Name.identifier("length"), new StringLength());
|
||||
|
||||
registerStaticField(getFQName(KotlinBuiltIns.getInstance().getUnit()).toSafe(), Name.identifier("VALUE"));
|
||||
registerStaticField(getFqName(KotlinBuiltIns.getInstance().getUnit()).toSafe(), Name.identifier("VALUE"));
|
||||
|
||||
for (PrimitiveType type : PrimitiveType.NUMBER_TYPES) {
|
||||
FqName rangeClassFqName = RangeCodegenUtil.getRangeClassFqName(type);
|
||||
|
||||
@@ -97,7 +97,7 @@ class IntrinsicsMap {
|
||||
@Nullable
|
||||
public IntrinsicMethod getIntrinsic(@NotNull CallableMemberDescriptor descriptor) {
|
||||
Key key = new Key(
|
||||
DescriptorUtils.getFQName(descriptor.getContainingDeclaration()),
|
||||
DescriptorUtils.getFqName(descriptor.getContainingDeclaration()),
|
||||
descriptor.getName(),
|
||||
valueParameterCountForKey(descriptor));
|
||||
return intrinsicsMap.get(key);
|
||||
|
||||
@@ -233,7 +233,7 @@ public class JetTypeMapper extends BindingTraceAware {
|
||||
DeclarationDescriptor descriptor = jetType.getConstructor().getDeclarationDescriptor();
|
||||
|
||||
if (descriptor instanceof ClassDescriptor) {
|
||||
FqNameUnsafe className = DescriptorUtils.getFQName(descriptor);
|
||||
FqNameUnsafe className = DescriptorUtils.getFqName(descriptor);
|
||||
if (className.isSafe()) {
|
||||
known = KotlinToJavaTypesMap.getInstance().getJavaAnalog(className.toSafe(), jetType.isNullable());
|
||||
}
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ public final class AnalyzerWithCompilerReport {
|
||||
if (!incompletes.isEmpty()) {
|
||||
StringBuilder message = new StringBuilder("The following classes have incomplete hierarchies:\n");
|
||||
for (ClassDescriptor incomplete : incompletes) {
|
||||
String fqName = DescriptorUtils.getFQName(incomplete).asString();
|
||||
String fqName = DescriptorUtils.getFqName(incomplete).asString();
|
||||
message.append(" ").append(fqName).append("\n");
|
||||
}
|
||||
messageCollectorWrapper.report(CompilerMessageSeverity.ERROR, message.toString(), CompilerMessageLocation.NO_LOCATION);
|
||||
|
||||
+5
-5
@@ -51,7 +51,7 @@ import org.jetbrains.jet.renderer.DescriptorRenderer;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getFQName;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getFqName;
|
||||
import static org.jetbrains.jet.lang.resolve.java.resolver.TypeUsage.*;
|
||||
import static org.jetbrains.jet.lang.types.Variance.INVARIANT;
|
||||
|
||||
@@ -169,7 +169,7 @@ public class SignaturesPropagationData {
|
||||
) {
|
||||
assert receiverType == null : "Parameters before propagation have receiver type," +
|
||||
" but propagation should be disabled for functions compiled from Kotlin in class: " +
|
||||
DescriptorUtils.getFQName(containingClass);
|
||||
DescriptorUtils.getFqName(containingClass);
|
||||
|
||||
JetType resultReceiverType = null;
|
||||
List<ValueParameterDescriptor> resultParameters = Lists.newArrayList();
|
||||
@@ -260,8 +260,8 @@ public class SignaturesPropagationData {
|
||||
Collections.sort(superFunctions, new Comparator<FunctionDescriptor>() {
|
||||
@Override
|
||||
public int compare(FunctionDescriptor fun1, FunctionDescriptor fun2) {
|
||||
FqNameUnsafe fqName1 = getFQName(fun1.getContainingDeclaration());
|
||||
FqNameUnsafe fqName2 = getFQName(fun2.getContainingDeclaration());
|
||||
FqNameUnsafe fqName1 = getFqName(fun1.getContainingDeclaration());
|
||||
FqNameUnsafe fqName2 = getFqName(fun2.getContainingDeclaration());
|
||||
return fqName1.asString().compareTo(fqName2.asString());
|
||||
}
|
||||
});
|
||||
@@ -282,7 +282,7 @@ public class SignaturesPropagationData {
|
||||
for (JetType supertype : TypeUtils.getAllSupertypes(containingClass.getDefaultType())) {
|
||||
ClassifierDescriptor klass = supertype.getConstructor().getDeclarationDescriptor();
|
||||
assert klass != null;
|
||||
FqName fqName = DescriptorUtils.getFQName(klass).toSafe();
|
||||
FqName fqName = DescriptorUtils.getFqName(klass).toSafe();
|
||||
|
||||
for (FunctionDescriptor fun : klass.getDefaultType().getMemberScope().getFunctions(functionName)) {
|
||||
CallableMemberDescriptor.Kind kind = fun.getKind();
|
||||
|
||||
+5
-5
@@ -98,7 +98,7 @@ public class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
||||
}
|
||||
|
||||
private JetType visitCommonType(@NotNull ClassDescriptor classDescriptor, @NotNull JetTypeElement type) {
|
||||
return visitCommonType(DescriptorUtils.getFQName(classDescriptor).toSafe().asString(), type);
|
||||
return visitCommonType(DescriptorUtils.getFqName(classDescriptor).toSafe().asString(), type);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -109,7 +109,7 @@ public class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
||||
TypeConstructor originalTypeConstructor = originalType.getConstructor();
|
||||
ClassifierDescriptor declarationDescriptor = originalTypeConstructor.getDeclarationDescriptor();
|
||||
assert declarationDescriptor != null;
|
||||
FqName originalClassFqName = DescriptorUtils.getFQName(declarationDescriptor).toSafe();
|
||||
FqName originalClassFqName = DescriptorUtils.getFqName(declarationDescriptor).toSafe();
|
||||
ClassDescriptor classFromLibrary = getAutoTypeAnalogWithinBuiltins(originalClassFqName, qualifiedName);
|
||||
if (!isSameName(qualifiedName, originalClassFqName.asString()) && classFromLibrary == null) {
|
||||
throw new AlternativeSignatureMismatchException("Alternative signature type mismatch, expected: %s, actual: %s",
|
||||
@@ -191,7 +191,7 @@ public class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
||||
if (altProjectionKind == parameter.getVariance()) {
|
||||
if (strictMode) {
|
||||
throw new AlternativeSignatureMismatchException("Projection kind '%s' is redundant",
|
||||
altProjectionKind, DescriptorUtils.getFQName(typeConstructor.getDeclarationDescriptor()));
|
||||
altProjectionKind, DescriptorUtils.getFqName(typeConstructor.getDeclarationDescriptor()));
|
||||
}
|
||||
else {
|
||||
altProjectionKind = projectionKind;
|
||||
@@ -199,7 +199,7 @@ public class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
||||
}
|
||||
else {
|
||||
throw new AlternativeSignatureMismatchException("Projection kind '%s' is conflicting with variance of %s",
|
||||
altProjectionKind, DescriptorUtils.getFQName(typeConstructor.getDeclarationDescriptor()));
|
||||
altProjectionKind, DescriptorUtils.getFqName(typeConstructor.getDeclarationDescriptor()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ public class TypeTransformingVisitor extends JetVisitor<JetType, Void> {
|
||||
|
||||
Collection<ClassDescriptor> descriptors = JavaToKotlinClassMap.getInstance().mapPlatformClass(javaFqName);
|
||||
for (ClassDescriptor descriptor : descriptors) {
|
||||
String fqName = DescriptorUtils.getFQName(descriptor).asString();
|
||||
String fqName = DescriptorUtils.getFqName(descriptor).asString();
|
||||
if (isSameName(qualifiedName, fqName)) {
|
||||
return descriptor;
|
||||
}
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ public class KotlinToJavaTypesMap extends JavaToKotlinClassMapBuilder {
|
||||
@Override
|
||||
protected void register(@NotNull Class<?> javaClass, @NotNull ClassDescriptor kotlinDescriptor, @NotNull Direction direction) {
|
||||
if (direction == Direction.BOTH || direction == Direction.KOTLIN_TO_JAVA) {
|
||||
FqNameUnsafe fqNameUnsafe = DescriptorUtils.getFQName(kotlinDescriptor);
|
||||
FqNameUnsafe fqNameUnsafe = DescriptorUtils.getFqName(kotlinDescriptor);
|
||||
assert fqNameUnsafe.isSafe() : "FQ name of a mapped class should be safe: " + fqNameUnsafe;
|
||||
FqName fqName = fqNameUnsafe.toSafe();
|
||||
register(fqName, AsmTypeConstants.getType(javaClass));
|
||||
|
||||
@@ -312,7 +312,7 @@ public class Renderers {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int index = 0;
|
||||
for (ClassDescriptor descriptor : descriptors) {
|
||||
sb.append(DescriptorUtils.getFQName(descriptor).asString());
|
||||
sb.append(DescriptorUtils.getFqName(descriptor).asString());
|
||||
index++;
|
||||
if (index <= descriptors.size() - 2) {
|
||||
sb.append(", ");
|
||||
|
||||
@@ -126,7 +126,7 @@ public class AnnotationUtils {
|
||||
}
|
||||
|
||||
public static boolean isJavaLangClass(ClassDescriptor descriptor) {
|
||||
return "java.lang.Class".equals(DescriptorUtils.getFQName(descriptor).asString());
|
||||
return "java.lang.Class".equals(DescriptorUtils.getFqName(descriptor).asString());
|
||||
}
|
||||
|
||||
private AnnotationUtils() {
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getFQName;
|
||||
import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getFqName;
|
||||
|
||||
public class OverloadResolver {
|
||||
private TopDownAnalysisContext context;
|
||||
@@ -83,7 +83,7 @@ public class OverloadResolver {
|
||||
inClasses.put(classDescriptor, klass.getConstructors());
|
||||
}
|
||||
else if (containingDeclaration instanceof PackageFragmentDescriptor) {
|
||||
inPackages.put(getFQName(klass), klass.getConstructors());
|
||||
inPackages.put(getFqName(klass), klass.getConstructors());
|
||||
}
|
||||
else if (!(containingDeclaration instanceof FunctionDescriptor)) {
|
||||
throw new IllegalStateException();
|
||||
@@ -97,13 +97,13 @@ public class OverloadResolver {
|
||||
|
||||
for (SimpleFunctionDescriptor function : context.getFunctions().values()) {
|
||||
if (function.getContainingDeclaration() instanceof PackageFragmentDescriptor) {
|
||||
functionsByName.putValue(getFQName(function), function);
|
||||
functionsByName.putValue(getFqName(function), function);
|
||||
}
|
||||
}
|
||||
|
||||
for (PropertyDescriptor property : context.getProperties().values()) {
|
||||
if (property.getContainingDeclaration() instanceof PackageFragmentDescriptor) {
|
||||
functionsByName.putValue(getFQName(property), property);
|
||||
functionsByName.putValue(getFqName(property), property);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -402,7 +402,7 @@ public class QualifiedExpressionResolver {
|
||||
}
|
||||
|
||||
if (packageView != null && classDescriptor != null) {
|
||||
if (DescriptorUtils.getFQName(packageView).equalsTo(DescriptorUtils.getFQName(classDescriptor))) {
|
||||
if (DescriptorUtils.getFqName(packageView).equalsTo(DescriptorUtils.getFqName(classDescriptor))) {
|
||||
trace.record(BindingContext.REFERENCE_TARGET, referenceExpression, classDescriptor);
|
||||
trace.record(BindingContext.RESOLUTION_SCOPE, referenceExpression, resolutionScope);
|
||||
checkVisibility(classDescriptor, trace, referenceExpression, scopeToCheckVisibility);
|
||||
|
||||
+1
-1
@@ -346,7 +346,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyDesc
|
||||
new Function0<Collection<JetType>>() {
|
||||
@Override
|
||||
public Collection<JetType> invoke() {
|
||||
if (resolveSession.isClassSpecial(DescriptorUtils.getFQName(LazyClassDescriptor.this))) {
|
||||
if (resolveSession.isClassSpecial(DescriptorUtils.getFqName(LazyClassDescriptor.this))) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -24,7 +24,6 @@ import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.declarations.PackageMemberDeclarationProvider;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
|
||||
@@ -48,7 +47,7 @@ public class LazyPackageMemberScope extends AbstractLazyMemberScope<PackageFragm
|
||||
@Override
|
||||
public ClassifierDescriptor getClassifier(@NotNull Name name) {
|
||||
// TODO: creating an FqName every time may be a performance problem
|
||||
Name actualName = resolveSession.resolveClassifierAlias(DescriptorUtils.getFQName(thisDescriptor).toSafe(), name);
|
||||
Name actualName = resolveSession.resolveClassifierAlias(DescriptorUtils.getFqName(thisDescriptor).toSafe(), name);
|
||||
return super.getClassifier(actualName);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -370,7 +370,7 @@ public class KotlinLightClassForExplicitDeclaration extends KotlinWrappingLightC
|
||||
|
||||
ClassDescriptor deprecatedAnnotation = KotlinBuiltIns.getInstance().getDeprecatedAnnotation();
|
||||
String deprecatedName = deprecatedAnnotation.getName().asString();
|
||||
FqNameUnsafe deprecatedFqName = DescriptorUtils.getFQName(deprecatedAnnotation);
|
||||
FqNameUnsafe deprecatedFqName = DescriptorUtils.getFqName(deprecatedAnnotation);
|
||||
|
||||
for (JetAnnotationEntry annotationEntry : jetModifierList.getAnnotationEntries()) {
|
||||
JetTypeReference typeReference = annotationEntry.getTypeReference();
|
||||
@@ -419,7 +419,7 @@ public class KotlinLightClassForExplicitDeclaration extends KotlinWrappingLightC
|
||||
public boolean isInheritor(@NotNull PsiClass baseClass, boolean checkDeep) {
|
||||
String qualifiedName;
|
||||
if (baseClass instanceof KotlinLightClassForExplicitDeclaration) {
|
||||
qualifiedName = DescriptorUtils.getFQName(((KotlinLightClassForExplicitDeclaration) baseClass).getDescriptor()).asString();
|
||||
qualifiedName = DescriptorUtils.getFqName(((KotlinLightClassForExplicitDeclaration) baseClass).getDescriptor()).asString();
|
||||
}
|
||||
else {
|
||||
qualifiedName = baseClass.getQualifiedName();
|
||||
|
||||
@@ -58,7 +58,7 @@ public abstract class AbstractLoadCompiledKotlinTest extends TestCaseWithTmpdir
|
||||
|
||||
for (DeclarationDescriptor descriptor : packageFromBinary.getMemberScope().getAllDescriptors()) {
|
||||
if (descriptor instanceof ClassDescriptor) {
|
||||
assert descriptor instanceof DeserializedClassDescriptor : DescriptorUtils.getFQName(descriptor) + " is loaded as " + descriptor.getClass();
|
||||
assert descriptor instanceof DeserializedClassDescriptor : DescriptorUtils.getFqName(descriptor) + " is loaded as " + descriptor.getClass();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ExpectedLoadErrorsUtil {
|
||||
ClassDescriptor annotationClass = (ClassDescriptor) annotation.getType().getConstructor().getDeclarationDescriptor();
|
||||
assert annotationClass != null;
|
||||
|
||||
if (DescriptorUtils.getFQName(annotationClass).asString().equals(ANNOTATION_CLASS_NAME)) {
|
||||
if (DescriptorUtils.getFqName(annotationClass).asString().equals(ANNOTATION_CLASS_NAME)) {
|
||||
|
||||
// we expect exactly one annotation argument
|
||||
CompileTimeConstant<?> argument = annotation.getAllValueArguments().values().iterator().next();
|
||||
|
||||
@@ -188,7 +188,7 @@ public class JdkAnnotationsValidityTest extends UsefulTestCase {
|
||||
@Override
|
||||
public Void visitClassDescriptor(ClassDescriptor descriptor, Void data) {
|
||||
// skip java.util.Collection, etc.
|
||||
if (!JavaToKotlinClassMap.getInstance().mapPlatformClass(DescriptorUtils.getFQName(descriptor).toSafe()).isEmpty()) {
|
||||
if (!JavaToKotlinClassMap.getInstance().mapPlatformClass(DescriptorUtils.getFqName(descriptor).toSafe()).isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user