Replaced some ifs with asserts.
This commit is contained in:
@@ -145,10 +145,7 @@ public class JetSourceNavigationHelper {
|
|||||||
NavigationStrategy<Decl, Descr> navigationStrategy
|
NavigationStrategy<Decl, Descr> navigationStrategy
|
||||||
) {
|
) {
|
||||||
String entityName = decompiledDeclaration.getName();
|
String entityName = decompiledDeclaration.getName();
|
||||||
if (entityName == null) {
|
assert entityName != null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Name entityNameAsName = Name.identifier(entityName);
|
Name entityNameAsName = Name.identifier(entityName);
|
||||||
|
|
||||||
JetTypeReference receiverType = navigationStrategy.getReceiverType(decompiledDeclaration);
|
JetTypeReference receiverType = navigationStrategy.getReceiverType(decompiledDeclaration);
|
||||||
@@ -172,9 +169,8 @@ public class JetSourceNavigationHelper {
|
|||||||
JetClassOrObject parent = (JetClassOrObject)declarationContainer.getParent();
|
JetClassOrObject parent = (JetClassOrObject)declarationContainer.getParent();
|
||||||
boolean isClassObject = parent instanceof JetObjectDeclaration && parent.getParent() instanceof JetClassObject;
|
boolean isClassObject = parent instanceof JetObjectDeclaration && parent.getParent() instanceof JetClassObject;
|
||||||
JetClassOrObject classOrObject = isClassObject ? PsiTreeUtil.getParentOfType(parent, JetClass.class) : parent;
|
JetClassOrObject classOrObject = isClassObject ? PsiTreeUtil.getParentOfType(parent, JetClass.class) : parent;
|
||||||
if (classOrObject == null) {
|
assert classOrObject != null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Pair<BindingContext, ClassDescriptor> bindingContextAndClassDescriptor = getBindingContextAndClassDescriptor(classOrObject);
|
Pair<BindingContext, ClassDescriptor> bindingContextAndClassDescriptor = getBindingContextAndClassDescriptor(classOrObject);
|
||||||
if (bindingContextAndClassDescriptor != null) {
|
if (bindingContextAndClassDescriptor != null) {
|
||||||
BindingContext bindingContext = bindingContextAndClassDescriptor.first;
|
BindingContext bindingContext = bindingContextAndClassDescriptor.first;
|
||||||
@@ -182,9 +178,7 @@ public class JetSourceNavigationHelper {
|
|||||||
JetScope memberScope = classDescriptor.getDefaultType().getMemberScope();
|
JetScope memberScope = classDescriptor.getDefaultType().getMemberScope();
|
||||||
if (isClassObject) {
|
if (isClassObject) {
|
||||||
JetType classObjectType = classDescriptor.getClassObjectType();
|
JetType classObjectType = classDescriptor.getClassObjectType();
|
||||||
if (classObjectType == null) {
|
assert classObjectType != null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
memberScope = classObjectType.getMemberScope();
|
memberScope = classObjectType.getMemberScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user