Fixed failed assertions on navigating to 'Assertions' class of Kotlin runtime

This commit is contained in:
Evgeny Gerashchenko
2012-04-24 17:50:57 +04:00
parent 8c2457195e
commit cc7284c67e
3 changed files with 9 additions and 8 deletions
@@ -336,7 +336,11 @@ public class DescriptorRenderer implements Renderer<DeclarationDescriptor> {
}
private void renderVisibility(Visibility visibility, StringBuilder builder) {
builder.append(renderKeyword(visibility.toString())).append(" ");
if ("package".equals(visibility.toString())) {
builder.append("public/*package*/ ");
} else {
builder.append(renderKeyword(visibility.toString())).append(" ");
}
}
private void renderModality(Modality modality, StringBuilder builder) {
@@ -21,10 +21,7 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.impl.compiled.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.JetClass;
import org.jetbrains.jet.lang.psi.JetDeclaration;
import org.jetbrains.jet.lang.psi.JetFunction;
import org.jetbrains.jet.lang.psi.JetProperty;
import org.jetbrains.jet.lang.psi.*;
/**
* @author Evgeny Gerashchenko
@@ -39,7 +36,7 @@ public class JetClsNavigationPolicy implements ClsCustomNavigationPolicy {
}
JetClass jetClass = (JetClass) getJetDeclarationByClsElement(clsClass);
if (jetClass != null) {
JetClass sourceClass = JetSourceNavigationHelper.getSourceClass(jetClass);
JetClassOrObject sourceClass = JetSourceNavigationHelper.getSourceClass(jetClass);
if (sourceClass != null) {
return sourceClass;
}
@@ -93,7 +93,7 @@ public class JetSourceNavigationHelper {
}
@Nullable
public static JetClass getSourceClass(@NotNull JetClass decompiledClass) {
public static JetClassOrObject getSourceClass(@NotNull JetClass decompiledClass) {
Tuple2<BindingContext, ClassDescriptor> bindingContextAndClassDescriptor = getBindingContextAndClassDescriptor(decompiledClass);
if (bindingContextAndClassDescriptor == null) return null;
PsiElement declaration = BindingContextUtils.classDescriptorToDeclaration(
@@ -101,7 +101,7 @@ public class JetSourceNavigationHelper {
if (declaration == null) {
throw new IllegalStateException("class not found by " + bindingContextAndClassDescriptor._2);
}
return (JetClass) declaration;
return (JetClassOrObject) declaration;
}
@NotNull