Fix warnings
This commit is contained in:
@@ -87,7 +87,7 @@ fun JetClassOrObject.effectiveDeclarations(): List<JetDeclaration> =
|
||||
fun JetClass.isAbstract() = isTrait() || hasModifier(JetTokens.ABSTRACT_KEYWORD)
|
||||
|
||||
[suppress("UNCHECKED_CAST")]
|
||||
fun <T: PsiElement> PsiElement.replaced(newElement: T): T = replace(newElement)!! as T
|
||||
fun <T: PsiElement> PsiElement.replaced(newElement: T): T = replace(newElement) as T
|
||||
|
||||
fun JetElement.blockExpressionsOrSingle(): Iterator<JetElement> =
|
||||
if (this is JetBlockExpression) getStatements().iterator() else SingleIterator(this)
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class KotlinCallHierarchyNodeDescriptor extends HierarchyNodeDescriptor i
|
||||
|
||||
@Override
|
||||
public final boolean isValid(){
|
||||
return myElement != null && myElement.isValid();
|
||||
return myElement.isValid();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-10
@@ -23,7 +23,6 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
@@ -93,8 +92,9 @@ public class KotlinCalleeMethodsTreeStructure extends KotlinCallTreeStructure {
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Object[] buildChildren(HierarchyNodeDescriptor descriptor) {
|
||||
protected Object[] buildChildren(@NotNull HierarchyNodeDescriptor descriptor) {
|
||||
PsiElement targetElement = getTargetElement(descriptor);
|
||||
|
||||
// Kotlin class constructor invoked from Java code
|
||||
@@ -118,14 +118,10 @@ public class KotlinCalleeMethodsTreeStructure extends KotlinCallTreeStructure {
|
||||
return buildChildrenByKotlinTarget(descriptor, (JetElement) targetElement);
|
||||
}
|
||||
|
||||
if (javaTreeStructure != null) {
|
||||
CallHierarchyNodeDescriptor javaDescriptor = descriptor instanceof CallHierarchyNodeDescriptor
|
||||
? (CallHierarchyNodeDescriptor) descriptor
|
||||
: ((KotlinCallHierarchyNodeDescriptor)descriptor).getJavaDelegate();
|
||||
return javaTreeStructure.getChildElements(javaDescriptor);
|
||||
}
|
||||
|
||||
return ArrayUtil.EMPTY_OBJECT_ARRAY;
|
||||
CallHierarchyNodeDescriptor javaDescriptor = descriptor instanceof CallHierarchyNodeDescriptor
|
||||
? (CallHierarchyNodeDescriptor) descriptor
|
||||
: ((KotlinCallHierarchyNodeDescriptor)descriptor).getJavaDelegate();
|
||||
return javaTreeStructure.getChildElements(javaDescriptor);
|
||||
}
|
||||
|
||||
private Object[] buildChildrenByKotlinTarget(HierarchyNodeDescriptor descriptor, JetElement targetElement) {
|
||||
|
||||
+5
-3
@@ -57,8 +57,9 @@ public abstract class KotlinCallerMethodsTreeStructure extends KotlinCallTreeStr
|
||||
this.codeBlockForLocalDeclaration = codeBlockForLocalDeclaration;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Object[] buildChildren(HierarchyNodeDescriptor descriptor) {
|
||||
protected Object[] buildChildren(@NotNull HierarchyNodeDescriptor descriptor) {
|
||||
final PsiElement element = getTargetElement(descriptor);
|
||||
|
||||
BindingContext bindingContext =
|
||||
@@ -97,8 +98,9 @@ public abstract class KotlinCallerMethodsTreeStructure extends KotlinCallTreeStr
|
||||
this.javaTreeStructure = new CallerMethodsTreeStructure(project, basePsiMethod, scopeType);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Object[] buildChildren(HierarchyNodeDescriptor descriptor) {
|
||||
protected Object[] buildChildren(@NotNull HierarchyNodeDescriptor descriptor) {
|
||||
PsiElement element = getTargetElement(descriptor);
|
||||
|
||||
SearchScope searchScope = getSearchScope(scopeType, basePsiClass);
|
||||
@@ -106,7 +108,7 @@ public abstract class KotlinCallerMethodsTreeStructure extends KotlinCallTreeStr
|
||||
new HashMap<PsiElement, HierarchyNodeDescriptor>();
|
||||
|
||||
Object[] javaCallers = null;
|
||||
if (element instanceof PsiMethod && javaTreeStructure != null) {
|
||||
if (element instanceof PsiMethod) {
|
||||
javaCallers = javaTreeStructure.getChildElements(getJavaNodeDescriptor(descriptor));
|
||||
processPsiMethodCallers((PsiMethod) element, descriptor, methodToDescriptorMap, searchScope, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user