Inlined trivial method classDescriptorToDeclaration

This commit is contained in:
Evgeny Gerashchenko
2015-03-03 12:40:49 +03:00
parent 7b6f83815c
commit 8ab94a18ae
9 changed files with 13 additions and 17 deletions
@@ -100,7 +100,7 @@ public class DeclarationResolver {
continue
}
redeclarations.add(Pair(DescriptorToSourceUtils.classDescriptorToDeclaration(descriptor), descriptor.getName()))
redeclarations.add(Pair(DescriptorToSourceUtils.getSourceFromDescriptor(descriptor), descriptor.getName()))
if (descriptor2 is PropertyDescriptor) {
redeclarations.add(Pair(DescriptorToSourceUtils.descriptorToDeclaration(descriptor2), descriptor2.getName()))
}
@@ -210,7 +210,7 @@ public class DeclarationsChecker {
if (conflictingTypes.size() > 1) {
DeclarationDescriptor containingDeclaration = typeParameterDescriptor.getContainingDeclaration();
assert containingDeclaration instanceof ClassDescriptor : containingDeclaration;
JetClassOrObject psiElement = (JetClassOrObject) DescriptorToSourceUtils.classDescriptorToDeclaration(classDescriptor);
JetClassOrObject psiElement = (JetClassOrObject) DescriptorToSourceUtils.getSourceFromDescriptor(classDescriptor);
JetDelegationSpecifierList delegationSpecifierList = psiElement.getDelegationSpecifierList();
assert delegationSpecifierList != null;
// trace.getErrorHandler().genericError(delegationSpecifierList.getNode(), "Type parameter " + typeParameterDescriptor.getName() + " of " + containingDeclaration.getName() + " has inconsistent values: " + conflictingTypes);
@@ -20,7 +20,10 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource;
import org.jetbrains.kotlin.descriptors.PropertyAccessorDescriptor;
import org.jetbrains.kotlin.psi.JetFile;
import org.jetbrains.kotlin.resolve.source.SourcePackage;
@@ -72,11 +75,6 @@ public final class DescriptorToSourceUtils {
return null;
}
@Nullable
public static PsiElement classDescriptorToDeclaration(@NotNull ClassDescriptor clazz) {
return getSourceFromDescriptor(clazz);
}
@Nullable
public static JetFile getContainingFile(@NotNull DeclarationDescriptor declarationDescriptor) {
// declarationDescriptor may describe a synthesized element which doesn't have PSI
@@ -633,7 +633,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
@NotNull ClassDescriptor classDescriptor,
@NotNull ClassDescriptor superclass
) {
PsiElement psiElement = DescriptorToSourceUtils.classDescriptorToDeclaration(classDescriptor);
PsiElement psiElement = DescriptorToSourceUtils.getSourceFromDescriptor(classDescriptor);
PsiElement elementToMark = null;
if (psiElement instanceof JetClassOrObject) {