Minor. Renamed method.
This commit is contained in:
+2
-2
@@ -172,7 +172,7 @@ public class JavaToKotlinClassMap extends JavaToKotlinClassMapBuilder implements
|
||||
@Override
|
||||
@NotNull
|
||||
public Collection<ClassDescriptor> mapPlatformClass(@NotNull ClassDescriptor classDescriptor) {
|
||||
FqNameUnsafe className = DescriptorUtils.getFQName(classDescriptor);
|
||||
FqNameUnsafe className = DescriptorUtils.getFqName(classDescriptor);
|
||||
if (!className.isSafe()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
@@ -182,7 +182,7 @@ public class JavaToKotlinClassMap extends JavaToKotlinClassMapBuilder implements
|
||||
@Override
|
||||
@NotNull
|
||||
public Collection<ClassDescriptor> mapPlatformClassesInside(@NotNull DeclarationDescriptor containingDeclaration) {
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFQName(containingDeclaration);
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFqName(containingDeclaration);
|
||||
if (!fqName.isSafe()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
||||
|
||||
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.DescriptorUtils.isEnumClassObject;
|
||||
|
||||
public final class DescriptorResolverUtils {
|
||||
@@ -338,7 +338,7 @@ public final class DescriptorResolverUtils {
|
||||
"java class " + javaClass + " is under non-java fragment: " + packageFragment;
|
||||
|
||||
JavaPackageFragmentProvider provider = ((JavaPackageFragmentDescriptor) packageFragment).getProvider();
|
||||
return provider.getOrCreatePackage(getFQName(javaClass).toSafe());
|
||||
return provider.getOrCreatePackage(getFqName(javaClass).toSafe());
|
||||
}
|
||||
|
||||
public static boolean isJavaClassVisibleAsPackage(@NotNull JavaClass javaClass) {
|
||||
|
||||
+1
-1
@@ -320,7 +320,7 @@ public final class JavaClassResolver {
|
||||
FqName containerFqName = methodContainer.getFqName();
|
||||
assert containerFqName != null : "qualified name is null for " + methodContainer;
|
||||
|
||||
if (DescriptorUtils.getFQName(samInterface).equalsTo(containerFqName)) {
|
||||
if (DescriptorUtils.getFqName(samInterface).equalsTo(containerFqName)) {
|
||||
SimpleFunctionDescriptor abstractMethod = functionResolver.resolveFunctionMutely(samInterfaceMethod, samInterface);
|
||||
assert abstractMethod != null : "couldn't resolve method " + samInterfaceMethod;
|
||||
return abstractMethod;
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ public class TypeParameterDescriptorImpl extends DeclarationDescriptorNonRootImp
|
||||
}
|
||||
|
||||
private String nameForAssertions() {
|
||||
return getName() + " declared in " + DescriptorUtils.getFQName(getContainingDeclaration());
|
||||
return getName() + " declared in " + DescriptorUtils.getFqName(getContainingDeclaration());
|
||||
}
|
||||
|
||||
public void setInitialized() {
|
||||
|
||||
@@ -109,7 +109,7 @@ public class DescriptorUtils {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static FqNameUnsafe getFQName(@NotNull DeclarationDescriptor descriptor) {
|
||||
public static FqNameUnsafe getFqName(@NotNull DeclarationDescriptor descriptor) {
|
||||
DeclarationDescriptor containingDeclaration = descriptor.getContainingDeclaration();
|
||||
|
||||
if (descriptor instanceof ModuleDescriptor || ErrorUtils.isError(descriptor)) {
|
||||
@@ -126,10 +126,10 @@ public class DescriptorUtils {
|
||||
if (containingDeclaration instanceof ClassDescriptor && ((ClassDescriptor) containingDeclaration).getKind() == ClassKind.CLASS_OBJECT) {
|
||||
DeclarationDescriptor classOfClassObject = containingDeclaration.getContainingDeclaration();
|
||||
assert classOfClassObject != null;
|
||||
return getFQName(classOfClassObject).child(descriptor.getName());
|
||||
return getFqName(classOfClassObject).child(descriptor.getName());
|
||||
}
|
||||
|
||||
return getFQName(containingDeclaration).child(descriptor.getName());
|
||||
return getFqName(containingDeclaration).child(descriptor.getName());
|
||||
}
|
||||
|
||||
public static boolean isTopLevelDeclaration(@NotNull DeclarationDescriptor descriptor) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor
|
||||
|
||||
public fun ClassDescriptor.checkSuperTypeByFQName(qualifiedName: String, deep: Boolean): Boolean {
|
||||
fun checkDescriptor(descriptor: DeclarationDescriptor): Boolean {
|
||||
return qualifiedName == DescriptorUtils.getFQName(descriptor).asString()
|
||||
return qualifiedName == DescriptorUtils.getFqName(descriptor).asString()
|
||||
}
|
||||
|
||||
if (deep && checkDescriptor(this)) return true
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@ public interface RedeclarationHandler {
|
||||
@Override
|
||||
public void handleRedeclaration(@NotNull DeclarationDescriptor first, @NotNull DeclarationDescriptor second) {
|
||||
throw new IllegalStateException(
|
||||
String.format("Redeclaration: %s (%s) and %s (%s) (no line info available)", DescriptorUtils.getFQName(first), first,
|
||||
DescriptorUtils.getFQName(second), second)
|
||||
String.format("Redeclaration: %s (%s) and %s (%s) (no line info available)", DescriptorUtils.getFqName(first), first,
|
||||
DescriptorUtils.getFqName(second), second)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -197,7 +197,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
|
||||
Collections.reverse(qualifiedNameElements);
|
||||
return renderFqName(qualifiedNameElements);
|
||||
}
|
||||
return renderFqName(DescriptorUtils.getFQName(klass));
|
||||
return renderFqName(DescriptorUtils.getFqName(klass));
|
||||
}
|
||||
|
||||
/* TYPES RENDERING */
|
||||
@@ -299,7 +299,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
|
||||
|
||||
DeclarationDescriptor containingDeclaration = descriptor.getContainingDeclaration();
|
||||
if (containingDeclaration != null) {
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFQName(containingDeclaration);
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFqName(containingDeclaration);
|
||||
builder.append(FqName.ROOT.equalsTo(fqName) ? "root package" : renderFqName(fqName));
|
||||
}
|
||||
}
|
||||
@@ -310,7 +310,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
|
||||
ClassDescriptor annotationClass = (ClassDescriptor) annotation.getType().getConstructor().getDeclarationDescriptor();
|
||||
assert annotationClass != null;
|
||||
|
||||
if (!excludedAnnotationClasses.contains(DescriptorUtils.getFQName(annotationClass).toSafe())) {
|
||||
if (!excludedAnnotationClasses.contains(DescriptorUtils.getFqName(annotationClass).toSafe())) {
|
||||
builder.append(renderType(annotation.getType()));
|
||||
if (verbose) {
|
||||
builder.append("(").append(StringUtil.join(DescriptorUtils.getSortedValueArguments(annotation, this), ", ")).append(")");
|
||||
|
||||
Reference in New Issue
Block a user